Skip to content

docs(language): the relations page shows a variable masked by a bare relation, so it exists only at the pairs the relation lists - #946

Merged
FBumann merged 2 commits into
mainfrom
claude/gallant-franklin-6ndbd1-relation-mask
Oct 22, 2026
Merged

FBumann merged 2 commits into
mainfrom
claude/gallant-franklin-6ndbd1-relation-mask

Conversation

@FBumann

@FBumann FBumann commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Prompt: Should we put sth on main directly? As an example? […] Yes

Note

The following content was generated by AI.

What this changes

The "Tests" section of the relations reference gains a worked example. A variable masked by a bare relation, where: connection, has a column only at the listed (generator, bus) pairs, so a balance adds up only the wired generators.

relations:
  connection: { key: [generator, bus], missing: absent } # the pairs that are wired
variables:
  flow:
    dims: [generator, bus, snapshot]
    where: connection
    bounds: { lower: 0 }
constraints:
  balance:
    dims: [bus, snapshot]
    expression: sum(flow, over=generator) == load
Method, gates, and what was not done

Method. The page's full YAML block was loaded with python -m mathspec check. The two equations under it are copied from to_markdown of that spec, with \left( g,\ b \right) written as (g, b).

Gates. pixi is not installed in this container, so the gates ran in a uv venv on Python 3.13, with zensical==0.0.63. They ran on origin/main at 13fba32, plus this commit.

  • pytest -q -n auto: 3063 passed, 3 skipped.
  • python -m zensical build --strict: no issues.
  • prettier --check and typos --force-exclude on the page: clean.
  • compile-tex was not run, because the container has no tectonic. The PR changes no spec in its corpus.

Not done. On main, the only examples of a relation as a mask were on constraints: looked_up on the linear-maps page, and connected on the notation page. This adds the variable case only. A parameter masked by a relation is #945, which is stacked on #894 and does not touch this page.

Why

#935 asks how a quantity over several dimensions can be limited to the valid combinations. For a variable, the language can already say this. The page now shows it, so #935 and #945 can link to main.


Generated by Claude Code

…relation, so it exists only at the pairs the relation lists

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0113aUbLChfQVBrVR5FVQnJq
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0113aUbLChfQVBrVR5FVQnJq
@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 mathspec | 🛠️ Build #35336488 | 📁 Comparing 96bf12b against latest (13fba32)

  🔍 Preview build  

2 files changed
± reference/changelog/index.html
± reference/language/relations/index.html

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