docs(v1): cover the scalar-leftover-coord aux conflict (isel drop=True)#858
Merged
FBumann merged 1 commit intoJul 20, 2026
Merged
Conversation
Positional indexing leaves a scalar coordinate behind: `x.isel(time=0)` drops `time` as a dimension but keeps it as a scalar coord (the first label). So a cyclic/boundary constraint like `x.isel(time=0) == x.isel(time=-1)` — extremely common in storage/energy models — hits §11's aux-coord conflict under v1 (`time` = first vs last) and raises, where legacy silently dropped it. The aux-coord row already covered this in principle, but listed only `.drop_vars` / `.assign_coords` as fixes and didn't name the scalar-leftover cause. Broaden the migration-guide row and add the natural fix — drop the coord at the indexing site with `.isel(..., drop=True)` / `.sel(..., drop=True)` — and add the same note to convention.md §11. Verified on the branch: `x.isel(time=0) == x.isel(time=-1)` raises "Auxiliary coordinate 'time' has conflicting values ... left=0, right=3" under v1; `drop=True` on both sides builds cleanly. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Documents a v1 aux-coord conflict that's easy to hit and easy to miss. Part of the #717 migration-doc pass.
Same v1 rule as #791 (
x[0] + x[1]/ summing scalar selections), closed COMPLETED as intended (legacy warns about it). This PR documents the comparison form and thedrop=Truefix.Note
The following was generated by AI.
The case. Positional indexing leaves a scalar coordinate behind:
x.isel(time=0)dropstimeas a dimension but keeps it as a scalar coord (the first label). So a cyclic/boundary constraint — very common in storage/energy models —hits §11's auxiliary-coordinate conflict under v1 (
time= first vs last) and raises, where legacy silently dropped it. Verified on the branch:Why a doc change. The existing "Conflicting auxiliary coordinates" row technically covered it (the raise even says "Auxiliary coordinate"), but it listed only
.drop_vars/.assign_coordsand didn't name the scalar-leftover cause — so a user comparing two.iselendpoints wouldn't connect their error to that row, nor reach for the natural fix (drop=Trueat the indexing site).doc/migrating-to-v1.rst— broadened the aux-coord row (situation names the scalar-leftover case; fix adds.isel/.sel(..., drop=True))arithmetics-design/convention.md§11 — same noteIndependent of #855/#856 (different regions of both files); should merge cleanly alongside them.