Skip to content

docs(v1): cover unlabeled-operand and grouper cases; fold MI-level projection#855

Merged
FBumann merged 1 commit into
feat/arithmetic-conventionfrom
docs/v1-migration-coverage
Jul 20, 2026
Merged

docs(v1): cover unlabeled-operand and grouper cases; fold MI-level projection#855
FBumann merged 1 commit into
feat/arithmetic-conventionfrom
docs/v1-migration-coverage

Conversation

@FBumann

@FBumann FBumann commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Closes a coverage gap in the v1 migration guide, part of the #717 "polish the migration guide / release notes" checklist items.

Note

The following was generated by AI.

I cross-checked every issue-backed v1 behavior change (spec §1–§13 + object scope) against the guide's fix table. The core cases were covered; a few were under-covered.

Change Issue How it's covered
Unlabeled operand (numpy / list / polars) pairs to dims by size; ambiguous or no-size-match raises #736 New table row (object-scope premise) + release-notes bullet
A reordered / mismatched groupby grouper raises rather than reindexing positionally #827 New table row + release-notes bullet
Per-level input onto a stacked snapshot (PyPSA multi-investment) #732 / #737 Folded into the existing MultiIndex row — see below

MultiIndex-level projection — verified, then merged. I initially added a standalone row whose fix used expr.indexes["snapshot"].get_level_values("period") (from convention.md §11). Testing on the branch showed that snippet cannot run under v1: v1 rejects a pd.MultiIndex dimension at construction (add_variables raises ValueError: ... does not support ... reset_index('snapshot')), so .indexes["snapshot"] is never a MultiIndex. The correct v1 flow is decompose-then-project-by-aux-coord, which is a consequence of the MultiIndex-dim rejection — so it's folded into that row rather than duplicated.

Note

Follow-up for the spec pass: convention.md §11's own example carries the same legacy-shaped .get_level_values snippet and should be corrected to the flat-dim / aux-coord idiom.

Files

…to MI row

The migration guide's fix table covered the core absence + alignment +
aux-coord + MultiIndex-dim + groupby-result cases, but three issue-backed
v1 changes were under-covered. Add rows and mirror two into the
release-notes v1 summary:

- Unlabeled operand (numpy / list / polars) pairs to dims by size;
  ambiguous or no-size-match raises (#736) — the object-scope premise.
- A reordered/mismatched groupby grouper raises rather than reindexing
  positionally (#827).
- MultiIndex-level projection: v1 rejects the MultiIndex *dimension* at
  construction, so the per-level-input case is folded into the existing
  MultiIndex row — decompose with reset_index, then project by the level
  aux coord. (The convention.md §11 example still shows the legacy-shaped
  `.get_level_values` snippet, which cannot run under v1 — flagged for the
  spec pass.)

Release notes already carry the level-projection deprecation separately,
so only #736 and the grouper point are mirrored there.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@FBumann
FBumann force-pushed the docs/v1-migration-coverage branch from 87c04f2 to 13dede3 Compare July 20, 2026 08:59
@FBumann FBumann changed the title docs(v1): cover unlabeled-operand, MI-level, and grouper cases in migration guide docs(v1): cover unlabeled-operand and grouper cases; fold MI-level projection Jul 20, 2026
@FBumann
FBumann merged commit cc9d3f2 into feat/arithmetic-convention Jul 20, 2026
1 of 2 checks passed
@FBumann
FBumann deleted the docs/v1-migration-coverage branch July 20, 2026 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant