docs(pypsa): a line, a transformer, a storage unit and a store may be built in whole modules, and a unit that is not active counts no modules - #815
Merged
Conversation
…e commitment rows, as in pypsa master
# Conflicts: # CHANGELOG.md
# Conflicts: # CHANGELOG.md
# Conflicts: # CHANGELOG.md
… built in whole modules, and a unit that is not active counts no modules
Documentation build overview
16 files changed ·
|
# Conflicts: # CHANGELOG.md
…ocs/pypsa-modular-builds
FabianHofmann
force-pushed
the
docs/pypsa-fixed-modular
branch
from
October 2, 2026 09:06
df7f835 to
34af2a0
Compare
…ilds # Conflicts: # CHANGELOG.md # docs/examples/pypsa.md # docs/examples/pypsa/index.md # docs/examples/pypsa/link.md # examples/references/pypsa/references.json # tests/test_pypsa_references.py
FBumann
pushed a commit
that referenced
this pull request
Oct 2, 2026
…tum8xc #808 and #815 add six sparse tables, marked missing: neutral: Line_v_ang_max and Transformer_v_ang_max (no row by default), and the module sizes of a storage unit, a store, a line and a transformer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QiDTE4WvKobVxTDxUeWhc9
15 of 44 tasks
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.
examples/pypsa.yamlnow states{c}-n_modand the modularity row for Line, Transformer, StorageUnit and Store, and builds both, for all seven components, only for a unit that stands in at least one snapshot. Rung 63 records it.Part of #783 (step 4, group 1: modular builds). Stacks on #787, which stacks on #786.
Method, gate output, PyPSA cites, what is not done
What changed
Line_s_nom_mod,Transformer_s_nom_mod,StorageUnit_p_nom_mod,Store_e_nom_mod, over the component only (PyPSA refuses a module size that differs by scenario,consistency.py:1183-1185).Line_n_mod,Transformer_n_mod,StorageUnit_n_mod,Store_n_mod; rowsLine_s_nom_modularity,Transformer_s_nom_modularity,StorageUnit_p_nom_modularity,Store_e_nom_modularity. Symbols inexamples/symbols/pypsa.yaml.{c}_n_modand{c}_{attr}_modularityblocks takecount({c}_active, over=snapshot) > 0in theirwhere.rung_63_modular_branches_and_storage.py), its section indocs/examples/pypsa.md, and the rung 8 row note.test_a_modular_build_counts_modules_only_where_the_unit_stands, parametrized over the seven components. On the parent tree all 7 cases fail (KeyErrorfor the four new components, the oldwherefor Generator, Link and Process); on this branch all 7 pass.tools.pypsa_splitandtools.gallery, not edited by hand.PyPSA cites (master
02bdcbba)variables.py:363-384:define_modular_variables,mod_i = c.extendables ∩ c.modulars ∩ c.active_assetsat:379.constraints.py:1824-1882:define_modular_constraints, the same index at:1864, row{c}-{attr}_modularityat:1880-1882.optimize.py:801-804and:830-834: both are called for every(component, attr)in thenominallookup.components/descriptors.py:151-169:active_assetsis the staticactiveflag, true in any scenario. It does not read build year or lifetime (get_active_assetswith no period,:133-134).Rung 63
The spine plus an east bus fed over a modular line (
s_nom_mod=25) and a modular transformer (s_nom_mod=15), with a modular storage unit (p_nom_mod=15) and store (e_nom_mod=40). A modular extendable generator, link and process stand beside them withactive=False. PyPSA buildsn_modand the modularity row for the four active components only, and none for the three inactive ones. PyPSA solves to13927.0, 108 rows. With one module size set to zero at a time, PyPSA solves to: line13882.0, transformer13921.0, storage unit13877.0, store13873.0. So each module binds.Gates
pixi run python -m tools.pypsa_split split examples/pypsa && pixi run python -m tools.gallery: regenerated.uv run --script examples/references/pypsa/reference.py: only rung 63 was added toreferences.json; no other record changed.--check:every rung solves to its record.pixi run lint: passes.pixi run ci: exit 0,2633 passed, docs buildNo issues found,compiled 55 document(s).Departures and what is not done
active_assetsas "stands in at least one snapshot", and not as PyPSA's static flag. They differ only for a unit withactive=Truewhose build year and lifetime miss every period. PyPSA buildsn_modand the row for that unit, and nothing else reads them. The file has no staticactiveparameter, and this PR adds none.{c}_{attr}_extkeeps noactiverestriction. PyPSA builds no{c}-{attr}column for a unit that is not active (variables.py:354). The file still declares it, priced at zero by{c}_capital_weight. That is the data-prep note in PyPSA parity with master: open points, new master changes and the PyPSA bugs found #783, not this group.#815beside the rung 63 numbers came in a follow-up commit, after the PR number was known.