Skip to content

Commit 40e198f

Browse files
committed
fix(denoise): use method= instead of skipna=True for quantile (numpy 2.x compat)
The xarray .quantile(skipna=True) path calls np.nanquantile() with the deprecated 'interpolation' kwarg, which was removed in numpy 2.x. Switch to method='linear' without skipna to avoid the error.
1 parent 66d85ce commit 40e198f

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

oceanstream/echodata/denoise/background_noise.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,11 @@ def background_noise_mask(
190190
if depth_stat == "min":
191191
noise_1d_db = binned_db.min(dim=range_dim, skipna=True)
192192
elif depth_stat == "quantile":
193+
# Use numpy directly — xarray's skipna=True path calls
194+
# np.nanquantile with the deprecated ``interpolation`` kwarg
195+
# which was removed in numpy 2.x.
193196
noise_1d_db = binned_db.quantile(
194-
depth_quantile, dim=range_dim, skipna=True
197+
depth_quantile, dim=range_dim, method="linear"
195198
)
196199
if "quantile" in noise_1d_db.dims:
197200
noise_1d_db = noise_1d_db.squeeze("quantile", drop=True)

0 commit comments

Comments
 (0)