astropy / astroplan

Observation planning package for astronomers – maintainer @bmorris3
https://astroplan.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
199 stars 109 forks source link

Deprecation warning in numpy >= 1.20 #515

Closed thusser closed 2 years ago

thusser commented 2 years ago

Couldn't find a previous issue about this, so here it is. With astroplan 0.8 and numpy 1.21.3 I get the following deprecation warning:

2021-12-13 14:42:29,958 [WARNING] warnings.py:109 /usr/local/lib/python3.9/dist-packages/astroplan/scheduling.py:766: DeprecationWarning: `np.int` is a deprecated alias for the builtin `int`. To silence this warning, use `int` by itself. Doing this will not modify any behavior and is safe. When replacing `np.int`, you may wish to use e.g. `np.int64` or `np.int32` to specify the precision. If you wish to review your current use, check the release note link for additional information.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
  _stride_by = np.int(np.ceil(float(b.duration / time_resolution)))

I guess this means simply replacing np.int with int.

bmorris3 commented 2 years ago

This was fixed in #523. Thanks @thusser and @wtgee!