Skip to content

Commit

Permalink
Merge pull request #125 from gunnarvoet/fix_runtime_warning
Browse files Browse the repository at this point in the history
Fix RuntimeWarning when casting float to int
  • Loading branch information
efiring committed Mar 12, 2024
2 parents c99e2c4 + 44b1be7 commit d029a2d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions utide/harmonics.py
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 d029a2d

Please sign in to comment.