Skip to content

A lookup from a dimension into itself, so representative snapshots are sayable #424

Description

@FBumann

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:

lookups:
  rep_of: { over: snapshot, into: snapshot }

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.

Version

0.0.0-alpha.80, with #422 applied.

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: relationsrelations and dimensions: the relation designdesign: openIn scope; the spelling is undecided

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions