Repository navigation
Conversation
…idKit checks - from_exago: ExaGO's -save_output writes some branches with fbus/tbus swapped but keeps the tap and phase shift of the original from bus (ACTIVSg10k: 3562 of 12706 branches, 476 off-nominal transformers), so GridKit had those taps on the wrong winding and the case did not start at ExaGO's operating point (Vm jump up to 0.15 pu, machines drifting). New exago_branch_directions() keeps, for each transformer, the direction whose computed flow matches ExaGO's reported Pf/Qf; called in build_from_exago after exago_shifts_to_degrees. - from_exago: ACTIVSg10k static_gen injections kept and ExaGO load rebuilt net of them; Pg within 0.01 MW of Pmin/Pmax set to the limit and units at a Tgov1 valve limit set just inside it; machines paired with MATPOWER rows in file order. - criteria/journal/agent_loop/validation: rounded numbers are followed by their full value in brackets (num()); every check keeps all its numbers unrounded in CheckResult.data, written to the journal (including the highest final Vm and its bus, and the base-case steady-state values). - matpower_parser: read .m files with errors="replace" so non-UTF-8 bytes in comments do not reject a case. - tests: converter tests for radian shifts, static_gen, machine order, Pmin/Pmax and valve-limit snapping. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This is quick and dirty fix, it seems `cmake-format` is not compatible with python 3.15.
Try python 3.14
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.
AgentiGrid: correct ExaGO -> GridKit conversion for ACTIVSg10k, keep full precision in GridKit checks
Follow-up to #147 (Initial implementation of transient analysis with AgentiGrid). Changes are in AgentiGrid only; ExaGO and GridKit code are untouched.
Why
A GridKit case built from an ExaGO solution (
--from-exago, or the fault screen with"start_from": "latest_steady_state") did not start at ExaGO's operating point on ACTIVSg10k. ExaGO's-save_output(opflowout.m/pflowout.m) writes 3,562 of 12,706 branches withfbusandtbusswapped. It keeps the tap ratio and phase shift, which belong to the original from bus. 476 of these branches are off-nominal transformers. GridKit puts the tap onbus1, so the converted case had those taps on the wrong winding.Changes
Converter (
gridkit_engine/from_exago.py)exago_branch_directions()(new), called inbuild_from_exago()afterexago_shifts_to_degrees(). For every in-service transformer with a tap or phase shift, it computes the from-end flow from ExaGO's solved voltages with the tap on either side, and keeps the direction that matches ExaGO's reported Pf/Qf. Lines (tap 1, no shift) are left as written. The fix is recorded in the conversion notes.*_static_gen_*LoadZIP injections are kept unchanged, and ExaGO's load at those buses is rebuilt net of them (STATIC_GEN_CASES).Full precision in GridKit checks
criteria.py.num()helper: a rounded value followed by its full value in brackets, e.g.highest 1.100 pu [1.1003587455398696 pu].CheckResult.data: every number of a check, unrounded.journal.py. Each check'sdatais written to the journal.agent_loop.py.rows.validation.py. Clearing-time messages show full values.Other
exago_parsers/matpower_parser.py. Reads.mfiles witherrors="replace", so non-UTF-8 bytes in comments do not reject a case.tests/gridkit/test_from_exago.py. New tests for:Verification (ACTIVSg10k)
exago_branch_directions()flips exactly 476 transformers.tests/gridkit: 114 passed, 3 failed. The 3 failures are unrelated.With help of Claude Code