Skip to content

docs: what spec.expand() returns is documented on the model writer's python api page, and reading.md keeps only which program an engine reads - #696

Merged
FBumann merged 1 commit into
claude/attach-not-bindfrom
claude/docs-expand-model-writer-api
Sep 25, 2026
Merged

FBumann merged 1 commit into
claude/attach-not-bindfrom
claude/docs-expand-model-writer-api

Conversation

@FBumann

@FBumann FBumann commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Prompt: .expand() is regular model writer api!

Note

The following content was generated by AI.

A later prompt set the scope: "Dont fold it into the big PR. Put it into the stack!" This change was first a commit on #686, which now reverts it.

What this changes

The Spec.expand docstring, which the Python API page in Reference renders, is now the one home for the call. reading.md, under Development, keeps only which expanded program an engine reads. The docstring no longer says "the same math".

Method, gate output, alternatives
  • src/math_spec/model.py:
    • The Spec.expand docstring gives the kinds and the order they apply in, the ValueError, and that the result is a different model taking the same data. It also says the call returns itself where there is nothing to write out, and that nothing is cached.
    • The Spec class docstring says "the model with its formulations written out as plain rows", not "the same math".
    • schema/math-spec.schema.json is regenerated from these docstrings.
  • docs/reference/reading.md: "Formulations written out" says which program an engine reads, and that an expansion's program holds no curve.
  • Five links now point at api.md#math_spec.Spec.expand: typeset, piecewise, see-an-expansion, file-and-program, what-counts-as-public-api.
  • Coverage moved: reading.md checked three claims, and they are now tests in tests/test_expand.py. The claims: the expansion is not equal to its source, expanding it again returns it, and a model with nothing to write out returns itself. The page's pinned claim count in tests/test_reading_page.py drops from 22 to 19.
  • Gates (pixi is not installable in this session; a Python 3.12 venv stood in):
    • pytest -q: 1632 passed, 7 skipped.
    • ruff check ., ruff format --check .: clean.
    • mkdocs build --strict, with the blocked docs.python.org inventory removed: built, no warnings.
    • Not run: pixi run ci, compile-tex.
  • This head has the same content as fix(language): the docs gain a tutorial, a glossary and a Python API page, lose a third of the words a model writer reads, and say data is attached rather than bound #695's frozen head (ffcd68e).

Why

expand() is model-writer API, and its only description sat on a page for engine authors.

🤖 Generated with Claude Code

https://claude.ai/code/session_01A89tReSh8rTBG9ocy7688y


Generated by Claude Code

…python api page, and reading.md keeps only which program an engine reads

The Spec.expand docstring, which the Python API page in Reference renders, is
now the one home for the call: the kinds and their order, the ValueError, a
different model that takes the same data, itself where there is nothing to
write out, and no caching. It no longer says "the same math". reading.md's
section says which program an engine reads. Five links point at the API
entry. The three claims reading.md checked move to tests/test_expand.py, and
the page's claim count drops from 22 to 19. Schema regenerated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A89tReSh8rTBG9ocy7688y
@FBumann
FBumann added this pull request to stack #684 September 25, 2026 06:48
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