Skip to content

Move to powerio 0.12.1 and require Python 3.11 - #157

Merged
qian-harvard merged 1 commit into
mainfrom
deps/powerio-0.12
Nov 21, 2026
Merged

qian-harvard merged 1 commit into
mainfrom
deps/powerio-0.12

Conversation

@qian-harvard

Copy link
Copy Markdown
Contributor

Summary

Moves PowerMCP to powerio 0.12.1 (powerio[mcp,matrix]>=0.12.1,<0.13 at all 14 pin sites) and adapts to the 0.12 changes that reach PowerMCP.

⚠️ Drops Python 3.10

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:

  • sets requires-python = ">=3.11" (root and PSCAD) and drops the 3.10 classifier
  • changes the CI matrix from 3.10 to 3.11, which stays the requires-python floor
  • removes the tomli dependency and the 3.10-only tomllib fallbacks
  • updates the README badge, install guides and per-server READMEs

Python 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

  • PyPSA loading (behaviour fix). 0.12 reads MATPOWER rate 0 as an infinite bound. The PyPSA writer now emits that as s_nom=100, s_max_pu=inf; 0.11 wrote s_nom=0. run_contingency_analysis divided flows by s_nom alone, 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 against s_nom * s_max_pu, the bound PyPSA itself enforces. I checked that PyPSA's OPF accepts s_max_pu=inf.
  • overwrite_zero_s_nom now applies only to real zero bounds, such as an Egret numeric 0. Its test uses one. A new test checks that the MATPOWER rate-0 import arrives as unlimited with no warning.
  • IR header version is now the writing release ("0.12.1") rather than 2. The unused IR_VERSION constant is removed. IR is recognised by "schema": "pio-ir" alone, and a new test checks that 0.11 documents ("version": 2) still resolve.
  • display tool removed upstream. parse now reads .pwd files as a GeoLayer, and the three display tests now exercise parse.
  • value_type_name uses the now-public PioModule.type_name instead of a private attribute.
  • README and docstrings describe 0.12 IR instead of "generation 2".

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:

Env powerio Result
main, py3.12 0.11.12 772 passed, 23 skipped
this branch, py3.12 0.12.1 775 passed, 23 skipped
this branch, py3.11 0.12.1 767 passed, 24 skipped (surge needs ≥3.12)
  • uv pip compile resolves powerio 0.12.1 on 3.11, 3.13 and 3.14
  • ruff F,E9 on the changed files reports the same 4 warnings as main, none new
  • CI matrix (3.11–3.14) green

🤖 Generated with Claude Code

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>
@qian-harvard
qian-harvard merged commit 86f5d7f into main Nov 21, 2026
5 checks passed
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.

1 participant