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
Under Windows, I have a problem with 5.7.2 that did not exist with 5.6.0. Consider the following simple example:
(base) PS C:\Users\rsg> python
Python 3.9.12 (main, Apr 4 2022, 05:23:19) [MSC v.1916 32 bit (Intel)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
from oct2py import Oct2Py
o = Oct2Py()
o.pwd()
Traceback (most recent call last):
File "", line 1, in
File "C:\ProgramData\Anaconda3\lib\site-packages\oct2py\dynamic.py", line 111, in call
return self._ref().feval(self.name, *inputs, **kwargs)
File "C:\ProgramData\Anaconda3\lib\site-packages\oct2py\core.py", line 403, in feval
return self._feval(
File "C:\ProgramData\Anaconda3\lib\site-packages\oct2py\core.py", line 620, in _feval
write_file(req, out_file, oned_as=self._oned_as,
convert_to_float=self.convert_to_float)
File "C:\ProgramData\Anaconda3\lib\site-packages\oct2py\io.py", line 58, in write_file
data = _encode(obj, convert_to_float)
File "C:\ProgramData\Anaconda3\lib\site-packages\oct2py\io.py", line 351, in _encode
out[key] = _encode(value, ctf)
File "C:\ProgramData\Anaconda3\lib\site-packages\oct2py\io.py", line 376, in _encode
if isinstance(data, spmatrix):
NameError: name 'spmatrix' is not defined
If you look at line 15 of the script, spmatrix is being imported from scipy.sparse, but that doesn't seem to take effect. Interestingly, adding the same import immediately before line 376 will "fix" the issue, and the o.pwd() function succeeds. Obviously, however, I'd rather not have to remember to hack Oct2Py everytime I install/upgrade it, and I'm not certain I've really fixed the underlying problem; hence, this issue.
I did post a StackOverflow question about this issue that has more details; the link to the question is below for your reference.
Under Windows, I have a problem with 5.7.2 that did not exist with 5.6.0. Consider the following simple example:
(base) PS C:\Users\rsg> python
Python 3.9.12 (main, Apr 4 2022, 05:23:19) [MSC v.1916 32 bit (Intel)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
If you look at line 15 of the script,
spmatrix
is being imported fromscipy.sparse
, but that doesn't seem to take effect. Interestingly, adding the same import immediately before line 376 will "fix" the issue, and theo.pwd()
function succeeds. Obviously, however, I'd rather not have to remember to hack Oct2Py everytime I install/upgrade it, and I'm not certain I've really fixed the underlying problem; hence, this issue.I did post a StackOverflow question about this issue that has more details; the link to the question is below for your reference.
https://stackoverflow.com/questions/78980100/python-oct2py-octave-setup-woes
The text was updated successfully, but these errors were encountered: