Skip to content

feat(language): multi-dimensions as agreed in #1011 - #10

Draft
FBumann wants to merge 10 commits into
feat/dimension-aliasfrom
feat/multi-dimension
Draft

FBumann wants to merge 10 commits into
feat/dimension-aliasfrom
feat/multi-dimension

Conversation

@FBumann

@FBumann FBumann commented Nov 19, 2026 •

Copy link
Copy Markdown

Note

The following content was generated by AI.

Opaque multi-dimensions in the state agreed on energy-models#1011, on top of energy-models#1015 (mappings) and energy-models#1020 (alias).

🤖 Generated with Claude Code

https://claude.ai/code/session_018B3nA1kAFd1xCHh126cGQc

claude and others added 8 commits November 16, 2026 16:32
Ports energy-models#1014 alone onto energy-models#1015's maps, without energy-models#1012 or energy-models#1013. A dimension
takes `over:` and `missing:`; each member is an implied map of the
dimension, read as `connection[unit]`, beside the maps the file declares
under `maps: connection:`. A declared map named after a member is
refused. A bound over a member suggests a constraint through `at`, since
a bound does not read through a map here.

Co-Authored-By: Fabian Hofmann <fab.hof@gmx.de>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018B3nA1xxh6NMJN6mrYY34Q
With the alias underneath, a dimension's members are a list of
dimensions, each once. The role form (`over: {from: region, to:
region}`) is gone: a tuple that holds one dimension twice lists an alias
of it as a member, and `over: [region, region]` is refused with the alias
as the rewrite. The two branches that only roles reached are removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018B3nA1xxh6NMJN6mrYY34Q
The TIMES trade example in this PR's spelling: top_ire is a dimension
over the two aliases and the two plain dimensions, and ire_flo,
trade_cost and export are over it. capacity.yaml keeps its relations:
rtp_vintyr has an ordered member, which a tuple dimension cannot step
along.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018B3nA1xxh6NMJN6mrYY34Q
sparse.yaml in this PR's spelling: connection is a dimension over unit
and port, capacity is read through at(), the sum per unit groups by the
member, and active stays a relation because ramp_up steps along its
ordered member.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018B3nA1xxh6NMJN6mrYY34Q
… mappings

energy-models#1017's multi-dimensions in the spelling of the stack below: maps: is
mappings:, a member is a mapping of its dimension, and the trade example
lists the process of each link in top_ire.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018B3nA1xxh6NMJN6mrYY34Q
@coderabbitai

coderabbitai Bot commented Nov 19, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

…used

A dims: list reaches each member once. Two dimensions that share a
member, or a dimension beside one of its own members, are refused at
load, in place of the cross product they meant. The message names the
shared member and the rewrite: one of the two with a where: through a
relation, or an alias. The same holds for a piecewise entry's dims:.
Two dimensions over different aliases of one dimension share no member,
so the alias is the opt-in to their cross product.

(cherry picked from commit 0cbb7fa of #9)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018B3nA494URRSeWy6wmELGP
Claude-Session: https://claude.ai/code/session_018B3nA1xxh6NMJN6mrYY34Q
ordered: true on a dimension with over: makes the row order of its
tuples part of the spec, as for any dimension. shift, sum_back,
position, piecewise: and sos: of type 2 step from one listed tuple to
the next, and within= groups the steps by a member, as in
within=snapshot[period]. A step along one member stays refused.

Proposed on energy-models#1011 for multi-period snapshots; not agreed there yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018B3nA1xxh6NMJN6mrYY34Q
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.

2 participants