StochasticNumerics / mimclib

A software library for UQ methods
GNU General Public License v2.0
6 stars 8 forks source link

Is something wrong? #25

Closed pvilanova closed 8 years ago

pvilanova commented 8 years ago

I've pulled out the last version.

Run the GBM example with tolerances TOLs = 0.1*np.sqrt(2.)**-np.arange(0., 10.)

Plot the tag 'GBM' and obtained weird results (pdf file attached). Current version is broken or I am doing something wrong?

(I am using the compiled version of wcumsum)

mimc_results.pdf

haji-ali commented 8 years ago

I did the same and I am not seeing the same behavior.

Can you do the following? sudo pip install --upgrade MySQL-python and try plotting the results again?

pvilanova commented 8 years ago

I ran the command and I got: " Requirement already up-to-date: MySQL-python in /usr/local/lib/python2.7/dist-packages "

Virtakuono commented 8 years ago

I have trouble plotting the results, we tried this with Pedro and apparently its the same bug for both of us.

haji-ali commented 8 years ago

Can you copy-paste the plotting command that you are trying?

pvilanova commented 8 years ago

In my case the plotting command is not giving any error. In Juho's case yes.

haji-ali commented 8 years ago

Pedro, can you please give me the exact plotting command that you use? Juho, can you please give me the exact error message that you get?

Without these info I cannot really help you. Everything is working on my machine.

pvilanova commented 8 years ago

I am not sure this is what you need, but the command I ran is:

mimclib/tests/plot_data.py -tag GBM -dbhost localhost -db_user pv

Virtakuono commented 8 years ago

Sure thing, the command I use is ../plot_data.py -o ./testplot.pdf -db_tag GBM_test_v2

and

the error is

Traceback (most recent call last): File "../plot_data.py", line 60, in main() File "../plot_data.py", line 51, in main run_data = db.readRuns(db.getRunsIDs(tag=args.db_tag, done_flag=1)) File "/home/jhappola/mimclib/mimclib/db.py", line 313, in getRunsIDs ids = self._fetchArray(query, params) File "/home/jhappola/mimclib/mimclib/db.py", line 277, in _fetchArray dataAll = cur.execute(query, params if params else []) File "/home/jhappola/mimclib/mimclib/db.py", line 49, in execute self.cur.execute(query, tuple(params)) File "/usr/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 174, in execute self.errorhandler(self, exc, value) File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler raise errorclass, errorvalue _mysql_exceptions.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND tag LIKE 'GBM_test_v2' ORDER BY tag, dim,\n TOL' at line 1")

haji-ali commented 8 years ago

Pedro. That's what I thought. The command you are executing is wrong. It should be ./plot_data.py -db_tag GBM -db_host localhost -db_user pv

Note that the correct argument is db_tag. I added warning messages in the recent version that I pushed.

haji-ali commented 8 years ago

Juho, did you execute the pip upgrade command of MySQL-python? There was a bug in MySQL-python that got resolved recently.

pvilanova commented 8 years ago

Fixed. thanks.

Virtakuono commented 8 years ago

the pip upgrade crashes too: jhappola@shahino:~/mimclib/tests/gbm$ sudo pip install --upgrade MySQL-python The directory '/home/jhappola/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. The directory '/home/jhappola/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. /usr/local/lib/python2.7/dist-packages/pip/vendor/requests/packages/urllib3/util/ssl.py:315: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning. SNIMissingWarning /usr/local/lib/python2.7/dist-packages/pip/vendor/requests/packages/urllib3/util/ssl.py:120: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning. InsecurePlatformWarning Collecting MySQL-python Downloading MySQL-python-1.2.5.zip (108kB) 100% |████████████████████████████████| 112kB 244kB/s Complete output from command python setup.py egg_info: sh: 1: mysql_config: not found Traceback (most recent call last): File "", line 1, in File "/tmp/pip-build-cwGUWD/MySQL-python/setup.py", line 17, in metadata, options = get_config() File "/tmp/pip-build-cwGUWD/MySQL-python/setup_posix.py", line 43, in get_config libs = mysql_config("libs_r") File "/tmp/pip-build-cwGUWD/MySQL-python/setup_posix.py", line 25, in mysql_config raise EnvironmentError("%s not found" % (mysql_config.path,)) EnvironmentError: mysql_config not found

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-cwGUWD/MySQL-python/ /usr/local/lib/python2.7/dist-packages/pip/vendor/requests/packages/urllib3/util/ssl.py:120: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning. InsecurePlatformWarning

haji-ali commented 8 years ago

Juho, see http://stackoverflow.com/questions/5178292/pip-install-mysql-python-fails-with-environmenterror-mysql-config-not-found#5178698

and check that your pip is for python 2.7 not python 3.5

Virtakuono commented 8 years ago

Ok, now I did the stackoverflow thing, and as a result I could pip update python-mysql.

However, the problem remains:

jhappola@shahino:~/mimclib/tests/gbm$ ../plot_data.py -o ./testplot.pdf -db_tag GBM_test_v2 Traceback (most recent call last): File "../plot_data.py", line 60, in main() File "../plot_data.py", line 51, in main run_data = db.readRuns(db.getRunsIDs(tag=args.db_tag, done_flag=1)) File "/home/jhappola/mimclib/mimclib/db.py", line 201, in readRuns dataTable=self.dataTable), [run_ids]).fetchall() File "/home/jhappola/mimclib/mimclib/db.py", line 49, in execute self.cur.execute(query, tuple(params)) File "/usr/local/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 205, in execute self.errorhandler(self, exc, value) File "/usr/local/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler raise errorclass, errorvalue _mysql_exceptions.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') GROUP BY\n r.run_id, r.params, r.TOL, r.comment' at line 3")

haji-ali commented 8 years ago

This error is different from the one before.

Are you sure that the tag is correct? It seems to me that there are no runs with that tag. I added an extra check for that case in the version I just pushed.

Virtakuono commented 8 years ago

Ok, now I feel like an idiot.

Apparently it only saves to database if i set -multi tag to true :E

Sorry for the hassle.

haji-ali commented 8 years ago

Yes, you can change your "echo" file to change that behaviour.