Repository navigation
feat(language): at spreads a tuple over its members - #1025
Draft
FabianHofmann wants to merge 9 commits into
Draft
FabianHofmann wants to merge 9 commits into
FabianHofmann wants to merge 9 commits into
Conversation
# Conflicts: # tests/test_tuple_dimensions.py
Documentation build overview
24 files changed ·
|
- the meeting advises a spread only where dims: holds every member - a partial list and two members over one dimension raise DimensionError - a piecewise by: naming members of a dimension in dims: is refused as a DimensionError, and advises at() by the same columns in the link - a member read inside a spread prints as the member's index - footprint.spreads names each dimension a row or bound spreads
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.
atby every member of a dimension moves an operand over that dimension to its members, absent where no tuple exists.Part of #1011 (rule 6). Stacked on #1014.
Prints
metered_{p,u} = flow_{(p,u)},sent_{c,p} ≤ busy_{(p, connection.unit(c))},level_a ≥ level_{(assignment.period(a) − 1, assignment.unit(a))}.Engines:
program.footprint.spreadsnames each dimension a row or bound spreads ({'connection'}above).Method, gate output, choices, not done
Triage (limits.md): no new operator.
aton an operand over the dimension, where it was refused. On an operand over the members it gathers onto the dimension, as before.Rule
connectionand over no member → spread;by=lists every member, any order.DimensionError, as on feat(language): a dimension lists its members #1014) →at(flow, by=connection[port, unit])orsum(flow, over=connection, by=connection[unit]).connectionand a member → refusal of feat(language): a dimension lists its members #1014, unchanged.trade: {src: region, dst: region}) → refused (DimensionError;SchemaErroron feat(language): a dimension lists its members #1014), rewritesum(shipped, over=trade, by=trade[dst]).Why
JoinColumns.spreads, and why the sum by every member still loadssum(y, over=assignment, by=assignment[unit, period])has the samejoined/groupedas the spread, and groups of at most one row. relations.md refuses other one-row-per-group sums; this one loads because it is a different program: 0 where no tuple, the spread absent.at(shift(sum(y, …), along=period, offset=1), by=…)reads 0 in a unit's first active period; the spread form drops that row. Same foridle_sends_nothingvsonly_when_busyabove.Joininkinds, like a lookup, so an engine gating onkindscould not see it. New fieldFootprint.spreads: frozenset[str], empty when unused, like the other fields. Covers rows and bounds, notwhere:(askinds).Program
JoinwithJoinColumns(joined=(connection,), grouped=(port, unit), spreads=True);JoinedConditionlikewise.Join,JoinColumns,JoinedCondition,Footprint; reading.md.Loads (tests): constraint (left join, sum after, shift along another dimension, shift along a member), named expression (body and as operand), one case +
otherwise, bound,where:(bare and comparison), piecewise link withatby every or one member.Refused, each with the rewrite
when:with a spread, two or more cases, written inline or through a namedconditions:entry → undecidable (SchemaError). The spread's "has a row" is a different fact from the relation's. Not handled, so refused.by:naming members of a dimension indims:→DimensionError, advisesat(<expression>, by=<same columns>)in the link. On feat(language): a dimension lists its members #1014 a cleanDimensionErrorfrom a later check; the new spread inlookupwould crash here, so it is refused first.connectionin an entry over its members (constraint, named body, bound,where:) suggests the spread; a meeting suggests it only wheredims:holds every member.Typesetting: a gather inside a spread printed
capacity_{connection.unit((o, u))}; nowcapacity_u, all three formats. Golden unchanged (regenerated, no diff).Guard removal (each deleted, full suite run)
SchemaError→ 2 failSchemaError→ 1 failsby:→ 2 fail; asSchemaError→ 2 failspreads()needs value columns (key column keeps its own refusal) → 1 fails (test added after 0 failed)dims:, one guard (_spread_roles) for the stray-dimension rewrite and the meeting → 5 fail; the meeting calling it with its own members instead ofdims:→ 2 failfootprint.spreads→ 2 failGates
pixi run cipasses on the pushed head: lint, 4361 tests (1 skipped), docs-build--strict, compile-tex (62 documents).*.out(no change from this revision),docs/reference/notation.md. Schema unchanged.operators-at-members.svg: looked at in light and dark (headless Chrome). Data invented: three connections.idle_sends_nothingis the typesetter's output, copied.limits.md moves: "an order along a dimension with members" →
shiftandsum_backalong an ordered member now have a spelling. dimensions.md: the left join moves from "no left join" to an example (the sum by every member); outer join stays refused.Where #1011 is silent or off
carryabove loads.position,piecewise:,sos:still need the bare relation.Not done
checkadvice).shiftalong the tuple dimension itself stays refused. Noin:,maps:, linopy.when:(refused, see above).dims:either.footprintstill does not readwhere:.Generated by Claude Code