Skip to content

feat(language)!: relation rows may index an entry - #1016

Closed
FBumann wants to merge 8 commits into
feat/dimension-aliasfrom
feat/maps-in
Closed

FBumann wants to merge 8 commits into
feat/dimension-aliasfrom
feat/maps-in

Conversation

@FBumann

@FBumann FBumann commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Note

The following content was generated by AI.

What this changes

Option A of three for a sparse set: entries stay over flat dimensions and list under in: the relations they exist on. #980 ported onto maps. Stacked on #1020 (alias), which states a dimension named twice.

# before (#1015)
relations:
  connection: { dims: [unit, port], missing: absent }
parameters:
  efficiency: { dims: [unit, port, snapshot], where: connection, missing: 1 }   # stray row dropped
variables:
  flow: { dims: [unit, port, snapshot], where: connection }

# after
parameters:
  efficiency: { dims: [unit, port, snapshot], in: [connection], missing: 1 }   # stray row refused
variables:
  flow: { dims: [unit, port, snapshot], in: [connection] }
constraints:
  balance: { dims: [bus, snapshot], expression: "sum(flow, over=[unit, port], by=connection[bus]) == load" }
# `where: connection` on a parameter or a variable is refused: "Write `in: [connection]`"

The TIMES examples (examples/times/)

# before (#1020)
act:     { dims: [region, vintage, period, process, timeslice], where: rtp_vintyr AND prc_ts }
ire_flo: { dims: [from_region, from_commodity, region, commodity], where: top_ire }
# after — the where: is refused here, with in: as the rewrite
act:     { dims: [region, vintage, period, process, timeslice], in: [prc_ts, rtp_vintyr] }
ire_flo: { dims: [from_region, from_commodity, region, commodity], in: [top_ire] }   # a stray link row is refused

Why

Method, gate output, open points

🤖 Generated with Claude Code

https://claude.ai/code/session_018B3nA1xxh6NMJN6mrYY34Q

claude and others added 2 commits November 16, 2026 16:25
#980's `in:` on top of #1015's maps. A parameter or a variable lists under
`in:` the relations whose rows it exists on; a tool refuses a data row of a
parameter outside them. A relation's bare name in the `where:` of a
parameter or a variable is refused, with `in:` as the rewrite.

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

read-the-docs-community Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

An entry over a dimension twice, as TIMES' IRE_FLO: the alias's docs example
lists the links under in:, and a test states IRE_FLO in this spelling.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018B3nA1xxh6NMJN6mrYY34Q
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018B3nA1xxh6NMJN6mrYY34Q
@FBumann
FBumann changed the base branch from feat/maps-only to feat/dimension-alias November 16, 2026 17:15
The TIMES examples in this PR's spelling: act lists prc_ts and
rtp_vintyr under in:, and ire_flo, trade_cost and export list top_ire,
in place of the where: that A refuses.

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: efficiency, flow and output list their
relation under in:, so a stray data row is refused.

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

FBumann commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

Note

The following content was generated by AI.


Generated by Claude Code

@FBumann FBumann closed this Nov 16, 2026
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