Repository navigation
feat(language): a dimension may alias another's labels - #1029
Draft
FabianHofmann wants to merge 12 commits into
Draft
FabianHofmann wants to merge 12 commits into
FabianHofmann wants to merge 12 commits into
Conversation
`from_region: { alias: region }` has the labels, dtype and order of
`region` under a second name, so an entry can be over one set twice, as
TIMES' IRE_FLO is over two regions. The alias implies the relation
`from_region`, keyed by the alias with the value column `region`, read
`from_region[region]`, from each label to itself. It prints as the
primed index of `region` over the same set.
Ported onto main from #1020, where the identity read was a mapping of
#1015. A relation the file declares under the alias's name is refused
with the rewrite that deletes it.
(cherry picked from commit d924d66)
A reduction over a dimension primed its dummy once per enclosing use,
so inside an entry over an alias of that dimension it took the alias's
own index and printed `w_{g',g'}`. The dummy now primes past every index
another dimension prints with.
(cherry picked from commit 29973cd)
`exchanged` sums over `bus` inside a sum over its alias `from_bus`, so the golden model reaches the line that primes a dummy past the alias. (cherry picked from commit 84ba347)
IRE_FLO reads each region and commodity twice. With an alias for each, the spec states it over the regions and commodities themselves, and the workaround through an invented trade_link dimension goes. Ported from #1020; top_ire is keyed by its five columns on main.
The relation an alias implies has a column over the alias and one over the dimension it aliases, so it counted as a use of both, and an alias no entry is over drew no never-an-axis advice. An implied relation now reaches no dimension, and an alias in use reaches the dimension whose labels it has.
Program.relations names the implied relation beside the declared ones, and that a tool takes its rows from the labels of the alias.
`where: "from_g[g] == 'a'"` was refused as a column of a dimension, since a side named after a dimension never reached the relation the alias implies. A side that reads a column now reads the relation of that name, as #1020 read its mapping.
Documentation build overview
10 files changed ·
|
Under an entry over [from_g, g], sum(sum(w, over=g), over=from_g) printed both dummies as g'': the inner dummy primed past every dimension's index but not past the dummy of the sum around it. A dummy now also skips each index an enclosing reduction or lookup prints. The goldens do not change.
Along an alias of an unordered dimension, shift, sum_back, position, a type 2 set and a piecewise curve said to declare the alias ordered, and a label outside one_of said to add it to the alias's one_of. An alias may carry neither, so both now name the dimension it aliases. A relation declared under an alias's name is told to be deleted only where it restates the implied relation; any other collides with the dimension as usual.
This was referenced Nov 19, 2026
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.
A dimension may alias another's labels, so an entry can be over one set twice.
Prints
imp_r = Σ_{r' ∈ R} ire_flo_{r',r} · exp_{r'}: the alias is the primed index over the same set.Method, gate output, departures from #1020
pixi run cipasses at bf0191d: lint, test (4217 passed, 1 skipped), docs-build, compile-tex (62 documents)tests/test_alias.pyonorigin/main5f1464c: 15 failed (aliasis an unknown key)-x: d924d66, 29973cd, 84ba347; dropped 1d5e935 (changelog link to feat(language): a dimension may alias another's labels #1020)from_region, keyfrom_region, value columnregion,missing: refused, readfrom_region[region]. Built byspec.implied_relations; never underrelations:, so the name collision check never sees itRelation 'from_g' collides with the relation that dimension 'from_g' implies, read as from_g[g]. Delete 'from_g' under relations:., an alias of busnever-an-axisadvice, because its implied relation counted as a use. Guard removed →nothing-uses-the-aliasfails; second line removed →an-entry-is-over-the-aliasfailswhere: "from_g[g] == 'a'"was refused as a column of a dimension; a side reading a column now reads the relation (_side_kind, same helper as feat(language): a dimension lists its members #1014). Without it, the new test failsProgram.relationsdocstring tells a tool it reads no table for an implied relationtop_iretakeskey:(main's relation syntax); typeset output identical to feat(language): a dimension may alias another's labels #1020dims: [from_g, g],sum(sum(w, over=g), over=from_g)printedw_{g'',g''}; a dummy now skips enclosing dummies too →w_{g'',g'''}. Inherited from feat(language): a dimension may alias another's labels #1020. Goldens unchangedDeclare 'from_g: {ordered: true}', which the loader refuses; nowreads the order of 'from_g', an alias of 'g', … Declare 'g: {ordered: true}'(shift, sum_back, position, condition shift, sos type 2, piecewise). Inherited from feat(language): a dimension may alias another's labels #1020add 'zz' to the one_of of 'from_g'; now names'g'. Inherited from feat(language): a dimension may alias another's labels #1020Delete 'from_g' under relations:only where the declared relation restates the implied one; any other getscollides with the dimension of the same name. Rename one of them.Generated by Claude Code