Skip to content

Remove PM parser - #230

Merged
jd-lara merged 7 commits into
psy6from
ac/no-power-models
Sep 24, 2026
Merged

jd-lara merged 7 commits into
psy6from
ac/no-power-models

Conversation

@acostarelli

Copy link
Copy Markdown
Member

No description provided.

Anthony Costarelli and others added 7 commits September 23, 2026 15:37
The OpenAPI document has no system base, so from_openapi defaulted every
PSS/E and Matpower case to 100 MVA. make_system also validated the built
System unless runchecks=false; system_from_openapi now does the same.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…enapi

Every switched builder produces the same System as make_system did,
component for component, when built both ways. build_psse_ACTIVSg2000_sys
also stops splatting its kwargs positionally.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PowerFlowFileParser's readers call the branch, three-winding and HVDC name
formatters with bus names rather than ACBus objects, so the formatters now
take strings. The VSC formatter is registered under vsc_line_name_formatter,
the key both parsers read; under vscline_name_formatter it was never applied.
solved_case is taken explicitly so it reaches PowerModelsData.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PowerFlowFileParser rejects data make_system skipped silently: the TNEP
cases' ne_branch candidate branches and RTS_GMLC.m's storage unit in the gen
table. Both are dropped by exact match before conversion, so every Matpower
fixture builds the System it did before. case5_strg's storage units are now
named storage-1/storage-2, PowerFlowFileParser's naming, instead of 1/2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The inverted-band test now builds frankenstein_70.raw, whose T1 carries the
inverted VMA1/VMI1, plus a copy with RMA1/RMI1 swapped, instead of calling
make_system's control-field helper directly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every PSS/E and Matpower case now goes PowerFlowFileParser -> OpenAPI
document -> PowerSystems, so make_system, system_via_power_models, the
generator mapping they read, and the fuel/prime-mover helpers only they used
are deleted. PSSE_DYR_MAPPING_FILE moves next to the .dyr parser, its one
reader; Unicode was only imported for those helpers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Fix the stale-fixture helper’s absent-section failure and overly broad deletion behavior.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity

Open (1)
What changed in this PR

Removes the legacy PowerModels parser and migrates PSS/E and Matpower construction to the OpenAPI pipeline.

Changes:

  • Removes obsolete parser code, helpers, mappings, and dependency.
  • Updates builders, metadata reimport, fixtures, and parser tests.
  • Adds handling for known stale Matpower fixture data.
File Summary Findings
test/​test_transformer_parsing.jl Updates transformer parsing tests. —
test/​test_switched_shunt_parsing.jl Updates switched-shunt parsing tests. —
src/​PowerSystemCaseBuilder.jl Updates parser includes and imports. —
src/​parsers/​psse_metadata_reimport.jl Migrates metadata reimport to OpenAPI. —
src/​parsers/​psse_dynamic_data.jl Relocates dynamic mapping configuration. —
src/​parsers/​power_models_data.jl Removes the legacy parser. —
src/​parsers/​openapi_pipeline.jl Adds OpenAPI-based system construction. —
src/​parsers/​known_stale_fixture_data.jl Handles stale Matpower fixture data. Critical: absent sections can cause KeyError; global deletions may silently discard unrelated data.
src/​parsers/​generator_mapping_pm.yaml Removes obsolete generator mappings. —
src/​parsers/​common.jl Removes legacy parser utilities. —
src/​library/​psytest_library.jl Migrates fixture builders to OpenAPI. —
src/​library/​pssetest_library.jl Migrates fixture builders to OpenAPI. —
src/​library/​psitest_library.jl Migrates fixture builders to OpenAPI. —
src/​library/​psidtest_library.jl Migrates fixture builders to OpenAPI. —
src/​library/​psid_library.jl Migrates fixture builders to OpenAPI. —
src/​library/​psi_library.jl Migrates fixture builders to OpenAPI. —
src/​library/​matpowertest_library.jl Migrates Matpower builders to OpenAPI. —
Project.toml Removes the unused Unicode dependency. —
.claude/​CLAUDE.md Updates parser architecture documentation. —

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +140 to +141
for section in KNOWN_UNREAD_MATPOWER_SECTIONS
delete!(data, section)
@codecov

codecov Bot commented Sep 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.83051% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/parsers/psse_metadata_reimport.jl 0.00% 6 Missing ⚠️

📢 Thoughts on this report? Let us know!

@jd-lara
jd-lara merged commit f48d7b1 into psy6 Sep 24, 2026
8 of 10 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.

3 participants