OttoStruve / muler

A Python package for working with pipeline-produced spectra from IGRINS, HPF, and Keck NIRSPEC
https://muler.readthedocs.io
MIT License
15 stars 9 forks source link

numpy updates - np.int deprecated #146

Closed tofflemire closed 1 year ago

tofflemire commented 1 year ago

np.int (and other built in numpy types) has been on the way out for a while. A search replace for np.int to int would (similar for other types) would allow for the most updated numpy versions (and should be compatible for earlier numpy versions).

https://numpy.org/devdocs/release/1.20.0-notes.html

tofflemire commented 1 year ago

Here is a specific error:

File "/opt/anaconda3/lib/python3.9/site-packages/muler/hpf.py", line 103, in init "x_values": np.arange(0, 2048, 1, dtype=np.int), File "/opt/anaconda3/lib/python3.9/site-packages/numpy/init.py", line 313, in getattr raise AttributeError(__former_attrs__[attr]) AttributeError: module 'numpy' has no attribute 'int'. np.int was a deprecated alias for the builtin int. To avoid this error in existing code, 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. 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#deprecation

tofflemire commented 1 year ago

Sorry, I was using the pip version from a month ago. This works in the current github version.