Skip to content

docs(pypsa): a start-up or shut-down cost may change from snapshot to snapshot, as in pypsa master - #807

Open
FabianHofmann wants to merge 7 commits into
docs/pypsa-fixed-modularfrom
docs/pypsa-startup-cost-snapshot
Open

FabianHofmann wants to merge 7 commits into
docs/pypsa-fixed-modularfrom
docs/pypsa-startup-cost-snapshot

Conversation

@FabianHofmann

Copy link
Copy Markdown
Contributor

Prompt: "2" (run steps 1 to 3 of the PyPSA-parity plan as one workflow)

Note

The following content was generated by AI.

The six start-up and shut-down cost parameters span snapshot, as on PyPSA master (PyPSA/PyPSA#1909). The relaxed file tightens only where both costs are equal in every snapshot, now stated in the language. Rung 62 records it.

Stacks on #787 and #786. Part of #783 (step 3b, "Start-up and shut-down cost per snapshot").

Method, gate output, alternatives

What changed

  • examples/pypsa.yaml: {Generator,Link,Process}_{start_up,shut_down}_cost go from [scenario, c] to [scenario, snapshot, c]. PyPSA reads the cost at the snapshot of the start or stop (optimize.py:424-432 on 02bdcbba). The objective terms already summed over snapshot, so they do not change.
  • The objective still adds these costs without a snapshot or period weight. PyPSA does the same; the spec copies it, as it does since rung 48. This is the not-filed bug candidate in PyPSA parity with master: open points, new master changes and the PyPSA bugs found #783.
  • examples/pypsa_linearized_uc.yaml: the Generator pair spans [snapshot, generator]. The data-prep bool Generator_partly_tightened is gone. The four tightening rows now carry count(Generator_start_up_cost != Generator_shut_down_cost, over=snapshot) == 0 in their where. That is PyPSA's (start_up_cost == shut_down_cost).all("snapshot") (constraints.py:636-641). The old description said two parameters cannot be compared in a where; the language now allows expression OP expression, so no data prep and no src/ change is needed. A where names no entry, so the condition is written in each of the four rows.
  • tests/fixtures/pypsa_standard_shape.yaml: the standard frame of the six parameters gains snapshot, as rungs 45 and 60 did for their parameters.
  • Rung 62 (rung_62_startup_cost_per_snapshot.py) and its record. Regenerated: fragments, gallery. Golden and schema regenerated with no diff.

Rung 62

A committable peaker that the load needs in snapshots 3 and 4. A start costs [400, 100, 900, 900, 900], a stop [300, 300, 300, 300, 0]; snapshot weights [2.0, 1.5, 1.0, 2.0, 1.0]. PyPSA master solves to 6850.0 (starts at snapshot 2, stops at snapshot 5). Probes on the same network:

change objective
start-up cost at its mean 640 7090.0
shut-down cost at its mean 240 7050.0
start-up cost times the snapshot weight 6900.0

Failing first: on pypsa==1.3.0 the rung's build() raises AttributeError: start_up_cost at n.generators_t.start_up_cost, since the attribute is static only there.

Gates

  • uv run --script examples/references/pypsa/reference.py then --check: "every rung solves to its record". Only rung_62 is new in references.json.
  • pixi run lint: pass. pixi run ci: pass, 2609 tests, docs-build, compile-tex.
  • The first pixi run ci failed test_a_standard_parameter_changes_frame_only_by_a_leading_scenario on the six new frames, before the fixture change.

Not done

@read-the-docs-community

read-the-docs-community Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

FBumann and others added 5 commits October 1, 2026 13:47
…ven expression, not as a variable (#809)

* fix(language): a where that reads a given expression names it as a given expression, not as a variable

The namespace files a given expression with the variables, because it is
read as a column. A where that read one was refused as if it read a
variable. The three refusals (the left name, the right name, a side of a
comparison of expressions) now name the given expression and say why a
mask may not read it: it may hold a variable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PBmqeqBrqpQC6MVoSrguHK

* docs: the changelog line links #809

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PBmqeqBrqpQC6MVoSrguHK

---------

Co-authored-by: Claude <noreply@anthropic.com>
@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