Skip to content

feat(language): a parameter and a relation each say whether their data must be complete, so a row lost in preparation is not read as a mask - #671

Closed
FBumann wants to merge 2 commits into
mainfrom
claude/lookup-coverage-port
Closed

FBumann wants to merge 2 commits into
mainfrom
claude/lookup-coverage-port

Conversation

@FBumann

@FBumann FBumann commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Prompt: Rebase all other PRs [...] 245 [...] Port the change

Note

The following content was generated by AI.

Replaces #245, whose branch shares no history with main. Closes #296. parameters: and relations: take coverage: total | masked, default total. The expansion now declares a curve's tables masked where the curve has points:.

What was ported, what is new, gates

Ported from #245

Changed from #245

Guards, each deleted in turn on this head

guard deleted suite
the curve-parameter refusal 2 failed
lowering's None for a curve parameter 1 failed
lowering dropping a parameter's coverage 3 failed
the namespace dropping a relation's coverage 1 failed
the expansion writing no coverage 3 failed
the unwritten default flipping to masked 11 failed

Every new test was run on unported main first and failed there.

Gates

The gates ran from a uv venv on Python 3.12, with the docs toolchain from pixi.toml's docs feature.

gate result
pytest -n 4 1654 passed, 5 skipped
ruff check, ruff format --check clean
pyrefly check 0 errors
tools.schema --check, golden regeneration, every generated page current
mkdocs build --strict clean. The sandbox blocks the fetch of docs.python.org/3/objects.inv, so the build ran from a scratch copy of mkdocs.yml without that one inventory line.
prettier --check docs clean

Both new YAML fences load, and read back masked where they write it.

Docs sentences, after (before): absence.md n 34, avg 13.5, median 12, over 25 words 2 (32, 13.2, 12, 2); declarations.md n 43, avg 13.9, median 12, over 25 words 5 (30, 10.7, 10, 1); relations.md n 42, avg 16.4, median 15, over 25 words 7 (39, 15.9, 15, 5); piecewise.md n 72, avg 17.5, median 16, over 25 words 12 (71, 17.5, 15, 12); reading.md n 84, avg 16.3, median 15, over 25 words 13 (80, 16.2, 15, 13). Four of declarations.md's five are the script joining a bold lead-in to the sentence after it.

Not run: compile-tex. No typeset output changed, because coverage is not printed, as #245 decided.

Not done

🤖 Generated with Claude Code

https://claude.ai/code/session_01GpnFcQDuvt2bExGngb6MYk


Generated by Claude Code

…a must be complete, so a row lost in preparation is not read as a mask

Port of #245 onto main, whose history it no longer shares.
parameters: and relations: take coverage: total | masked, default
total. A total table short of a row is a bind-time error naming the
coordinate; masked says the gap is meant and a missing row reads as the
value that contributes nothing. coverage: on a parameter a piecewise
block consumes is refused at load, since points: already says how far
each curve runs, and the program reports no coverage for such a
parameter.

New since #245: a curve is no longer written out at load, so an engine
building rows reads the expansion, where no block is left to own the
tables. The expansion declares a parameter only curves with points:
consume coverage: masked, since its weights and segment rows stand on
the mask and the _complete assumption states where a row is required.
A parameter a curve over every breakpoint reads stays total.

The pypsa examples mark the parameters whose descriptions say a missing
value means none, as #245 did, and pypsa_losses marks its
Line_cycle_weight the same way.

Guards, each deleted in turn: the curve-parameter refusal (2 fail);
lowering reporting the default on a curve parameter (1); lowering
dropping a parameter's coverage (3); the namespace dropping a
relation's coverage (1); the expansion writing no coverage (3); the
unwritten default flipping to masked (11).

Docs sentences, after (before): absence.md n 34 avg 13.5 median 12
over25 2 (32, 13.2, 12, 2); declarations.md n 43 avg 13.9 median 12
over25 5 (30, 10.7, 10, 1); relations.md n 42 avg 16.4 median 15 over25
7 (39, 15.9, 15, 5); piecewise.md n 72 avg 17.5 median 16 over25 12
(71, 17.5, 15, 12); reading.md n 84 avg 16.3 median 15 over25 13 (80,
16.2, 15, 13).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GpnFcQDuvt2bExGngb6MYk
@FBumann FBumann added area: data contract What a file guarantees about the data it binds area: relations relations and dimensions: the relation design and removed area: relations relations and dimensions: the relation design labels Sep 24, 2026
@FBumann FBumann added this to the Data contract declarations milestone Sep 25, 2026
FBumann pushed a commit that referenced this pull request Oct 2, 2026
… is complete unless the file says otherwise

One key replaces `default:`, `absence:` and the `coverage:` of #671.

- A parameter takes `missing: error | absent | neutral | <value>`, default
  `error`. A value has the parameter's dtype; `inf` and `.inf` are one
  number.
- A relation with `values:` takes `missing: error | absent`, default
  `error`. A bare relation takes none.
- A variable takes `missing: absent | neutral`, the old `absence:`.
- A parameter a piecewise block reads takes no `missing:`; the expansion
  declares it `neutral` where the curve has `points:`.
- The exclusivity prover reads a value in a comparison at a missing row.
- The PyPSA examples mark their sparse tables `neutral`, and the two
  partial outage maps `absent`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QiDTE4WvKobVxTDxUeWhc9

FBumann commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

Prompt: "Did you close all the other superseeded prs, if there were any realted to absence, coverage, etc?"

Note

The following content was generated by AI.

Superseded by #810. coverage: total | masked became missing: error | neutral there, with absent and a value beside them, on parameters and relations. Closing.

What #810 took from this PR
  • total is the default, now spelled error, for parameters and for relations with values:. A bare relation takes no missing:.
  • masked is neutral on a parameter and absent on a relation, because a partial map's reading on main is absence.
  • A parameter a piecewise: block reads takes no missing:, the program reports None for it, and the expansion declares it neutral where the curve has points:. The tests are ported.
  • The PyPSA examples are marked by their descriptions, starting from this PR's list.

Generated by Claude Code

@FBumann FBumann closed this Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: data contract What a file guarantees about the data it binds

Projects

None yet

Development

Successfully merging this pull request may close these issues.

a declaration cannot say its table must be complete, so a row lost in preparation reads as a mask

2 participants