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.

Missed in PR #272.
  • Loading branch information
douglatornell committed Jan 28, 2025
1 parent 5d547a8 commit 4be53d6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nowcast/figures/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def correct_model_ssh(ssh_model, t_model, ttide):

## TODO: This should probably be in a salishsea_tools module.
def interp_to_model_time(t_model, values, t_values):
"""Interpolate a an array of values to model output times.
"""Interpolate an array of values to model output times.
Strategy: Convert times to seconds past a reference value and use those
as the independent variable in interpolation.
Expand All @@ -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 4be53d6

Please sign in to comment.