-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Interpolate_na: max_map argument not working at array boundaries #7597
Comments
Thanks. A PR is welcome! It looks like you have a nice simple test. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
@dcherian The answers above read like they are generated by a bot (they even include the typo I made in the Issue title: max_map instead of max_gap). ChatGPT seems to create very similar answers, if I input the issue heading. |
@Ockenfuss i said you should try this three point I listed below and see if that could resolve the problem you raised.
|
Thanks @Karimat22 . In general, it's most helpful to comment if you have specific knowledge about the topic. In this case, the original post was pretty nice and clear bug report, not a usage question. |
What happened?
In the case of multidimensional arrays, the
max_gap
argument ofinterpolate_na
is currently not working correctly at the array boundaries. This is likely due to a missing "dim" argument in the max() aggregation inxarray.core.missing._get_nan_block_lengths
, I think.What did you expect to happen?
In the following code example, due to
max_gap=2
, no extrapolation should be performed for the second row. Currently, this is the case, the output created is:Minimal Complete Verifiable Example
MVCE confirmation
Relevant log output
No response
Anything else we need to know?
I added the missing dim argument and adapted the test cases (Currently, there was no test case for fully multidimensional arrays with a gap at the end).
Environment
INSTALLED VERSIONS
commit: None
python: 3.10.5 | packaged by conda-forge | (main, Jun 14 2022, 07:04:59) [GCC 10.3.0]
python-bits: 64
OS: Linux
OS-release: 5.4.0-135-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: ('en_US', 'UTF-8')
libhdf5: 1.12.2
libnetcdf: 4.9.0
xarray: 2023.2.0
pandas: 1.5.3
numpy: 1.23.5
scipy: 1.8.1
netCDF4: 1.6.1
pydap: None
h5netcdf: None
h5py: None
Nio: None
zarr: None
cftime: 1.6.2
nc_time_axis: None
PseudoNetCDF: None
rasterio: None
cfgrib: None
iris: None
bottleneck: 1.3.5
dask: 2022.10.2
distributed: None
matplotlib: 3.6.3
cartopy: None
seaborn: None
numbagg: 0.2.1
fsspec: 2022.10.0
cupy: None
pint: 0.20.1
sparse: None
flox: 0.6.8
numpy_groupies: 0.9.20
setuptools: 58.1.0
pip: 23.0.1
conda: None
pytest: None
mypy: None
IPython: 8.6.0
sphinx: None
The text was updated successfully, but these errors were encountered: