Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

np.float and np..compex depreciated #185

Open
Patrick-Cole opened this issue Jun 28, 2023 · 0 comments
Open

np.float and np..compex depreciated #185

Patrick-Cole opened this issue Jun 28, 2023 · 0 comments

Comments

@Patrick-Cole
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant