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

Refactor access to branch limits when detecting limit violations #1197

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

p-arvy
Copy link
Member

@p-arvy p-arvy commented Mar 3, 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)

Does this PR already have an issue describing the problem?

No, but the development is based on the collaborative work of #1169 , aiming to improve the performance of the fast DC SA.

What kind of change does this PR introduce?

The access to branch limits is refactored, for better performances.

Does this PR introduce a new Powsybl Action implying to be implemented in simulators or pypowsybl?

  • Yes, the corresponding issue is here
  • No

What is the current behavior?

The branch limits are stored in Maps, indexed by LimitType.

What is the new behavior (if this is a feature change)?

There is a list of limits for each LimitType. Some method references are also replaced by lambdas.
With this refactoring, the time spent on detection of limit violations is reduced, improving the performances of the fast DC SA.

diff-perfs-before-after-refactor-fast-dc-sa

Same with slow DC SA.

diff-perfs-before-after-refactor-slow-dc-sa

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:

@p-arvy p-arvy requested a review from Hadrien-Godard March 3, 2025 15:55
p-arvy and others added 2 commits March 3, 2025 17:02
Signed-off-by: Hadrien <[email protected]>
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