Repository navigation
Move to powerio 0.12.1 and require Python 3.11 - #157
Merged
Merged
Conversation
Pin powerio[mcp,matrix]>=0.12.1,<0.13 at all 14 sites. Every powerio
release since 0.11.8 requires Python >= 3.11; on main the py3.10 CI job
was silently resolving 0.11.7. With a 0.12.1 floor PowerMCP cannot install
on 3.10 at all, so requires-python becomes >=3.11, the CI matrix tests
3.11 instead of 3.10, and the tomli fallback and dependency go.
Adapt to the 0.12 changes that reach PowerMCP:
- PyPSA: MATPOWER rate 0 now reads as an infinite bound, which the PyPSA
writer states as s_nom 100 with s_max_pu inf (0.11 wrote s_nom 0).
run_contingency_analysis measured loading against s_nom alone, so an
unlimited line reported loading against a placeholder 100 MVA (186% in
the new test). Measure against s_nom * s_max_pu, the bound PyPSA
enforces. overwrite_zero_s_nom now applies only to real zero bounds;
its test uses an Egret numeric-zero rating and a new test pins the
unlimited MATPOWER import.
- IR headers state the writing release ("0.12.1") instead of 2. Drop the
unused IR_VERSION constant; IR is recognised by its schema alone, and a
test keeps 0.11 "version": 2 documents resolving.
- powerio removed its MCP display tool; parse reads a .pwd display as a
GeoLayer. The display tests now exercise parse.
- value_type_name uses the public PioModule.type_name instead of a
private attribute.
- README and docstrings describe 0.12 IR instead of "generation 2".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
Moves PowerMCP to powerio 0.12.1 (
powerio[mcp,matrix]>=0.12.1,<0.13at all 14 pin sites) and adapts to the 0.12 changes that reach PowerMCP.Every powerio release since 0.11.8 requires Python ≥ 3.11. On
main, the py3.10 CI job has been quietly resolving powerio 0.11.7 (see the latest main run). With a 0.12.1 floor PowerMCP can't install on 3.10 at all, so this PR:requires-python = ">=3.11"(root and PSCAD) and drops the 3.10 classifierrequires-pythonfloortomlidependency and the 3.10-onlytomllibfallbacksPython 3.10 reached end of life in October 2026. Because this drops a Python version, the next release should be a minor bump (0.6.0).
Adapting to powerio 0.12
rate 0as an infinite bound. The PyPSA writer now emits that ass_nom=100, s_max_pu=inf; 0.11 wrotes_nom=0.run_contingency_analysisdivided flows bys_nomalone, so unlimited lines were measured against a placeholder 100 MVA, and the new test caught 186% loading on a line with no limit. Loading is now measured againsts_nom * s_max_pu, the bound PyPSA itself enforces. I checked that PyPSA's OPF acceptss_max_pu=inf.overwrite_zero_s_nomnow applies only to real zero bounds, such as an Egret numeric0. Its test uses one. A new test checks that the MATPOWER rate-0 import arrives as unlimited with no warning."0.12.1") rather than2. The unusedIR_VERSIONconstant is removed. IR is recognised by"schema": "pio-ir"alone, and a new test checks that 0.11 documents ("version": 2) still resolve.displaytool removed upstream.parsenow reads.pwdfiles as aGeoLayer, and the three display tests now exerciseparse.value_type_nameuses the now-publicPioModule.type_nameinstead of a private attribute.The MATPOWER, Egret and pandapower writers emit unlimited branches exactly as they did under 0.11, so those adapters need no change.
Test plan
Full CI test list run locally in scratch venvs:
main, py3.12uv pip compileresolves powerio 0.12.1 on 3.11, 3.13 and 3.14F,E9on the changed files reports the same 4 warnings asmain, none new🤖 Generated with Claude Code