Skip to content

docs(pypsa): a fixed modular committable unit gets only its per-module commitment rows, as in pypsa master - #787

Open
FabianHofmann wants to merge 6 commits into
docs/pypsa-masterfrom
docs/pypsa-fixed-modular
Open

FabianHofmann wants to merge 6 commits into
docs/pypsa-masterfrom
docs/pypsa-fixed-modular

Conversation

@FabianHofmann

@FabianHofmann FabianHofmann commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Prompt: "note acutally that the target of the math-spec implementation should be the master and not 1.3.0"

Prompt: "Re-pin first, stack F2"

Prompt: "1" (replace the eval in the test with the repo's own parser)

Note

The following content was generated by AI.

A fixed modular committable Generator, Link or Process no longer gets com-p-lower/upper or maint-status-* rows. It gets only com-mod-p-* and maint-modstatus-*, as PyPSA master builds since PyPSA/PyPSA#1901. Part of #783, stacked on #786.

Method, gate output, alternatives

PyPSA master

constraints.py:302-303 on 02bdcbba:

com_ext_i = com_i.intersection(ext_i).difference(c.modulars)
com_fix_i = com_i.difference(ext_i).difference(c.modulars)

com_fix_i selects com-p-lower/upper and maint-status-le-status/-le-maint/-lb (:421-476). com_mod_i selects com-mod-p-* and maint-modstatus-* for every modular unit, fixed or extendable (:480-551). The only other reader of com_fix_i is the linearized tightening (:654). pypsa_linearized_uc.yaml declares no p_nom_mod, so no modular unit is on its surface, and it needs no change. The ramp rows keep their own is_com_fix (:1041-1044), which still includes a fixed modular unit; that is the separate "N times too loose" item in #783.

Change

  • examples/pypsa.yaml: the 15 blocks {Generator,Link,Process}_{com_p_lower,com_p_upper,maint_status_le_status,maint_status_le_maint,maint_status_lb} add AND NOT ({c}_p_nom_mod > 0) to their where:.
  • docs/examples/pypsa.md: three index notes (rung 7 com-p-*, rung 8 com-mod-p-*, the maintenance row) now say that a modular build takes the per-module rows in place of the whole-unit ones.
  • Regenerated: the fragments (tools.pypsa_split split examples/pypsa), the gallery pages, the golden typesetter output and the schema (the last two did not change).

Reproduced first

test_a_fixed_modular_committable_unit_gets_only_its_per_module_commitment_rows reads the four row families of each component from to_spec(pypsa.yaml).program, so the loader parses and resolves each where:. It decides each resolved mask for a fixed, modular, maintainable, committable unit with mathspec.exclusivity._evaluate, the evaluator the exclusivity check runs on one cell. A predicate on a parameter the unit does not set raises KeyError; a node the evaluator cannot decide raises AssertionError. The repository has no engine, so no test counts the spec's rows per rung.

On the tree before the fix (pypsa.yaml from the base branch) it fails for all three components, with com_p_lower, com_p_upper and maint_status_* as extra items: 3 failed. With the fix: 3 passed.

Records

Unchanged here. #786 re-recorded rungs 8, 25 and 26 against master, which dropped these rows; this PR makes the file match those records.

Gates

  • pixi run lint: pass. pixi run ci: pass, 2604 tests, on the head with the evaluator, after the merge of the updated base branch at e4f919bb.
  • uv run --script examples/references/pypsa/reference.py --check: "every rung solves to its record".

Not done

@read-the-docs-community

read-the-docs-community Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

@FBumann
FBumann added this pull request to stack #789 September 29, 2026 14:37

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation pages, guides, reference and README

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants