Repository navigation
feat(language): a call reads a property of a dimension or a set, written subject[property] - #2
Draft
FBumann wants to merge 4 commits into
Conversation
…ten subject[property] `sum`, `at`, `within=` and conditions read `subject[property, …]` by the rules of a relation column. One property reads its own table, several read their inner join, and `subject[property]` alone tests that a row has it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01W6yvGzZN2iR4WyA9RumvvJ
…umns rather than calling it undeclared Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01W6yvGzZN2iR4WyA9RumvvJ
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 |
…groups are read from 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
sum,at,within=and conditions now readsubject[property, …], by the join and group rules of a relation column. One property reads its own table,subject.property. Several properties read the inner join of their tables.subject[property]alone tests that a row has the property. Stacked on #1.The PR also fixes one bug.
position(..., within=...)in a condition named no table innames_read, for relations too, so a consumer that attaches what a mask reads left the groups out.Why
This is PR 2 of the stack in which sets and properties replace relations.
How a read lowers
Namespace.table(subject, names)decides which table a call reads:namesum(x, over=generator, by=generator[bus])generator.busgenerator.bussum(x, over=generator, by=generator[bus, carrier])generator(the inner join)generator.bus,generator.carriersum(x, over=start, by=cover[covered])covercoverwithin=snapshot[period]snapshot.periodsnapshot.periodgenerator[bus] == 'b1'RelationComparison('generator.bus', 'bus', …)generator.busline[bus0] != line[bus1]RelationPairComparison('line.bus0', …, 'line.bus1', …)generator[bus, carrier]aloneRelationDefinedon each table, joined byAndRelationwithsubjectset, keyed by the subject's members, with one value column per property. Itsmissingisabsentwhere any of the properties is.JoinColumns.tablesandPartition.tablesname the tables the data supplies.Mask.names_readreads them, for a join, a partition and a position counted within groups, so a mask never names the subject as if it were data.JoinColumns.writtenandPartition.writtengive the subject as the file wrote it. The dimension-rule messages use it.program.relations.name[a, …]alone as a presence test.subject[a, b] == xkeeps the rewrite "a comparison reads one column", which now fires at the comparator.sum(by=generator[zone]) names ['zone'], which is no property of 'generator'. Name one of its properties, ['bus', 'carrier'].Departures, and what this PR does not do
position(within=)fix rides this PR rather than a PR of its own. It also changes behaviour for relations. I first reproduced it as a strictxfailin three cases (a relation, one property, two properties) and watched all three fail. The marker came off with the fix.Only a relation has columns(tests/test_validation.py) now expectsOnly a relation, a set or a dimension has columns, because a dimension and a set now take brackets.generator.bus(g), and the reference page shows that output. PR 4 changes the legend and regenerates both.docs/reference/reading.mdis PR 4.Gates, and the mutation table
pixi run lint,pixi run test(3202 passed, 1 skipped) andpixi run docs-build(strict). Both YAML examples on the page load, and the math and the quoted refusal were taken from the code's output.compile-tex. Tectonic cannot download its bundle in this container.ci.ymlreturns 404. Actions must be turned on in the fork's settings.git checkout --, and drops__pycache__around each mutation. The tree came back clean.🤖 Generated with Claude Code
https://claude.ai/code/session_01W6yvGzZN2iR4WyA9RumvvJ