Repository navigation
feat(language)!: maps give labels, relations give rows - #1001
Open
FabianHofmann wants to merge 7 commits into
Open
FabianHofmann wants to merge 7 commits into
FabianHofmann wants to merge 7 commits into
Conversation
`relations:` takes `dims:`, `missing:` and `description` only. A new `maps:` section, keyed by a dimension or a relation, gives each row of its subject one label of the dimension that `refers:` names, with its own `missing:`. A map is read as `subject[map]`, and `subject[map]` alone in a condition is true where the map gives a label. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01F4nx8GcpB6VRUi38KTVQiw
FabianHofmann
requested review from
FBumann and
brynpickering
as code owners
November 12, 2026 09:40
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01F4nx8GcpB6VRUi38KTVQiw
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01F4nx8GcpB6VRUi38KTVQiw
# Conflicts: # docs/examples/pypsa/security.md # docs/examples/pypsa/transformer.md # docs/examples/pypsa_ladder.md # examples/pypsa.yaml # examples/pypsa/security.yaml
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01F4nx8GcpB6VRUi38KTVQiw
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01F4nx8GcpB6VRUi38KTVQiw
Per FBumann on #1000: a relation's bare name in the `where:` of a parameter or a variable is refused, because `in:` states those rows, and the map key `refers:` becomes `refers_to:`. The `index-set` advice that pointed from one spelling to the other is gone with it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01F4nx8GcpB6VRUi38KTVQiw
This branch has not been deployed
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.
Note
The following content was generated by AI.
relations:states which rows exist; a newmaps:section gives each row of a subject one label. Implements the design in #1000 (closes the split part; its open questions stay open).connection ⊆ B × G,bus: G → B; a map test printsbus1(l) is defined.key:/values:; no alias, per AGENTS.md (pre-1.0).Method, gate output, alternatives
Relations, maps and
in:: the agreed design, the decisions made and the questions still open #1000, rule by rule:dims:; not a dimension: indims:,over=,along=refused with its dimensions as the rewrite ✓refers_to:must be a dimension, so a number stays a parameter ✓missing:per relation and per map ✓in:, thenwhere:, thenmissing:: from feat(language): relation rows may index an entry #980, unchanged ✓mergejoins the maps of a subject; each fragment declares the maps it reads ✓in:: the agreed design, the decisions made and the questions still open #1000 loads as written ✓departure: Relations, maps and
in:: the agreed design, the decisions made and the questions still open #1000 says "a label of another dimension"; a map may refer to its own subject's dimension (snapshot[rep], used by the examples).from FBumann on Relations, maps and
in:: the agreed design, the decisions made and the questions still open #1000:where:of a parameter or a variable is refused, rewritein: [relation]; under OR/NOT, a bool parameter. Theindex-setadvice is gone, its cases moved totest_validation.py.refers:→refers_to:(FBumann offeredreferences:orrefers_to:;refers_to:keeps coroa's word).still allowed: a bare relation in a constraint's
where:, a casewhen:, an assumption, sincein:is not on those (Relations, maps andin:: the agreed design, the decisions made and the questions still open #1000 question 2, untouched).relations:takesdims:(≥ 2 columns),missing:,description. One-column relation refused, pointing atmaps:.maps:keyed by subject (dimension or relation); each map hasrefers_to:,missing:(refused/absent, per map),description. Short formbus: bus. Composes as a shared section inmerge/override.Read as
subject[map]in every operator, condition andmissing: by:.subject[map]alone in a condition is a presence test (RelationDefined.column).Program: one
Relationtable per subject, keyed by its name;Relation.partiallists the maps withmissing: absent;Reach.namenamessubject[map].Overlap prover (
_exclusivity): a map has a null cell; a comparison of two maps is false where either has no label (was unsound: twonotcomplements proved apart); a dimension subject always has a row; witness says "has no label".Bugs found while porting, each with a test that fails without the fix:
where:and did not load (51 tests intest_piecewise.py);intdimension read the subject's dtype, and a label hit an internal assertion (test_a_map_of_a_numbered_dimension_compares_a_label);test_exclusivity.py).All examples, fixtures, goldens, schema and generated pages regenerated;
docs/reference/language/relations.mdrewritten as "Relations and maps"; every other page, the operator labels and 14 figures swept to the new words.gate:
ruff check,ruff format --check,pyrefly check,pytest(4285 passed, 8 skipped),typos,prettier,zensical build --strict. Not run:compile-tex(no tectonic here); pixi unavailable, ran in a uv venv.Stack: on feat(language): a missing row reads per relation label #984 → feat(language): assumptions may require a row to exist #982 → feat(language): relation rows may index an entry #980, all three updated with
main(docs(pypsa): the file states the rows PyPSA builds #998); docs(pypsa): the file states the rows PyPSA builds #998's new PyPSA rows converted tosnapshot[period].Breaks open PRs that use
key:/values:: docs(calliope): all of calliope's math is a set of fragments that merge, with its modes laid over them as patches #770, docs(pypsa): the linearized unit commitment names the units it tightens as a mask #887, docs(pypsa): the pypsa spec names its fix, ext, commitment, maintenance and ramp row sets as masks #888, docs(pypsa): the PyPSA spec is written as fragments, with each committable class, the relaxed commitment and the risk preference as layers that a model takes or leaves out #902, feat(composition): rename gives a spec other names, so one fragment can serve several classes in one merge #905, docs(pypsa): the file states four more piecewise curves #989.https://claude.ai/code/session_01F4nx8GcpB6VRUi38KTVQiw
Generated by Claude Code