@@ -3884,7 +3884,6 @@ def interp(
3884
3884
coords : Mapping [Any , Any ] | None = None ,
3885
3885
method : InterpOptions = "linear" ,
3886
3886
assume_sorted : bool = False ,
3887
- reduce : bool = True ,
3888
3887
kwargs : Mapping [str , Any ] | None = None ,
3889
3888
method_non_numeric : str = "nearest" ,
3890
3889
** coords_kwargs : Any ,
@@ -3893,12 +3892,8 @@ def interp(
3893
3892
Interpolate a Dataset onto new coordinates.
3894
3893
3895
3894
Performs univariate or multivariate interpolation of a Dataset onto new coordinates,
3896
- utilizing either NumPy or SciPy interpolation routines.
3897
-
3898
- When interpolating along multiple dimensions, the process attempts to decompose the
3899
- interpolation into independent interpolations along one dimension at a time, unless
3900
- `reduce=False` is passed. The specific interpolation method and dimensionality
3901
- determine which interpolant is used:
3895
+ utilizing either NumPy or SciPy interpolation routines. The specific interpolation
3896
+ method and dimensionality determine which interpolant is used:
3902
3897
3903
3898
1. **Interpolation along one dimension of 1D data (`method='linear'`)**
3904
3899
- Uses :py:class:`numpy.interp`, unless `fill_value='extrapolate'` is provided via `kwargs`.
@@ -3938,10 +3933,6 @@ def interp(
3938
3933
in any order and they are sorted first. If True, interpolated
3939
3934
coordinates are assumed to be an array of monotonically increasing
3940
3935
values.
3941
- reduce : bool, default: True
3942
- If True, the interpolation is decomposed into independent interpolations of minimal dimensionality such that
3943
- the interpolation coordinates are independent. Setting this to be True alters the behavior of certain
3944
- multi-dimensional interpolants compared to the default SciPy output.
3945
3936
kwargs : dict, optional
3946
3937
Additional keyword arguments passed to the interpolator. Valid
3947
3938
options and their behavior depend which interpolant is used.
@@ -3961,10 +3952,9 @@ def interp(
3961
3952
Notes
3962
3953
-----
3963
3954
- SciPy is required for certain interpolation methods.
3964
- - Allowing `reduce=True` (the default) may alter the behavior of interpolation along multiple dimensions
3965
- compared to the default behavior in SciPy.
3966
-
3967
- See Also
3955
+ - When interpolating along multiple dimensions with methods `linear` and `nearest`,
3956
+ the process attempts to decompose the interpolation into independent interpolations
3957
+ along one dimension at a time.
3968
3958
--------
3969
3959
scipy.interpolate.interp1d
3970
3960
scipy.interpolate.interpn
@@ -4125,9 +4115,7 @@ def _validate_interp_indexer(x, new_x):
4125
4115
if dtype_kind in "uifc" :
4126
4116
# For normal number types do the interpolation:
4127
4117
var_indexers = {k : v for k , v in use_indexers .items () if k in var .dims }
4128
- variables [name ] = missing .interp (
4129
- var , var_indexers , method , reduce = reduce , ** kwargs
4130
- )
4118
+ variables [name ] = missing .interp (var , var_indexers , method , ** kwargs )
4131
4119
elif dtype_kind in "ObU" and (use_indexers .keys () & var .dims ):
4132
4120
# For types that we do not understand do stepwise
4133
4121
# interpolation to avoid modifying the elements.
@@ -4188,19 +4176,14 @@ def interp_like(
4188
4176
other : T_Xarray ,
4189
4177
method : InterpOptions = "linear" ,
4190
4178
assume_sorted : bool = False ,
4191
- reduce : bool = True ,
4192
4179
kwargs : Mapping [str , Any ] | None = None ,
4193
4180
method_non_numeric : str = "nearest" ,
4194
4181
) -> Self :
4195
4182
"""Interpolate this object onto the coordinates of another object.
4196
4183
4197
4184
Performs univariate or multivariate interpolation of a Dataset onto new coordinates,
4198
- utilizing either NumPy or SciPy interpolation routines.
4199
-
4200
- When interpolating along multiple dimensions, the process attempts to decompose the
4201
- interpolation into independent interpolations along one dimension at a time, unless
4202
- `reduce=False` is passed. The specific interpolation method and dimensionality
4203
- determine which interpolant is used:
4185
+ utilizing either NumPy or SciPy interpolation routines. The specific interpolation
4186
+ method and dimensionality determine which interpolant is used:
4204
4187
4205
4188
1. **Interpolation along one dimension of 1D data (`method='linear'`)**
4206
4189
- Uses :py:class:`numpy.interp`, unless `fill_value='extrapolate'` is provided via `kwargs`.
@@ -4239,10 +4222,6 @@ def interp_like(
4239
4222
in any order and they are sorted first. If True, interpolated
4240
4223
coordinates are assumed to be an array of monotonically increasing
4241
4224
values.
4242
- reduce : bool, default: True
4243
- If True, the interpolation is decomposed into independent 1-dimensional interpolations such that
4244
- the interpolation coordinates are independent. Setting this to be True alters the behavior of certain
4245
- multi-dimensional interpolants compared to the default SciPy output.
4246
4225
kwargs : dict, optional
4247
4226
Additional keyword arguments passed to the interpolator. Valid
4248
4227
options and their behavior depend which interpolant is use
@@ -4258,9 +4237,12 @@ def interp_like(
4258
4237
4259
4238
Notes
4260
4239
-----
4261
- scipy is required.
4262
- If the dataset has object-type coordinates, reindex is used for these
4263
- coordinates instead of the interpolation.
4240
+ - scipy is required.
4241
+ - If the dataset has object-type coordinates, reindex is used for these
4242
+ coordinates instead of the interpolation.
4243
+ - When interpolating along multiple dimensions with methods `linear` and `nearest`,
4244
+ the process attempts to decompose the interpolation into independent interpolations
4245
+ along one dimension at a time.
4264
4246
4265
4247
See Also
4266
4248
--------
0 commit comments