Skip to content

Commit

Permalink
Change 'np.NaN' to 'np.nan' re: Numpy 2.0
Browse files Browse the repository at this point in the history
 'numpy.nan' is the correct spelling in Numpy 2.0. All others are deprecated.
  • Loading branch information
douglatornell committed Jun 13, 2024
1 parent 4d01c91 commit 6296683
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions nowcast/figures/research_ferries.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,8 @@ def _model_IDW(obs, bathy, grid_T_hr, sal_a, sal_b):
# more of the surrounding grid point are land with NaN.
interp_area = sal_a[x1 - 1 : x1 + 2, y1 - 1 : y1 + 2]
if interp_area.size - np.count_nonzero(interp_area) >= 4:
sal_a_idw = np.NaN
sal_b_idw = np.NaN
sal_a_idw = np.nan
sal_b_idw = np.nan

Check warning on line 310 in nowcast/figures/research_ferries.py

View check run for this annotation

Codecov / codecov/patch

nowcast/figures/research_ferries.py#L309-L310

Added lines #L309 - L310 were not covered by tests
else:
for i in np.arange(x1 - 1, x1 + 2):
for j in np.arange(y1 - 1, y1 + 2):
Expand Down
2 changes: 1 addition & 1 deletion nowcast/figures/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def interp_to_model_time(t_model, values, t_values):
t_values_wrt_epoch = np.array([(t - epoch).total_seconds() for t in t_values])
t_model_wrt_epoch = np.array([(t - epoch).total_seconds() for t in t_model])
return np.interp(
t_model_wrt_epoch, t_values_wrt_epoch, values, left=np.NaN, right=np.NaN
t_model_wrt_epoch, t_values_wrt_epoch, values, left=np.nan, right=np.NaN
)


Expand Down

0 comments on commit 6296683

Please sign in to comment.