chore(program): a frame stays a set of dimension names, and only the sum over a join reads the axes it opens - #799
Merged
FBumann merged 1 commit intoSep 30, 2026
Conversation
…sum over a join reads the axes it opens The axes a join opens are closed by the sum over that join, which the resolver always builds with exactly `join.axes`. So `dims_of` reads a sum over a join as one rule, and no frame holds a join's axis. `Axis` and `Column` stay in `Sum.over` and `JoinColumns.axes`, where consumers read them. `frame_of`, `_names`, `_dimensions` and each `Axis(d) in frame` membership test go. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CPwrjirBZhVS4CcndN6f4H
Documentation build overview
42 files changed ·
|
FBumann
marked this pull request as ready for review
September 30, 2026 15:28
FBumann
pushed a commit
that referenced
this pull request
Sep 30, 2026
…s dimension names Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CPwrjirBZhVS4CcndN6f4H
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.
On top of #665, frames stay sets of dimension names.
dims_ofreads a sum over a join as one rule, so no frame holds a join's axis.AxisandColumnstay inSum.overandJoinColumns.axes. #665 shrinks from +183/−107 to +106/−61.What this changes
dims_ofreturnsfrozenset[str]again. For aSumover aJointhat opens axes, it returns the join's frame without them. AJointhat opens axes and has no sum over it is an assert.frame_of,_namesand_dimensionsare removed. TheAxis(d) in frametests in_where_resolver.py,lowering.pyandpiecewise.py, and thestr(axis)incomposition.py, are removed too. These four files are the same as on feat(language)!: a call names the columns of a relation as relation[column], and a sum through a relation is a sum over the axes its join opens #664 again.Axis,Column,Sum.over: tuple[Axis, ...],JoinColumns.axes, the separability and typesetter changes, and the docs.Why
The axes a join opens never leave the sum that closes them. The resolver is the only code that builds a
Sumover aJoin, and it always sums over exactlyjoin.axes(_expression_resolver.py:305). The typesetter (walk.py:421) and separability already read the pair as one unit. So the dimension check does not need axes in its frames. Three of the five guards in #665's table exist only because a string tested against a set of axes is always false. With string frames, that kind of error cannot happen.Size, guards, coverage moved, gates, not done
Size,
src/andtests/, against #664's headdimensions.pygoes from about 98 changed lines to 30.Guards
This PR adds two asserts. Each one states something that the resolver makes true:
_sum_dims: a sum over a join closes exactlyjoin.columns.axes.dims_of: a join that opens axes is read only by the sum that closes them.No test fails when either assert is deleted, because no input reaches its false arm. I did not add a probe that builds such a
Sumby hand.#665's last three guards (
Axis(d) in carried,in found,in dims) no longer exist, because those lines test a string against a set of strings again.Coverage that moved
test_a_join_opens_an_axis_for_the_column_it_drops_and_the_sum_over_it_closes_itno longer checks the frame of the bare join, because that frame no longer exists. It still checksnode.over == (Axis('snapshot', Column('rep_of', 'snapshot')),)and the frame of the sum.tests/test_dimensions.pyassertions compare to string sets again, as on feat(language)!: a call names the columns of a relation as relation[column], and a sum through a relation is a sum over the axes its join opens #664.Gates
Pixi is not reachable here. The gates ran from a uv venv on Python 3.12, with the pinned
ruffandpyrefly.pytest -q -n autoruff check,ruff format --check .pyrefly checkonsrc/yamlstubs in the venv. I did not compare this to #665's head.docs-build,compile-tex, the git hooksNot done
CHANGELOG.mdline.dims_ofis not public API, so this ischore. If this PR is folded into feat(program): the axis a join opens names the relation column it stands for #665, feat(program): the axis a join opens names the relation column it stands for #665's title and changelog line should drop "a frame holds axes".JoinColumns.kept_dims, which has no reader. That is separate work.🤖 Generated with Claude Code
https://claude.ai/code/session_01CPwrjirBZhVS4CcndN6f4H
Generated by Claude Code