Feature request: merge compat overlap
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 4.2k
- Forks
- 1.4k
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 14
Description
xarray.merge should have an option compat overlap.
is that option is combine_first, but it has more sense inside of merge.
import xarray as xr
x1=xr.DataArray([1,2,3,4,11],dims=['time'],coords=[[4,5,6,7,3]]).to_dataset(name='fusionfria')
x2=xr.DataArray([5,6,7,8],dims=['time'],coords=[[0,1,2,3]]).to_dataset(name='fusionfria')
x1.combine_first(x2)
It could be useful to avoid the error in xarray.open_mfdataset, if the time index is overlapped between netcdf files.
ValueError: Resulting object does not have monotonic global indexes along dimension time
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the xarray.merge and DataArray.combine_first behavior shown in the example, then inspect how xarray.open_mfdataset handles overlapping time indexes. Define the intended compat-overlap semantics and verify them with focused merge and overlapping-index cases; done means the option works without the reported monotonic-index error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100