Skip to content

Remove deprecated np.int and np.float#69

Merged
taldcroft merged 1 commit intomasterfrom
np-warnings
Mar 14, 2022
Merged

Remove deprecated np.int and np.float#69
taldcroft merged 1 commit intomasterfrom
np-warnings

Conversation

@jeanconn
Copy link
Copy Markdown
Contributor

Description

Update np.int and np.float to just int and float.

Testing

In a test environment based on ska3 flight latest 2022.2 this removes these warnings

kadi-fido> ./make_timeline.py --data-dir $SKA/data/arc3
./make_timeline.py:393: 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
  z = np.zeros(len(fluence_times), dtype=np.int)
./make_timeline.py:291: DeprecationWarning: `np.float` is a deprecated alias for the builtin `float`. To silence this warning, 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.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
  bins = np.array(bins, dtype=np.float)
./make_timeline.py:527: DeprecationWarning: `np.float` is a deprecated alias for the builtin `float`. To silence this warning, 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.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
  z = np.zeros_like(times, dtype=np.float)  # 0 => ACIS
./make_timeline.py:291: DeprecationWarning: `np.float` is a deprecated alias for the builtin `float`. To silence this warning, 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.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
  bins = np.array(bins, dtype=np.float)

And the timeline.png and timeline_states.js appear unchanged (but successfully made).

@jeanconn jeanconn requested a review from malgosias March 10, 2022 18:08
@taldcroft taldcroft merged commit 8bc4ebd into master Mar 14, 2022
@taldcroft taldcroft deleted the np-warnings branch March 14, 2022 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants