danielapai / bioverse

A simulation framework to assess the statistical power of future biosignature surveys
MIT License
7 stars 5 forks source link

bioverse/constants.py uses deprecated alias `np.float` #23

Closed matiscke closed 12 months ago

matiscke commented 1 year ago

on numpy >= 1.20, an AttributeError occurs when the constants submodule is imported.

Traceback (most recent call last):
  File "/Users/schlecker/repos/magmaocean/src/scripts/radiusevolution.py", line 6, in <module>
    from bioverse.constants import CONST
  File "/Users/schlecker/repos/magmaocean/.snakemake/conda/fdb820a9d52d4edc3a3d4beeccf13c28/lib/python3.9/site-packages/bioverse/constants.py", line 42, in <module>
    FLOAT_TYPES = (float,np.float,np.float_,np.float64)
  File "/Users/schlecker/repos/magmaocean/.snakemake/conda/fdb820a9d52d4edc3a3d4beeccf13c28/lib/python3.9/site-packages/numpy/__init__.py", line 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