Repository navigation
feat(language)!: a missing row is refused only where the model reads it, and a file names its value instead of neutral - #881
Merged
Conversation
… `missing: neutral` is gone `neutral` read a missing row as 0 or false, named for an intent that holds only where the parameter is an additive term. Elsewhere it read 0 anyway: a whole term dropped, an exponent gave 1, an offset read the coordinate itself. Write the value instead: `missing: 0` or `missing: false`. A variable takes `missing: 0` for "zero outside the mask". A parameter named `missing: 0` that stands as a divisor is refused at load. absence.md states what each reading does at each position, amounts included: under `absent`, a missing offset or window makes the operator absent there. The PyPSA module sizes `*_nom_mod` keep the default `refused`: every arithmetic read sits inside a `> 0` mask, and the divisor refusal caught them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvtZGymCbY9swLnR8JwHng
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvtZGymCbY9swLnR8JwHng
Documentation build overview
32 files changed ·
|
FBumann
added this pull request to stack #882
October 15, 2026 09:58
…ide its mask `missing:` on a variable took `absent` or `0`. It now takes any finite number, refused at load where the number leaves the variable's domain or its literal bounds. The absence table states a constant once, on either side of a comparison, and the zero-divisor refusal ignores a `false`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvtZGymCbY9swLnR8JwHng
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvtZGymCbY9swLnR8JwHng
missing: neutral is goneneutral
Contributor
Author
Note The following content was generated by AI. Closed in favour of #880. GitHub refused to move this PR's base off its stack, so #880's branch was fast-forwarded to carry every commit of this PR. The earlier comment on #880, which pointed here, is out of date. 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.
missing: refusednow refuses a row only where the model reads the value, and awherereads nothing.neutralis gone: a file writes the value, such as0orfalse. A masked variable may stand as any finite number. absence.md states the contract position by position.This PR replaces #880.
Contract: where a parameter is read
absence.md has a new section, Where a parameter is read. The model reads a parameter at these coordinates: a row it builds, a summand that exists, a bound of a variable that exists, an
offset=/window=amount, the objective, a reported expression, and the breakpoints of a curve. A row that an absent term removes reads nothing.A
wherereads nothing. A bare name tests whether the row is there, and a comparison at a missing row is false unlessmissing:names a value. With no short-circuit, a mask that reads would make the guardwhere: cost AND cost > 0refuse the rows it is there to skip.Two load refusals relied on "a row at every coordinate", so they are removed:
int/strname in awhereunderrefused;points:declaredrefused. The curve reads no row past its mask.Readings: refused, absent, or a value
neutralread a missing row as0orfalse. It was named for "contributes nothing", which holds only for an additive term. As a factor it dropped the whole term. As an exponent it gave1. As anoffset=it read the coordinate itself. Its three refusals (divisor, bound, constant side) are now whatrefuseddoes.refused,absentor a value.'neutral'gets the closed-vocabulary error, which names the valid readings.offset=/window=amount,wherecomparison, bare name) and one column per reading. Underabsent, a missing amount makes theshift/sum_backabsent there.missing: 0that stands alone as a divisor is refused at load.absentor any finite number. It needs awhere:, and the number must fit the variable:0/1forbinary, an integer forinteger, and inside any literal bound. A parameter bound is data, so it is not checked. A curve gate is binary, so it takes0(no curve) or1(ungated, which is also whatabsentgives).One reading changes: a
wherecomparison. Underneutral, a comparison at a missing row was false. A value compares as itself, socost < 1becomes true at a missing row undermissing: 0. Every comparison on a migrated parameter inexamples/is> 0, which is false both ways. To keep the old reading, writewhere: cost AND cost < 1.Migration.
examples/,tests/expand/and the golden fixture use0forfloat/intandfalseforbool. The divisor refusal caught the PyPSA module sizes:Generator_p_nom_moddivides in*_maint_modstatus_*. Every arithmetic read of the seven*_nom_modparameters sits inside a*_nom_mod > 0mask, so they keep the defaultrefused. Regenerated: the schema, the golden output, the gallery and notation pages.Verification
Mutation table. Each guard was deleted by hand, the suite was run, the file was restored through
git checkout --with__pycache__dropped on both sides, and the tree came back clean each time._zero_divisor(never refuse)test_a_divisor_that_reads_a_missing_row_as_zero_is_refused[a-constraint],[a-named-expression]…_outside_what_the_variable_takes_is_refused[binary]…[integer]…[below-lower]…[above-upper]test_a_variable_missing_that_reads_data_is_refused[a-flag],[an-infinity]isinstance(declared.missing, bool)in_zero_divisorfalseon a numeric parameter is refused, and aboolparameter cannot be a divisor. It is kept on review request, so thatFalse == 0can never read as a zero divisorLoading cases cover over-reach: another value as divisor,
0as a factor,0inside a compound divisor, and a variable number on a continuous variable, abinaryvariable, anintegervariable, a literal bound, and a parameter bound.Coverage moved.
neutralcases became0/falsecases.an-int-under-neutral,neutral-on-a-labeland theneutralexclusivity reading are removed, and their value counterparts stay. The bare-name refusal cases became loading cases.…_under_points_is_not_refusedbecame…_may_be_refused.Gates.
pixi run lintandpixi run testpass (2863 passed, 1 skipped).docs-buildstops only on the strict warning forpathlib.Path, because the container's proxy blocksdocs.python.org.compile-texwas not run.Not done
refusedstill checks every key combination when the data is attached.missing: <parameter>on a variable. A named expression withcases:already says "the variable where the mask holds, the data elsewhere".neutral. They are history.🤖 Generated with Claude Code
https://claude.ai/code/session_01AvtZGymCbY9swLnR8JwHng