Skip to content

refactor(language): a partition is a class of its own rather than a direction - #559

Merged
FBumann merged 4 commits into
claude/busy-volta-1z98iqfrom
claude/intelligent-heisenberg-l81m8w
Sep 20, 2026
Merged

FBumann merged 4 commits into
claude/busy-volta-1z98iqfrom
claude/intelligent-heisenberg-l81m8w

Conversation

@FBumann

@FBumann FBumann commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Prompt: "Should we treat partitions differently? A different class?" — "Do the stacked PR"

Note

The following content was generated by AI.

Stacked on #494.

What this changes

program.Partition holds what a translation, a window and a grouped position read off a relation: along, the key column stepped along; group, the value columns within= named; and joined, the other key columns. Translate.partition, Window.partition and DimensionPositionNode.partition are Partition | None. Direction keeps sum and at alone, and its docstring loses the paragraph that redefined its fields for a partition. RelationNode carries either kind as use, and each consumer asserts the kind its operator takes.

Why

A partition is not a direction. sum and at consume columns and produce columns, so the frame changes and "which way" is the fact. A partition leaves the frame as it is: it steps along one key column and reads the group columns at the frame's own key. So consumed and produced were false names for its two fields, and Direction had to say "for a partition, consumed is…" to be read at all. Walk had the same paragraph.

No consumer took both kinds. Resolution already built them through two functions, and every reader was one or the other. The one shared piece was the typesetter's _relation_read, which reads the relation's name, key and values, so it takes the RelationDeclaration now.

The break

Partition joins program.__all__. The three nodes above no longer hold a Direction, so a consumer reading .consumed or .produced off a partition reads .along and .group instead. lpspec pins math-spec by tag and needs the same follow-up #494 already owes it.

Rebased onto main at bda1fc5

Merged, not replayed: the hard rule here is never to force-push. main came
in at the bottom of the stack (#494) and was carried up through every branch
between, so this one's base is current.

Clean at this level: no conflict, and the suite passes unchanged.

Gates

pixi.sh is refused by this environment's egress proxy, so the gates ran from a uv environment on Python 3.12. That is a departure from the "everything runs in a pixi environment" default.

gate result
pytest -n auto 1330 passed, 6 skipped
ruff check, ruff format clean
pyrefly check 0 errors
typos, reuse lint clean
mkdocs build --strict clean, with the docs.python.org inventory dropped for the run — the proxy refuses it with a 403
compile-tex not run, for want of a TeX distribution

Every generator was re-run: neither the schema, nor the golden .out files, nor the generated pages moved. One test moved with the field it reads: test_a_partition_keeps_its_group_when_the_relation_gains_a_value_column asserts .group where it asserted .produced.

🤖 Generated with Claude Code

https://claude.ai/code/session_01UnbTmmYp7auaiCwSgkKKsB


Generated by Claude Code


Generated by Claude Code

…ion with nothing consumed or produced

A translation, a window and a grouped position hold a Partition: the key
column stepped along, the group columns within= named, and the key columns
joined on. Direction keeps sum and at, where columns are consumed and
produced and the frame changes. A partition's frame does not change, so
its fields no longer have to be read against a paragraph that redefines
them. RelationNode carries either as `use`, and each consumer asserts the
kind its operator takes.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UnbTmmYp7auaiCwSgkKKsB
@read-the-docs-community

read-the-docs-community Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

@FBumann
FBumann removed this pull request from stack #560 September 19, 2026 18:10
@FBumann
FBumann added this pull request to stack #574 September 19, 2026 18:10
@FBumann
FBumann removed this pull request from stack #574 September 19, 2026 18:12
@FBumann
FBumann added this pull request to stack #575 September 19, 2026 18:12
Carries origin/main up the stack of #494.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DUyQztqnwapp3vHPhzBLw5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants