Repository navigation
fix(psse): start PSS/E at its default bus size, not 50 buses (release 0.5.1) - #154
Merged
Merged
Conversation
The server called psseinit(50), believing 50 was a "PSS/E 35+ bus mode". It is the requested bus capacity (50 is PSS/E Xplore's limit), so the engine started at PSS/E's 1,000-bus minimum. psspy.case() grows the size on its own, but a RAW read into that engine silently drops every bus past 1,000 while returning ierr=0 (bench.raw: 1,000 of 1,648 buses). The size cannot be fixed afterwards: a second psseinit() is ignored and bus_size_level() does not grow working memory. psseinit(0) now asks PSS/E for its default size level, the bus size set in the PSS/E GUI (50,000 unless changed). A larger size can be set with the new optional psse.bus_size config key or POWERMCP_PSSE_BUS_SIZE; a value that is not a whole number is refused before the engine starts. Verified on PSS/E 36.2.1: bench.raw loads all 1,648 buses, bench2.sav (7,917 buses) opens and solves, and psse.bus_size=150000 gives 150,000. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
The PSS/E server called
psspy.psseinit(50), under a comment calling 50 a "PSS/E 35+ bus mode; do NOT change". The argument is actually the requested bus capacity; 50 is the bus limit of the free PSS/E Xplore edition. On a full PSS/E 36.2 the engine therefore starts at PSS/E's 1,000-bus minimum.psspy.case()grows the engine by itself, so opening a.savhides the problem. A RAW read does not: on PSS/E 36.2.1,psspy.read(0, "bench.raw")loads 1,000 of 1,648 buses and still returnsierr=0, logging only "Area slack bus … not found" errors along the way.It can't be corrected after startup either. A second
psseinit(50000)is ignored, andbus_size_level(50000)reports 50,000 while the RAW read still stops at 1,000. So an agent "resizing" throughrun_psspy_commandbelieves it succeeded and keeps working on a truncated case.bench.rawpsseinit(50)(0.5.0)ierr=0psseinit(50)bus_size_level(50000)psseinit(50)psseinit(50000)psseinit(0)(this PR)Fix
psseinit(0)asks PSS/E for its default size level, the bus size set in the PSS/E GUI (50,000 unless changed), so the server matches the GUI.psse.bus_sizeconfig key (powermcp config set psse.bus_size 150000) andPOWERMCP_PSSE_BUS_SIZEoverride for cases larger than that. A value that isn't a whole number is refused with an actionable error before the engine starts.psse.bus_size.pyproject.toml,powermcp/__init__.py, registry test).Verification
tests/test_psse_server.pycover the default (psseinit(0)), config, env-over-config, and invalid values.tests/test_vendor_import.pyused to assertpsseinit(50); it now asserts0.bench.rawloads all 1,648 buses,bench2.sav(7,917 buses) opens and solves, andpsse.bus_size=150000gives a 150,000-bus engine. A server launched over stdio exactly as MCP clients launch it reports a 50,000 size level.test_doctor×2,test_powerio_server::test_registry_entry,test_runner::test_preflight_missing_pip_dep_raises) fail identically onmainon this machine and are environment-specific. The ANDES tests were excluded locally because they hang on this machine. Neither is related to this change.🤖 Generated with Claude Code