Skip to content
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

Test concat of dimension coordinate not backed by an index #44

Merged
merged 5 commits into from
Mar 25, 2024

Conversation

TomNicholas
Copy link
Member

@TomNicholas TomNicholas commented Mar 20, 2024

Adds a test showing a problem in xarray - if I build two datasets that have dimension coordinates which are explicitly not backed by an index (which is possible by passing the new xr.Coordinates object explicitly to the constructor), then upon concatenating these, xarray sees the dimension coordinate and attempts to automatically rebuild a new index (which will fail in my case). I need to be able to turn off that behaviour somehow.

@TomNicholas TomNicholas added the xarray Requires changes to xarray upstream label Mar 20, 2024
@TomNicholas
Copy link
Member Author

TomNicholas commented Mar 25, 2024

The simplest test that shows this issue is described in pydata/xarray#8871

EDIT: And a proposed fix is pydata/xarray#8872

Copy link

codecov bot commented Mar 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.12%. Comparing base (5eb15bb) to head (85472bc).
Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #44      +/-   ##
==========================================
+ Coverage   87.66%   88.12%   +0.46%     
==========================================
  Files          13       13              
  Lines         851      893      +42     
==========================================
+ Hits          746      787      +41     
- Misses        105      106       +1     
Flag Coverage Δ
unittests 88.12% <100.00%> (+0.46%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@TomNicholas
Copy link
Member Author

TomNicholas commented Mar 25, 2024

This PR now uses a branch on my fork of xarray, which contains the (unmerged upstream) PRs pydata/xarray#8711, pydata/xarray#8714 and pydata/xarray#8872. All three of these are needed to get the new test in this PR to pass.

@TomNicholas
Copy link
Member Author

TomNicholas commented Mar 25, 2024

I'm going to merge this, making this package depend on my branch of xarray. Once those changes are merged upstream I can unpin it from that specific branch, see #14 (comment).

@TomNicholas TomNicholas merged commit 4375ccb into main Mar 25, 2024
7 checks passed
@TomNicholas TomNicholas deleted the concat_dim_coord_no_index branch March 25, 2024 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
xarray Requires changes to xarray upstream
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant