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

Fix network variant removal issue #637

Merged
merged 4 commits into from
Oct 27, 2022
Merged

Fix network variant removal issue #637

merged 4 commits into from
Oct 27, 2022

Conversation

geofjamg
Copy link
Member

@geofjamg geofjamg commented Oct 24, 2022

Signed-off-by: Geoffroy Jamgotchian geoffroy.jamgotchian@gmail.com

Please check if the PR fulfills these requirements (please use '[x]' to check the checkboxes, or submit the PR and then click the checkboxes)

  • 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)

Does this PR already have an issue describing the problem ? If so, link to this issue using '#XXX' and skip the rest
No

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Bug fix

What is the current behavior? (You can also link to an open issue here)
When we create a LF network from an IIDM network in bus/breaker topo, we create it from a temporary variant. The variant is removed just after and created LF network still wraps IIDM objects from removed variants (especially calculated bus which are no more part of the IIDM network). The only reason for we didn't seen any bug is that we don't update the IIDM network at the end.

What is the new behavior (if this is a feature change)?
IIDM temporary variant is removed at the end of the calculation when we don't need it anymore.

Does this PR introduce a breaking change or deprecate an API? If yes, check the following:

  • The Breaking Change or Deprecated label has been added
  • The migration guide has been updated in the github wiki (What changes might users need to make in their application due to this PR?)

Other information:

(if any of the questions/checkboxes don't apply, please delete them entirely)

Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
@geofjamg geofjamg requested a review from annetill October 24, 2022 20:44
@annetill annetill requested a review from flo-dup October 25, 2022 06:59
@annetill annetill added PR: next-release bug Something isn't working labels Oct 26, 2022
geofjamg and others added 2 commits October 26, 2022 21:31
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
@geofjamg geofjamg requested a review from flo-dup October 26, 2022 19:36

// run simulation on largest network
SecurityAnalysisResult result;
LfNetwork largestNetwork = lfNetworks.getLargest().orElse(null);
Copy link
Contributor

Choose a reason for hiding this comment

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

It makes me sad you didn't use filter and map on the optional!

SecurityAnalysisResult result = lfNetworks.getLargest().filter(LfNetwork::isValid).map(...).orElse(createNoResult());

Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@geofjamg geofjamg merged commit dcdee44 into main Oct 27, 2022
@geofjamg geofjamg deleted the fix_variant_removal_issue branch October 27, 2022 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working PR: next-release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants