When using a newer numpy with the latest mtpy, I get the following error:
File C:\Python\WPy64-31131\python-3.11.3.amd64\Lib\site-packages\mtpy\core\edi.py:276 in _read_mt
freq_arr = np.array(data_dict['freq'], dtype=np.float)
File C:\Python\WPy64-31131\python-3.11.3.amd64\Lib\site-packages\numpy_init_.py:305 in getattr
raise AttributeError(former_attrs[attr])
AttributeError: module 'numpy' has no attribute 'float'.
np.float was a deprecated alias for the builtin float. To avoid this error in existing code, 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.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
I also get a similar one for np.complext. In my case I was importing EDI data.
the solution just seems to be as simple as replacing np.float with float and np.complex with complex
mtpy == 1.1.5
numpy == 1.24.3
When using a newer numpy with the latest mtpy, I get the following error:
File C:\Python\WPy64-31131\python-3.11.3.amd64\Lib\site-packages\mtpy\core\edi.py:276 in _read_mt
freq_arr = np.array(data_dict['freq'], dtype=np.float)
File C:\Python\WPy64-31131\python-3.11.3.amd64\Lib\site-packages\numpy_init_.py:305 in getattr
raise AttributeError(former_attrs[attr])
AttributeError: module 'numpy' has no attribute 'float'.
np.floatwas a deprecated alias for the builtinfloat. To avoid this error in existing code, usefloatby itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, usenp.float64here.The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
I also get a similar one for np.complext. In my case I was importing EDI data.
the solution just seems to be as simple as replacing np.float with float and np.complex with complex
mtpy == 1.1.5
numpy == 1.24.3