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

Security analysis functional logs #576

Merged
merged 5 commits into from
Jul 6, 2022
Merged

Security analysis functional logs #576

merged 5 commits into from
Jul 6, 2022

Conversation

geofjamg
Copy link
Member

@geofjamg geofjamg commented Jul 3, 2022

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, ...)
Feature

What is the current behavior? (You can also link to an open issue here)
There is no functional logs for security analysis

What is the new behavior (if this is a feature change)?
Minimal functionnal logs have been added

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)

geofjamg added 2 commits July 3, 2022 11:16
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
@geofjamg geofjamg requested a review from annetill July 3, 2022 09:22
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
Network has 4 buses and 4 branches
Network balance: active generation=607.0 MW, active load=600.0 MW, reactive generation=0.0 MVar, reactive load=200.0 MVar
+ Pre-contingency simulation
AC load flow complete with NR status 'CONVERGED'
Copy link
Member Author

Choose a reason for hiding this comment

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

@annetill @flo-dup here we can see an issue with reporter API, we don't keep sequence of reports and sub reporters

Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
AC load flow complete with NR status 'CONVERGED'
+ Outer loop Distributed slack on generation
Iteration 0: failed to distribute slack bus active power mismatch, -1.4404045651219555 MW remains
+ Outer loop Reactive limits
Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe here another possible improvement: should we discard empty child reporters?

@geofjamg
Copy link
Member Author

geofjamg commented Jul 3, 2022

This is the very first time I try to use the reporter API in a real code. @flo-dup here is some issues to discuss that could improve the usability of the API:
powsybl/powsybl-core#2190
powsybl/powsybl-core#2191
powsybl/powsybl-core#2192
powsybl/powsybl-core#2193
powsybl/powsybl-core#2194

@annetill annetill requested a review from flo-dup July 5, 2022 12:50
# Conflicts:
#	src/test/java/com/powsybl/openloadflow/sa/OpenSecurityAnalysisTest.java
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jul 6, 2022

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

Copy link
Member

@annetill annetill left a comment

Choose a reason for hiding this comment

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

@flo-dup do you want to have a look?

@@ -107,6 +107,10 @@ public Reporter getReporter() {
return reporter;
}

public void setReporter(Reporter reporter) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Here you're breaking in a way the way the reporter was at first designed... It sure is handy to put it in LfNetwork but it was first thought to be passed along all the methods and not retained, in the javadoc:

A reporter is not meant to be shared with other threads nor to be saved as a class parameter

Copy link
Member Author

@geofjamg geofjamg Jul 6, 2022

Choose a reason for hiding this comment

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

A LF network won't ever be shared between multiple threads as it is used as working data (including writing working data)

Copy link
Member Author

Choose a reason for hiding this comment

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

it was first thought to be passed along all the methods

Sure not, this is a usage detail which has nothing to do with reporter API. The only thing that is clear is that it is not thread safe. From that it is up to each user to decide the best way to use it. In case of structural single thread part of the code it is ok to put it in the applicative thread context (and this is what LfNetwork is).

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok. I missed the thing that LfNetwork is (and will be) always working data and thus by nature will never be shared.

@annetill annetill merged commit 51b5c35 into main Jul 6, 2022
@annetill annetill deleted the sa_report branch July 6, 2022 17:30
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.

3 participants