Closed wd15 closed 3 weeks ago
numpy.obj2sctype
was deprecated in numpy 2.0.0. It looks like its original usage of converting to numpy's internal data types was deprecated in numpy 1.20.0.
Unfortunately, the proposed replacement, np.dtype(obj).type
, cannot be used as FiPy used numpy.obj2sctype
, e.g., with numpy 1.24.3:
>>> np.obj2sctype(np.array([1.0, 2.0]))
numpy.float64
but, with numpy 1.24.3 or 2.0.0,
>>> np.dtype(np.array([1.0, 2.0])).type
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: Cannot construct a dtype from an array
>>> np.array([1.0, 2.0]).dtype
dtype('float64')
works with either, but I'm not sure if that covers all the cases where we used it.
I think I've fixed these issues in #1050
Running with Numpy 2.0.0 breaks things. See fipy.log.
Test failures like this:
Versions are as follows:
python 3.11.8 (main, Feb 6 2024, 21:21:21) [GCC 12.3.0] fipy 3.4.4 numpy 2.0.0 pysparse not installed scipy 1.13.1 matplotlib 3.9.0