Skip to content

Commit

Permalink
fix RuntimeWarning when casting float to int
Browse files Browse the repository at this point in the history
  • Loading branch information
gunnarvoet committed Mar 12, 2024
1 parent c99e2c4 commit 44b1be7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions utide/harmonics.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
const = ut_constants.const
shallow = ut_constants.shallow

nshallow = np.ma.masked_invalid(const.nshallow).astype(int)
ishallow = np.ma.masked_invalid(const.ishallow).astype(int) - 1
nshallow = np.ma.masked_invalid(const.nshallow)
ishallow = np.ma.masked_invalid(const.ishallow)
not_shallow = ishallow.mask # True where it was masked.
nshallow = nshallow.compressed()
ishallow = ishallow.compressed()
nshallow = nshallow.compressed().astype(int)
ishallow = ishallow.compressed().astype(int) - 1
kshallow = np.nonzero(~not_shallow)[0]


Expand Down

0 comments on commit 44b1be7

Please sign in to comment.