Skip to content

docs(pypsa): the pypsa page lists seven more refusals and eight data-prep steps, and a capital cost says where fom_cost and overnight_cost enter - #816

Open
FabianHofmann wants to merge 2 commits into
docs/pypsa-fixed-modularfrom
docs/pypsa-parity-notes
Open

FabianHofmann wants to merge 2 commits into
docs/pypsa-fixed-modularfrom
docs/pypsa-parity-notes

Conversation

@FabianHofmann

@FabianHofmann FabianHofmann commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Prompt: Continue PyPSA parity for energy-models/mathspec: implement step 4 of the plan in tracking issue #783. Step 4 covers the parity items the language can already state. Run it as an ultracode workflow with at most 4 agents, one PR per group.

Note

The following content was generated by AI.

The PyPSA page now has seven more Refusals rows and a Data prep section with eight steps. Each capital cost says how fom_cost and overnight_cost enter, and the transmission cost limit reads the cost without fom_cost. No math changes.

Stacks on #787, which stacks on #786. Part of #783 (step 4, group 4: docs only).

Method, gate output, PyPSA cites, what is not done

Method. I re-read each #783 claim on PyPSA master 02bdcbba before I wrote it down. Line numbers in the new text are on 02bdcbba.

fom_cost and overnight_cost. The seven *_capital_cost descriptions in examples/pypsa.yaml said "periodized as an annuity in data prep". That is wrong when overnight_cost is absent. They now give PyPSA's periodized_cost: overnight_cost as an annuity times nyears where it is given, capital_cost where it is not, plus fom_cost (components.py:1126-1147, costs.py:102-203, read by the objective at optimize.py:222, :406). Line_expansion_cost_weight and Link_expansion_cost_weight now say the limit reads the capital_cost property, without fom_cost (components.py:1151-1169, global_constraints.py:935). The rung 3 and rung 5 index rows say the same in short form. period_weight_objective now says that data prep feeds one without multi_investment_periods (optimize.py:205-207, :264-266).

Refusals, seven rows.

PyPSA claim checked
consistency.py:231-283 a warning, ConsistencyError only under strict (_log_or_raise, :45-49). The file builds the same: min > max keeps the fixed shift, and an infinite bound leaves the shift free
constraints.py:1819-1820 {c}-p_nom exists only for extendable, active units (variables.py:354-360), so .sel raises KeyError
constraints.py:2772, :2781 Generator-p spans only active_assets (variables.py:44-46), so e_sum_min or e_sum_max on an inactive unit raises KeyError. The file builds 0 >= e_sum_min
constraints.py:1558-1563 Empty LHS with non-zero RHS where every term of a loaded bus is masked in a snapshot
components/descriptors.py:141-144 get_active_assets(period) raises for a period outside n.investment_periods. Reached from global_constraints.py:88 and the transmission limits
constraints.py:1146-1148, :1153-1158 with another committable fixed unit, a non-committable unit that came in off and has only a shut-down ramp gets p >= (shut - 1) * p_nom at the first snapshot. The file gives p >= -p_nom. This binds only for a unit that can run below zero
constraints.py:120-125 0 * inf is set to 0 for a fixed build of inf

Data prep, eight steps. These are typed branches (network/power_flow.py:441-564) and the carrier fill from bus0 (:780-782, :831-837). Then the KVL weights x_pu_eff and r_pu_eff (networks.py:1360-1365), and bus0 for branches, Link and Process in tech_capacity_expansion_limit (global_constraints.py:93). Then the period weight on a plain run, and storage in primary_energy: only cyclic_state_of_charge / e_cyclic exclude a unit (global_constraints.py:436, :490), and operational_limit also reads active (:636, :687). Last, no capacity variable for active = False (variables.py:354-360), and no row for an empty global constraint (global_constraints.py:98-99, :538-539, :730-731, :844-845, :939-940).

Gates.

  • pixi run python -m tools.pypsa_split split examples/pypsa and pixi run python -m tools.gallery: fragments and pages regenerated, not edited.
  • uv run --script examples/references/pypsa/reference.py --check: every rung solves to its record.
  • pixi run lint: pass.
  • pixi run ci: 2621 passed, docs build with no issues, 55 TeX documents compiled.
  • New Data prep section: 20 sentences, median 19 words, 4 over 25.

Not run. reference.py without --check: no rung is new or changed, so there is nothing to record.

Not done.

…prep steps, and a capital cost says where fom_cost and overnight_cost enter

Data prep section: n 20, median 19, over25 4.
@FBumann FBumann added the docs Documentation pages, guides, reference and README label Oct 1, 2026

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