Repository navigation
feat(language)!: sets and properties replace relations, and a relations section is refused - #5
Draft
FBumann wants to merge 2 commits into
Conversation
…ns section is refused Every relation in examples/, the fixtures and the docs is rewritten as sets and properties, and the generated pages and golden files are regenerated. `relations:` leaves the schema, so a file that still declares it is refused with the closed schema's own message. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01W6yvGzZN2iR4WyA9RumvvJ
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Comment |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01W6yvGzZN2iR4WyA9RumvvJ
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.
What this changes
relations:is gone. Every relation inexamples/, the YAML fixtures, the golden model and the docs is rewritten as sets and properties, and every generated page is regenerated. A file that still declaresrelations:is refused by the closed schema. Stacked on #4.Why
This is PR 5 of the stack in which sets and properties replace relations. It breaks every file that declares
relations:, so the release that carries it raises the minor version.How the rewrite maps a relation
connection: {key: [generator, bus]}connection: {dims: [generator, bus]}, with roles kept as a mappingLine_bus0: {key: line, values: bus}line: {bus0: bus}zone_of: {key: [generator, period], values: zone}generator_periodwith the samemissing:, and a propertyzoneLine_bus0→bus0); otherwise the column name; otherwise the relation's name without_of(area_of→area); andrelation_columnlast.R[c]becomessubject[c']. A bare keyedRbeside a comparison becomessubject[p], and elsewhere a presence test, or the set's name. A read inside a YAML flow mapping is quoted.examples/pypsa/is whattools/pypsa_split.pywrites fromexamples/pypsa.yaml, and the split output was byte-identical to the per-file migration.operators.mdpropertiesfrom_bus/to_bus, which the naming rule would have calledbusandline_to.The rewrite script, which is not in the tree
The project keeps no migration aid for a retired spelling, so the script is here rather than in
tools/. Run it against a tree that still readsrelations:(it loads both forms to compare the math). The naming rule in its docstring is older than the_namesfunction, which is the rule described above.The full script, 316 lines, is in the session scratchpad. I can commit it under
tools/on request.What else changed, and where coverage moved
src/:RelationSpec,Spec.relationsand the relation-entry rules are deleted.Namespace.relationsbecomesNamespace.sets, and the name kindrelationbecomesset. Every message that named a relation now names a set, a property or a subject. Two typesetter branches that only a keyed relation without a subject reached are deleted, because the golden coverage test showed no model can reach them.g.a[a], the table name; it now printsg[a].g[h] > 'b'offeredposition(g), advice about the subject dimension rather than its property.relations.mdis deleted. Its rules for how a call joins and groups move intosets.md(sums, lookups, partitions, tests).about/relations-as-linear-maps.mdis nowabout/sets-and-properties-as-linear-maps.md. Every link, table row and YAML example names sets and properties, and every example on the pages I touched loads.missing:, and a bare comparison of a two-value relation. The set and property versions of those rules are intests/test_sets.py. Every other test reads sets and properties and asserts the new messages.Gates, and the mutation table
pixi run lint,pixi run test(3204 passed, 1 skipped),pixi run docs-build(strict) andpixi run render-tex(54 specs).compile-tex. Tectonic cannot download its bundle in this container.subject[property]subject[property]Generated by Claude Code