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:
In [1]: lab.run_code('a.b = inf; a.c = [inf -inf nan 1 0];')
Out[1]:
{'content': {'datadir': '/tmp/MatlabData/', 'figures': [], 'stdout': ''},
'result': [],
'stack': [],
'success': True}
In [2]: lab.get_variable('a')
Out[2]:
{'b': 'Java exception occurred: \norg.json.JSONException: JSON does not allow non-finite numbers.\n\tat org.json.JSONObject.testValidity(JSONObject.java:1288)\n\tat org.json.JSONObject.put(JSONObject.java:1100)\n\tat org.json.JSONObject.put(JSONObject.java:1037)',
'c': array([[ inf, -inf, nan, 1., 0.]])}
Seems like a simple hack around the problem would be to simply return scalars as 1-by-1 numpy arrays instead...
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...