Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions arithmetics-design/convention.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,17 @@ position). An operand whose *dimension* names one of those levels — a
per-`period` weighting meeting a `snapshot`-indexed expression — is a
same-name conflict between a dimension and an auxiliary coordinate, and it
raises like any other conflict of this section. There is no implicit
projection; write it explicitly by selecting with the dimension's level
values:

weights.sel(period=expr.indexes["snapshot"].get_level_values("period"))
projection. `snapshot` is a flat dimension carrying `period` and `timestep`
as auxiliary coordinates (v1 rejects a first-class `pd.MultiIndex` dimension,
so `expr.indexes["snapshot"]` is a flat index, not a `MultiIndex`). Map the
per-`period` input onto `snapshot` through that coordinate — a plain array
of one weight per position — then use it in the operation:

# weights: pd.Series indexed by `period`; expr: indexed by `snapshot`
w = xr.DataArray(
weights.loc[expr.coords["period"].values].to_numpy(), dims="snapshot"
)
weighted = expr * w # one constraint/term per snapshot, weighted by period

An input that reconstructs the *entire* MultiIndex (all levels, every
combination) is not a conflict — it is the same coordinate spelled
Expand Down
7 changes: 6 additions & 1 deletion arithmetics-design/open-items.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,12 @@ here ([`goals.md`] step 1: *warn on legacy, raise on v1*).
`grep "LEGACY: remove at 1.0"` marker. Dependency-ordered checklist in
[`legacy-removal.md`].
- [ ] Reframe [`convention.md`] / [`goals.md`] — drop the "v1"/legacy framing
once there is only one convention.
once there is only one convention. At this point [`convention.md`] also
**graduates into the rendered Sphinx docs** (add `myst-parser`, into the
toctree, internal `:doc:` cross-refs replacing the GitHub blob links in
`doc/migrating-to-v1.rst` and `doc/release_notes.rst`). Until then it stays a
design-record linked by URL — the rules are permanent but the transitional
framing would only be re-done, so rendering now is wasted effort.

## Not blocking (follow-ups)

Expand Down