odlgroup/odl

Error with compatibility with latest numpy version

knutsa opened this issue · 1 comments

When installing odl through conda and pip I get the following error:

FutureWarning: In the future `np.object` will be defined as the corresponding NumPy scalar.  (This may have returned Python scalars in past versions.
  if dtype not in (np.object, np.void):
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\salom\Documents\code\KTH\torch_venv\lib\site-packages\odl\__init__.py", line 68, in <module>
    from . import ufunc_ops
  File "C:\Users\salom\Documents\code\KTH\torch_venv\lib\site-packages\odl\ufunc_ops\__init__.py", line 15, in <module>
    from .ufunc_ops import *
  File "C:\Users\salom\Documents\code\KTH\torch_venv\lib\site-packages\odl\ufunc_ops\ufunc_ops.py", line 413, in <module>
    globals()[name + '_op'] = ufunc_class_factory(name, nargin,
  File "C:\Users\salom\Documents\code\KTH\torch_venv\lib\site-packages\odl\ufunc_ops\ufunc_ops.py", line 276, in ufunc_class_factory
    space = tensor_space(3, dtype=dtype)
  File "C:\Users\salom\Documents\code\KTH\torch_venv\lib\site-packages\odl\space\space_utils.py", line 149, in tensor_space
    return tspace_cls(shape=shape, dtype=dtype, **kwargs)
  File "C:\Users\salom\Documents\code\KTH\torch_venv\lib\site-packages\odl\space\npy_tensors.py", line 221, in __init__
    if self.dtype.char not in self.available_dtypes():
  File "C:\Users\salom\Documents\code\KTH\torch_venv\lib\site-packages\odl\space\npy_tensors.py", line 482, in available_dtypes
    if dtype not in (np.object, np.void):
  File "C:\Users\salom\Documents\code\KTH\torch_venv\lib\site-packages\numpy\__init__.py", line 284, in __getattr__
    raise AttributeError("module {!r} has no attribute "
AttributeError: module 'numpy' has no attribute 'object'

which seems to indicate that the odl package is not compatible with the latest numpy version??!
The error is resolved when numpy is downgraded to version 1.23.5, however this is a bit problematic in a project that is dependent on other python packages using numpy.