Skip to content

Apply seasonal line ratings to s_max_pu without modifying s_nom#1

Draft
MaykThewessen wants to merge 78 commits into
masterfrom
claude/seasonal-ratings-s-nom-t7lypa
Draft

Apply seasonal line ratings to s_max_pu without modifying s_nom#1
MaykThewessen wants to merge 78 commits into
masterfrom
claude/seasonal-ratings-s-nom-t7lypa

Conversation

@MaykThewessen

Copy link
Copy Markdown
Owner

Addresses the review feedback on PyPSA#1694.

What changed

The previous Lines.apply_seasonal_rating set s_nom to the winter envelope (max(summer, winter)) in place and encoded the seasonal variation as a derived ratio. The reviewer's key requirement was:

The important bit is that s_nom is not changed inplace by applying the seasonal ratings. They should only apply the scaling to s_max_pu.

The method now:

  • Treats the summer / winter columns as absolute MVA ratings — the form TSOs actually publish. The JAO / Core flow-based domain files state a maximum permissible current per season and voltage level, which together define an absolute MVA limit for a line. (This also answers the reviewer's question: TSOs report ratings in absolute capacity terms, not per-unit load factors.)
  • Converts those absolute ratings into per-unit factors relative to each line's existing s_nom: s_max_pu = rating(season) / s_nom per snapshot.
  • Never modifies s_nom. It stays the nominal rating the network was built with, so capacity/investment logic is unaffected.
  • Validates that referenced lines have a strictly positive s_nom.
  • Still composes with pre-existing static/dynamic s_max_pu (e.g. N-1 margins) via compose=True.

Other review items addressed

  • Tests reworked around a seasonal_network fixture with parametrized season cases, and renamed to test_seasonal_line_ratings.py. Includes an explicit test_s_nom_never_changes_for_any_input.
  • Docs page simplified: clarifies that inputs are absolute MVA and that s_nom is preserved; dropped the "out of scope" section and trimmed the standards language.
  • Added a release note and an mkdocs nav entry.

Verification

  • pytest test/test_seasonal_line_ratings.py → 17 passed.
  • Method docstring doctest passes.
  • ruff check / ruff format --check clean.

🤖 Generated with Claude Code


Generated by Claude Code

mgrabovsky and others added 30 commits March 4, 2026 10:08
Add params.consistency.numerical_tolerance option (default 1e-9) to suppress false warnings from floating-point rounding in three consistency check comparisons: static power attributes, time-series power limits, and generator energy sums. Simplify tests to four focused test cases.
Co-authored-by: Lukas Trippe <lkstrp@pm.me>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Lukas Trippe <lkstrp@pm.me>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
)

Co-authored-by: Bryn Pickering <17178478+brynpickering@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: lkstrp <lkstrp@pm.me>
Co-authored-by: lkstrp <lkstrp@pm.me>
Co-authored-by: Fabian Hofmann <fab.hof@gmx.de>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Lukas Trippe <lkstrp@pm.me>
FabianHofmann and others added 29 commits June 1, 2026 18:30
Co-authored-by: xueyuan <xueyuan@tode.com>
…tore/Link/Process (PyPSA#1703)

Co-authored-by: lkstrp <lkstrp@pm.me>
Co-authored-by: Fabian Neumann <fabian.neumann@outlook.de>
…yPSA#1687)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Fabian <fab.hof@gmx.de>
Co-authored-by: lkstrp <lkstrp@pm.me>
…Frame kwarg crash (PyPSA#1682)

Co-authored-by: Fabian Hofmann <fab.hof@gmx.de>
Co-authored-by: lkstrp <lkstrp@pm.me>
Co-authored-by: Lukas Trippe <lkstrp@pm.me>
Address review feedback on the seasonal line ratings helper: the
previous version set s_nom to the winter envelope in place and encoded
the seasonal variation as a derived ratio. Per the reviewer, s_nom must
not be changed by applying seasonal ratings.

apply_seasonal_rating now treats the summer/winter columns as absolute
MVA ratings (the form TSOs publish, e.g. JAO/Core flow-based domain
files give a max permissible current per season and voltage level that
together define an absolute MVA limit) and converts them into per-unit
factors relative to the line's existing s_nom: s_max_pu = rating / s_nom
per snapshot. s_nom is left untouched.

- Validate that referenced lines have a strictly positive s_nom.
- Compose with pre-existing static/dynamic s_max_pu (e.g. N-1 margins).
- Rework tests around a fixture with parametrized season cases and rename
  to test_seasonal_line_ratings.py.
- Simplify the docs page, clarify that inputs are absolute MVA and s_nom
  is preserved, and drop the out-of-scope section.
- Add a release note and a nav entry.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L7Eusjq6Ao5w292RBzwtYH
@MaykThewessen MaykThewessen force-pushed the claude/seasonal-ratings-s-nom-t7lypa branch from 5b4bc40 to 9bfd031 Compare June 30, 2026 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.