You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, if I try to load in any variables from Matlab that contain infs or NaNs, the program does the "right thing", but the variables get returned polluted with error messages where the fields should be.
In the IPython Notebook, this can cause the get_variable routine to hang indefinitely. Usually, however, we get something like the following:
Did some quick digging, and it seems this fix will have to be implemented on the MATLAB side, since that's where the JSON encoding is happening. Specifically, around line 161 of json_dump.m is where the Java exception occurs.
Per the following stack overflow answer, http://stackoverflow.com/questions/13581843/php-how-to-encode-infinity-or-nan-numbers-to-json
I will try to throw together a fix that treats +-inf and NaN as special cases when encoding the JSON, since JSON does not support either of these values natively (it appears that people usually just convert them to strings before encoding when working in Javascript, for example).
Currently, if I try to load in any variables from Matlab that contain infs or NaNs, the program does the "right thing", but the variables get returned polluted with error messages where the fields should be.
In the IPython Notebook, this can cause the get_variable routine to hang indefinitely. Usually, however, we get something like the following:
Seems like a simple hack around the problem would be to simply return scalars as 1-by-1 numpy arrays instead...
The text was updated successfully, but these errors were encountered: