Skip to content

docs(pypsa): the pypsa line references point at pypsa master - #806

Merged
FabianHofmann merged 19 commits into
mainfrom
docs/pypsa-cites-02bdcbba
Oct 2, 2026
Merged

FabianHofmann merged 19 commits into
mainfrom
docs/pypsa-cites-02bdcbba

Conversation

@FabianHofmann

@FabianHofmann FabianHofmann commented Oct 1, 2026 •

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.

Every PyPSA line cite in pypsa.yaml, pypsa_linearized_uc.yaml and the hand-written parts of docs/examples/pypsa*.md now points at PyPSA master 02bdcbba. Five cites that were already wrong on 1.3.0 are fixed.

Stacks on #787 and #786. Part of #783 (step 2, "Re-anchor every PyPSA line cite").

Method, gate output, alternatives

Method. A script scanned every cite (file.py:N, file.py:N-M, and the bare `:N` or `N-M` that follows one) in examples/pypsa.yaml, examples/pypsa_linearized_uc.yaml, and docs/examples/pypsa.md and docs/examples/pypsa_linearized_uc.md outside their reference: and gallery: blocks. No other hand-written file under docs/ or examples/ cites PyPSA lines. For each cite it mapped the 1.3.0 line to 02bdcbba with difflib over the two versions of the file, and refused any cite that falls in a changed hunk. Each mapped line has the same text as the old one. Then I read each cite's 1.3.0 code against the sentence that cites it. 98 cites changed. The fragments and gallery pages are regenerated (tools.pypsa_split split examples/pypsa, tools.gallery), not edited.

The shift table in #783 is right for constraints.py and optimize.py. One correction: networks.py moves +2 after line 1250. The cycle-basis cite is now networks.py:1356-1363.

Cites that were already wrong on 1.3.0, fixed here:

was now (02bdcbba) why
components/array.py:332-395 :332-386 the file has 386 lines; _as_xarray ends at 386
constraints.py:2411 (Refusals) :2522 2411 is inside the message; the raise ValueError is two lines on
constraints.py:2518 (Refusals) :2629 same, second loss function
constraints.py:2561 (Refusals) :2669 2561 is blank; the raise RuntimeError is one line up
constraints.py:2545 (secant breakpoints step) :2661-2666 2545 is a comment; the step max(k/(k-1), …) is the loop

Checked by running PyPSA 02bdcbba on rungs 55-58 and reading the last PyPSA frame of each traceback: constraints.py:1660 (55, KeyError), abstract.py:427 (56, ValueError), constraints.py:1817 (57, TypeError), constraints.py:1981 (58, KeyError). The spec cites match these. #783 itself cites constraints.py:1820 for #1942 and constraints.py:556 for #1913; the tracebacks give 1817 and 1981. I did not edit #783.

Prose. The two sentences that said the line numbers are still 1.3.0 (intro and Refusals) are gone. The Refusals sentence now says line numbers and records are from master at 02bdcbba.

Gates. pixi run lint and pixi run ci pass (2604 tests, docs build, 55 TeX documents). I did not run reference.py --check: no rung or record changed.

Not done. No test: a cite checker would need a PyPSA checkout in the suite, and the task said not to invent one. The cites in #783 are not touched. No box in #783 is ticked.

@FabianHofmann
FabianHofmann force-pushed the docs/pypsa-fixed-modular branch from df7f835 to 34af2a0 Compare October 2, 2026 09:06
@FabianHofmann
FabianHofmann changed the base branch from docs/pypsa-fixed-modular to main October 2, 2026 09:11
…cbba

# Conflicts:
#	CHANGELOG.md
#	docs/examples/pypsa.md
#	docs/examples/pypsa/link.md
@FabianHofmann
FabianHofmann merged commit 3b5ac57 into main Oct 2, 2026
5 checks passed
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