Skip to content

Commit

Permalink
MNT: Use np.broadcast_shapes in interpolate_1d
Browse files Browse the repository at this point in the history
We can rely on this with numpy >=1.20.
  • Loading branch information
dopplershift committed Jul 7, 2023
1 parent 00c85eb commit 9079fc4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/metpy/interpolate/one_dimension.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9079fc4

Please sign in to comment.