Conversation
…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
Documentation build overview
57 files changed ·
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q8Y8AoPsJCyMsURHvgzm7h
This was referenced 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
Contributor
Author
Note The following content was generated by AI. Superseded by #810. What #810 took from this PR
Generated by Claude Code |
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.
Replaces #245, whose branch shares no history with
main. Closes #296.parameters:andrelations:takecoverage: total | masked, defaulttotal. The expansion now declares a curve's tablesmaskedwhere the curve haspoints:.What was ported, what is new, gates
Ported from #245
Coverage = Literal['total', 'masked'], now onmath_spec.programwith the other vocabularies.ParameterDeclaration.coverageisCoverage | None, andRelationDeclaration.coverageisCoverage.ParameterBlockandRelationBlockshare_CoveredBlock: the field isCoverage | None = None, andcoverage_or_defaultgives the reading. The schema is regenerated:coverageisanyOf [enum, null]on both.coverage:on a parameter apiecewise:block consumes (either spelling) is one more rule invalidation.reference_errors.PiecewiseBlock.consumesis the one list the refusal and lowering read.Nonefor a parameter a block consumes, and the file's reading for every other parameter and relation.pypsa_losses.yaml'sLine_cycle_weight, which has the same description ("a line in no cycle has no row"), is marked too.absence.mdanddeclarations.mdas in feat(language): a parameter and a lookup each say whether their data must be complete, so a row lost in preparation is not read as a mask #245. The relation rows feat(language): a parameter and a lookup each say whether their data must be complete, so a row lost in preparation is not read as a mask #245 wrote ondimensions.mdare now onrelations.md, wheremaindocuments relations; its "A partial map is the rows it has" becomes themaskedreading, beside thetotalrule. The reading page tells a binder what eachcoverageasks of it.Changed from #245
main's spelling. A relation iskey:/values:, andtotalis a row for every key coordinate.<block>_pointsmask it emitted.mainemits no parameter, so the exempt set is exactly what the block consumes.main, a consumer building rows reads the program ofspec.expand(...), where no block is left. Left alone, that program would reporttotalfor a curve's tables, and a binder would refuse the ragged curve the block admits. That is the failure feat(language): a parameter and a lookup each say whether their data must be complete, so a row lost in preparation is not read as a mask #245's third review fixed, reached through the expansion instead. Soexpand_piecewisedeclarescoverage: maskedon a parameter consumed only by curves withpoints:. Their weights carrywhere: <points>, thelprows sit on masks built from it, and the<block>_completeassumption states where a row is required. A parameter read by a curve over every breakpoint staystotal. The twotests/expand/*-points/after.yamlfiles carry the new line.test_an_expansion_declares_exactly_the_parameters_the_file_declarednow compares names, dims and dtype, which is what "the same data binds both" needs.Guards, each deleted in turn on this head
Nonefor a curve parametermaskedEvery new test was run on unported
mainfirst 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.pytest -n 4ruff check,ruff format --checkpyrefly checktools.schema --check, golden regeneration, every generated pagemkdocs build --strictdocs.python.org/3/objects.inv, so the build ran from a scratch copy ofmkdocs.ymlwithout that one inventory line.prettier --check docsBoth new YAML fences load, and read back
maskedwhere they write it.Docs sentences, after (before):
absence.mdn 34, avg 13.5, median 12, over 25 words 2 (32, 13.2, 12, 2);declarations.mdn 43, avg 13.9, median 12, over 25 words 5 (30, 10.7, 10, 1);relations.mdn 42, avg 16.4, median 15, over 25 words 7 (39, 15.9, 15, 5);piecewise.mdn 72, avg 17.5, median 16, over 25 words 12 (71, 17.5, 15, 12);reading.mdn 84, avg 16.3, median 15, over 25 words 13 (80, 16.2, 15, 13). Four ofdeclarations.md's five are the script joining a bold lead-in to the sentence after it.Not run:
compile-tex. No typeset output changed, becausecoverageis not printed, as #245 decided.Not done
points:towhere:. Whichever of the two lands second moves the refusal's wording,consumesand the expander'spointstest to the new key.🤖 Generated with Claude Code
https://claude.ai/code/session_01GpnFcQDuvt2bExGngb6MYk
Generated by Claude Code