morganjwilliams / pyrolite

A set of tools for getting the most from your geochemical data.
https://pyrolite.readthedocs.io
Other
133 stars 37 forks source link

[BUG] Attribute error in geochem/norm #81

Closed ondrolexa closed 1 year ago

ondrolexa commented 1 year ago

Describe the bug Aliases of builtin types in Numpy are deprecated for NumPy >=1.20 Casting to float using .astype(np.float) produces an AttributeError using the latest versions of NumPy.

e.g. in pyrolite/geochem/norm/init.py:76

---> 76 ].astype(np.float)

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

To Reproduce Steps to reproduce the behavior:

  1. e.g. df.pyrochem.REE.pyrochem.normalize_to('PM_PON')'

Environment:

ondrolexa commented 1 year ago

I just realized that it is already fixed in develop version...

morganjwilliams commented 1 year ago

@ondrolexa many thanks for the report all the same! It's about time for a release, a lot has changed in the Python world. I've recently addressed a few issues with docs building also, and once I finalize a few things for CIPW norm outputs I'll look to have a new version out.