From 9079fc422a43832653e4e3019074c48090036265 Mon Sep 17 00:00:00 2001 From: Ryan May Date: Fri, 7 Jul 2023 15:21:59 -0600 Subject: [PATCH] MNT: Use `np.broadcast_shapes` in `interpolate_1d` We can rely on this with numpy >=1.20. --- src/metpy/interpolate/one_dimension.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/metpy/interpolate/one_dimension.py b/src/metpy/interpolate/one_dimension.py index f12bcea96fd..59c2d4a3215 100644 --- a/src/metpy/interpolate/one_dimension.py +++ b/src/metpy/interpolate/one_dimension.py @@ -107,8 +107,7 @@ def interpolate_1d(x, xp, *args, axis=0, fill_value=np.nan, return_list_always=F sort_x = np.argsort(x) # The shape after all arrays are broadcast to each other - # Can't use broadcast_shapes until numpy >=1.20 is our minimum - final_shape = np.broadcast(xp, *args).shape + final_shape = np.broadcast_shapes(xp.shape, *(a.shape for a in args)) # indices for sorting sorter = broadcast_indices(sort_args, final_shape, axis)