Skip to content

Fix PowerFactory controller connection metadata - #25

Merged
AlexKocherKIT merged 2 commits into
mainfrom
fix/powerfactory-control-connections
Aug 19, 2026
Merged

Fix PowerFactory controller connection metadata#25
AlexKocherKIT merged 2 commits into
mainfrom
fix/powerfactory-control-connections

Conversation

@Sriganesh-k

Copy link
Copy Markdown
Collaborator

Fixes missing connector metadata for PowerFactory-imported generator controls.

Changes:

  • Adds connector metadata for exciter/AVR connections
  • Adds connector metadata for governor connections
  • Adds connector metadata for PSS connections
  • Adds a regression test for the Minimal PowerFactory model

The controller components already existed, but their edge dictionaries did not contain the required connector names.

Tests:

  • pre-commit passed
  • 20 GDF tests passed, 1 skipped
  • PowerFactory integration test could not be run locally because the proprietary powerfactory Python module is not available

Closes #16

@JohannesWeinbrecht JohannesWeinbrecht left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I say we postpone this PR until it is properly tested with multiple exports.
I don't want to merge this into main, where we have a running importer (even though it is generating models with a slight issue).

generic_avr.uid: generic_avr.connector_names.copy(),
self._component_dict[generator].uid: [],
}
)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

When trying to import the example IEEE 39 Grid from PowerFactory to GDF, this fails for me, with KeyError[really long object] is not in the graph.

I say we postpone this PR until it is properly tested with multiple exports.
I don't want to merge this into main, where we have a running importer (even though it is generating models with a slight issue).

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Reproduced the IEEE39 KeyError locally. The controller metadata was being updated before the corresponding graph edge existed, so I added the missing generator edges for AVR, governor, and PSS before updating the metadata.

Re-tested with the PowerFactory 39 Bus New England System: import now completes with 140 nodes / 147 edges and includes IEEET1, IEEEG1, and PTIST1 controller connections. I also smoke-tested the 14 Bus export. Core tests: 51 passed, 8 skipped.

@Sriganesh-k

Copy link
Copy Markdown
Collaborator Author

Reproduced the IEEE39 KeyError locally. The controller metadata was being updated before the corresponding graph edge existed, so I added the missing generator edges for AVR, governor, and PSS before updating the metadata.

Re-tested with the PowerFactory 39 Bus New England System: import now completes with 140 nodes / 147 edges and includes IEEET1, IEEEG1, and PTIST1 controller connections. I also smoke-tested the 14 Bus export. Core tests: 51 passed, 8 skipped.

@JohannesWeinbrecht JohannesWeinbrecht left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM, seems like it was a rather minor fix.

Regarding the models to replace in the repository, I am unsure what to do.
I converted the models I had (the one to be suspected to be the "clean" model from Moritz), but they show much larger diffs than this PR explains (like trafos having different names and some different parameters).
Maybe @AlexKocherKIT can help with the decision about the models.

@AlexKocherKIT
AlexKocherKIT merged commit 887e36e into main Aug 19, 2026
1 check 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.

PowerFactory Importer creates false GDF Models

3 participants