radio-astro-tools / spectral-cube

Library for reading and analyzing astrophysical spectral data cubes
http://spectral-cube.rtfd.org
BSD 3-Clause "New" or "Revised" License
98 stars 65 forks source link

masks.py broken with numpy >=1.20 #877

Closed drtobybrown closed 11 months ago

drtobybrown commented 1 year ago

spectral-cube 0.5.0 (conda-forge)

spectral_cube/masks.py:228, in MaskBase._filled(self, data, wcs, fill, view, use_memmap, **kwargs)
    202 """
    203 Replace the excluded elements of *array* with *fill*.
    204 
   (...)
    224 Users should use the property :meth:`MaskBase.filled_data`
    225 """
    226 # Must convert to floating point, but should not change from inherited
    227 # type otherwise
--> 228 dt = np.find_common_type([data.dtype], [np.float])
    230 if use_memmap and data.size > 0:
    231     ntf = tempfile.NamedTemporaryFile()
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.
drtobybrown commented 1 year ago

I see this is fixed in spectral-cube 0.6. Leaving open simply because of the discrepancy between pip and conda-forge versions

keflavich commented 11 months ago

Should be resolved by now. 0.6.3 is on conda-forge.