pydata / pydata/xarray

Multidimensional interpolate_na not working

Open
#9,392 6 comments 0 reactions 0 assignees View on GitHub

@Ockenfuss is already working on this.

Since Aug 23, 2024.

  • #9402 by @Ockenfuss — open
topic-interpolation
Dominant language
Python
Stars
4.2k
Forks
1.4k
Avg merge
2d 15h
Merged PRs (30d)
14

Description

What is your issue?

Hi everyone,
According to xarray documentation, I try to fill NaNs by interpolation using multidimensional interpolate_n
u_interp = u.interpolate_na(dim = None, method = 'linear')
but ends up ImplementedError: dim is a required argument.
I also try
u_interp = u.interpolate_na(dim = ['level', 'lat', 'lon'], method = 'linear')
but ends up KeyError: ['level', 'lat', 'lon'].

The xarray version I have tried are: v0.19.0 (Jul 2021), v2023.6.0, v2024.5.0

Could anyone provide some thoughts on this? Thank you!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the interpolate_na API documentation and reproduce both examples in a supported xarray environment. Compare the documented multidimensional behavior with the failures for dim=None and a list of dimensions, then review linked pull request #9402. Done should establish the intended behavior and align the implementation or documentation with it, with coverage for the reported cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.