BaPSF / bapsflib

A Python Toolkit for BaPSF
11 stars 7 forks source link

Addrewss `numpy` `FutureWarning` when passing `(type, 1)` for a `numpy.dtype` #135

Closed rocco8773 closed 1 week ago

rocco8773 commented 1 week ago

This PR address the following FutureWarning...

image

In the past np.dtype([("shotnum", np.int32, 1), ]) mapped to np.dtype([("shotnum", "<i4"), ]), which lead to an shot number array shape of data["shotnum"].shape == (100,) for a data run of 100 shots. After the change by numpy this will map to np.dtype([("shotnum", "<i4", (1,)), ]) and result in data["shotnum"].shape == (100, 1). To avoid this, the shape argument when constructing a np.dtype will always be a tuple, with the previous 1 argument being an empty tuple ().


codecov[bot] commented 1 week ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 98.50%. Comparing base (f74f720) to head (bd4f118).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #135 +/- ## ======================================= Coverage 98.50% 98.50% ======================================= Files 47 47 Lines 3076 3076 Branches 580 580 ======================================= Hits 3030 3030 Misses 44 44 Partials 2 2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.