Open lee1043 opened 7 months ago
Good idea to this documentation issue!
Do you know precisely which version of numpy
is the last one compatible with cdms2
(i.e. where np.float
is deprecated, but still available)? You may then update the issue title to include this information, like cdms2 is incompatible with numpy > vvvvv
I have just checked my current (though slightly obsolete) environment, and np.float
is still available in numpy 1.21.4
(cdatm_py3) >conda list | egrep '(cdms|numpy)'
cdms2 3.1.5 pypi_0 pypi
libcdms 3.1.2 h981a4fd_113 conda-forge
numpy 1.21.4 py38he2449b9_0 conda-forge
numpy_groupies 0.9.22 pyhd8ed1ab_0 conda-forge
numpydoc 1.1.0 py_1 conda-forge
(cdatm_py3) >python
Python 3.8.8 | packaged by conda-forge | (default, Feb 20 2021, 16:22:27)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>> fl_test = np.float(3)
<stdin>:1: DeprecationWarning: `np.float` is a deprecated alias for the builtin `float`. To silence this warning, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
>>> fl_test
3.0
>>> type(fl_test)
<class 'float'>
>>>
I have just found this old issue, that seemed to deal with handling new data types
Update cdms2 to deal with all common datatypes (uint8, uint16, char, str etc)
If, by chance, an existing issue documents an easy way to update all the required types, and a knowledgeable person (that's not me) can implement a quick fix of cdms2, it would not hurt ! <3
Good idea, I think the last numpy
version that works with cdms2
is 1.23.5
.
NumPy 1.20 (release notes) deprecated numpy.float, numpy.int, and similar aliases, causing them to issue a deprecation warning
NumPy 1.24 (release notes) removed these aliases altogether, causing an error when they are used
numpy.float
(e.g., used here is deprecated since numpy 1.20, need to replace it tonumpy.float64
.f = cdms2.open(path)
with latest numpy version returns below error.I understand cdms2 is no longer under active development, so leaving this error for documenting it.