From 4be53d60abb46faad08ea60f2a433284d187b632 Mon Sep 17 00:00:00 2001 From: Doug Latornell Date: Tue, 28 Jan 2025 14:59:35 -0800 Subject: [PATCH] Change 'np.NaN' to 'np.nan' re: Numpy 2.0 'numpy.nan' is the correct spelling in Numpy 2.0. All others are deprecated. Missed in PR #272. --- nowcast/figures/shared.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nowcast/figures/shared.py b/nowcast/figures/shared.py index 291c4100..08816f67 100644 --- a/nowcast/figures/shared.py +++ b/nowcast/figures/shared.py @@ -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. @@ -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 )