Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Topovec is wrong when elements are lost by propagation #966

Merged
merged 5 commits into from
Mar 10, 2025

Conversation

geofjamg
Copy link
Member

@geofjamg geofjamg commented Mar 5, 2025

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • A PR or issue has been opened in all impacted repositories (if any)

Does this PR already have an issue describing the problem?

Grid2op/pypowsybl2grid#12

What kind of change does this PR introduce?

Bug fix

Does this PR introduce a breaking change or deprecate an API?

  • Yes
  • No

If yes, please check if the following requirements are fulfilled

  • The Breaking Change or Deprecated label has been added
  • The migration steps are described in the following section

What changes might users need to make in their application due to this PR? (migration steps)

Other information:

geofjamg added 4 commits March 3, 2025 15:44
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
@geofjamg geofjamg requested a review from BDonnot March 6, 2025 07:48
@geofjamg geofjamg changed the title [WIP] Topovec is wrong when elements are lost by propagation Topovec is wrong when elements are lost by propagation Mar 6, 2025
@@ -113,3 +113,23 @@ def test_backend_copy():
with open(data_file, 'rb') as f:
with pickle.load(f) as backend2:
npt.assert_allclose(np.array([630.0]), backend2.get_double_value(grid2op.DoubleValueType.LOAD_P), rtol=TOLERANCE, atol=TOLERANCE)


def test_backend_disconnection_issue():
Copy link
Contributor

Choose a reason for hiding this comment

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

Perfect test :-)

private final LoadFlowProvider loadFlowProvider = LoadFlowProvider.findAll().stream()
.filter(p -> p.getName().equals("OpenLoadFlow"))
.findFirst()
.orElseThrow();
private final LoadFlow.Runner loadFlowRunner = new LoadFlow.Runner(loadFlowProvider);

public Backend(Network network, boolean considerOpenBranchReactiveFlow, int busesPerVoltageLevel, boolean connectAllElementsToFirstBus) {
public Backend(Network network, boolean considerOpenBranchReactiveFlow, boolean checkIsolatedAndDisconnectedInjections,
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure i'm entirely following everything happening here, but I think I have a global understanding of what is happening.

Plus there is a test to make sure the behaviour is working as intended.

Copy link
Contributor

@BDonnot BDonnot left a comment

Choose a reason for hiding this comment

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

Fine by me, even though i'm not 100% qualified to comment exactly on the java implementation.

Copy link

sonarqubecloud bot commented Mar 7, 2025

Copy link

sonarqubecloud bot commented Mar 7, 2025

@geofjamg geofjamg merged commit 41f733a into main Mar 10, 2025
10 checks passed
@geofjamg geofjamg deleted the grid2op_topovec_issue branch March 10, 2025 09:34
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.

2 participants