Repository navigation
Conversation
The MATPOWER parser stored mpc.gentype / mpc.genfuel / mpc.bus_name without the trailing ";", and the writer wrote them back as a bare "}". ExaGO's reader (src/ps/psreaddata.cpp) ends mpc.genfuel at the first line containing "};", so for every case AgentiGrid rewrote, ExaGO ignored the fuel types: all units fell back to the default fuel, ramp rates stayed 0 (SCOPFLOW cannot redispatch in contingencies and reports local infeasibility on ACTIVSg200 at base load, where the original file converges) and wind/solar units stayed at Pmin = Pmax. The parser now keeps "};" / "];"; the writer also terminates raw sections from networks parsed before this fix. tests/grid_files/test_matpower_cell_terminators.py mimics ExaGO's genfuel detection on a round-tripped ACTIVSg200 (3 tests; all fail without the fix). Co-Authored-By: Claude Opus 5.5 <[email protected]>
…onger overwrites it tests/fixtures/sample_opflow_output.txt is OPFLOW output for case_ACTIVSg200.m as rewritten by AgentiGrid. It was produced by the writer fixed in the previous commit and therefore listed all 49 generators as COAL; test_gen_189 asserted COAL although the case file says nuclear for bus 189. Regenerated with the fixed writer (25 coal, 17 ng, 6 wind, 1 nuclear) and updated the expected values in tests/results/test_opflow_parser.py; test_fuel_mix_matches_case_file guards against regenerating it with a broken writer again. TestExecutorLive::test_opflow_run overwrote this tracked fixture on every run with an opflow binary, so the parser tests depended on the machine and test order (test_solve_time already failed against the committed fixture). It now writes the fixture only with AGENTIGRID_REGENERATE_FIXTURES=1, and the class skips without the binary like TestMPIGuard. tests/README.md documents the regeneration; claude_code_changes.md has the entry for both commits. Fast suite without ExaGO binaries: 1083 passed, 13 skipped (before: 2 failed). Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Oct 20, 2026
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.
Merge request type
Relates to
This MR updates
Summary
AgentiGrid's MATPOWER writer dropped the
;after cell arrays (mpc.genfuel = { ... }instead of... };). ExaGO's reader (src/ps/psreaddata.cpp) endsmpc.genfuelat the first line containing};, so for every case AgentiGrid rewrote, ExaGO ignored the fuel types:The repository's own test data shows the bug:
agentigrid/tests/fixtures/sample_opflow_output.txt(OPFLOW on AgentiGrid-rewritten ACTIVSg200) listed all 49 generators as COAL, whilecase_ACTIVSg200.mhas 25 coal, 17 ng, 6 wind and 1 nuclear (bus 189), and the wind units had Pmin = Pmax.test_gen_189asserted COAL.Commit 1 — the fix:
agentigrid/parsers/matpower_parser.pykeeps};/];on cell-array sections;matpower_writer.pywrites};, including for networks parsed before the fix.tests/grid_files/test_matpower_cell_terminators.py(3 tests) mimics ExaGO's genfuel detection on a round-tripped ACTIVSg200; all 3 fail without the fix.Commit 2 — tests:
tests/fixtures/sample_opflow_output.txtwith the fixed writer (Ipopt 3.14.14); updated expected values intests/results/test_opflow_parser.py(bus 189 NUCLEAR, 21 iterations, 0.021 s) and addedtest_fuel_mix_matches_case_file.TestExecutorLive::test_opflow_runoverwrote this tracked fixture on every run with anopflowbinary, so the parser tests depended on the machine and test order (test_solve_timealready failed against the committed fixture). It now writes the fixture only withAGENTIGRID_REGENERATE_FIXTURES=1, and the class skips without the binary, likeTestMPIGuard.tests/README.mddocuments regeneration.agentigrid/claude_code_changes.md.Testing:
python -m pytest -m "not slow"fromagentigrid/— 1083 passed, 13 skipped without ExaGO binaries (2 failures before this change). The file-naming check (buildsystem/tools/file_naming_conventions.pl) returns 0.AI assistance: prepared with Claude (Anthropic); commits carry
Co-Authored-By: Claude, and the change is logged inclaude_code_changes.md.Linked Issue(s)
None filed.