You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A lookup from a dimension into itself, so representative snapshots are sayable #424
Prompt: "And yes, open an issue about the self-mapping"
Note
The following content was generated by AI. Filed from the discussion under #275, where splitting lookups: into groupers and connectors was explored and rejected; this is the one capability the word "connector" reaches for that the language refuses.
What can be improved?
A lookup must map into a dimension other than the one it is over. Today:
is refused at load with Lookup 'rep_of' maps 'snapshot' into itself. A lookup maps into a different dimension.
That is the representative-period map (tsam, Kotzur): every snapshot names the representative snapshot that stands for it, and #6 listed it as the second kind of "connector". With the refusal lifted it needs no new construct:
call
reads
at(x, by=rep_of)
the representative's value at every snapshot it stands for
sum(x, by=rep_of)
x summed onto each representative from the snapshots it stands for
shift(x, over=snapshot, offset=1, by=rep_of)
the walk inside each representative's group
position(snapshot, by=rep_of) == 0
the first snapshot of each group
where: rep_of
the snapshots a representative stands for
The dim algebra holds with one added sentence: where over and into coincide, the operator consumes and produces the same dimension, so the frame is unchanged. sum(by=) and at(by=) stay adjoints. The bind-time checks are verbatim: values are labels of snapshot, one row per snapshot.
One open question. The map's table today carries two columns, one named after over and one after into. For a self-map both are snapshot, so the value column needs another name. The candidates are the lookup's own name (rep_of), or a fixed convention such as into; the reference's "the map is supplied under the lookup's own name" section would say which.
per: (#161) composes with this unchanged: a representative that varies by period is {over: snapshot, into: snapshot, per: [period]}.
What lifting it touches
model.py: the into == over refusal.
dimensions.py: _sum_dims and _at_dims, whose "would need the dim twice" checks read over and into as distinct.
the typesetter legend, which prints rep_of: 𝒯 → 𝒯 without change.
a where comparing two lookups over and into snapshot already works.
Note
The following content was generated by AI. Filed from the discussion under #275, where splitting
lookups:into groupers and connectors was explored and rejected; this is the one capability the word "connector" reaches for that the language refuses.What can be improved?
A lookup must map into a dimension other than the one it is over. Today:
is refused at load with
Lookup 'rep_of' maps 'snapshot' into itself. A lookup maps into a different dimension.That is the representative-period map (tsam, Kotzur): every snapshot names the representative snapshot that stands for it, and #6 listed it as the second kind of "connector". With the refusal lifted it needs no new construct:
at(x, by=rep_of)sum(x, by=rep_of)xsummed onto each representative from the snapshots it stands forshift(x, over=snapshot, offset=1, by=rep_of)position(snapshot, by=rep_of) == 0where: rep_ofThe dim algebra holds with one added sentence: where
overandintocoincide, the operator consumes and produces the same dimension, so the frame is unchanged.sum(by=)andat(by=)stay adjoints. The bind-time checks are verbatim: values are labels ofsnapshot, one row per snapshot.One open question. The map's table today carries two columns, one named after
overand one afterinto. For a self-map both aresnapshot, so the value column needs another name. The candidates are the lookup's own name (rep_of), or a fixed convention such asinto; the reference's "the map is supplied under the lookup's own name" section would say which.per:(#161) composes with this unchanged: a representative that varies by period is{over: snapshot, into: snapshot, per: [period]}.What lifting it touches
model.py: theinto == overrefusal.dimensions.py:_sum_dimsand_at_dims, whose "would need the dim twice" checks readoverandintoas distinct.rep_of: 𝒯 → 𝒯without change.wherecomparing two lookups over and intosnapshotalready works.Version
0.0.0-alpha.80, with #422 applied.