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

[WIP] Add a check on minQ <= maxQ #3314

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

So-Fras
Copy link
Member

@So-Fras So-Fras commented Feb 7, 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)

What kind of change does this PR introduce?
Quality

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?
There is no check to ensure minQ <= maxQ in a ReactiveCapabilityCurve Point.

What is the new behavior (if this is a feature change)?
A check is added to ensure minQ <= maxQ in a ReactiveCapabilityCurve Point.
An excpetion is thrown when minQ > maxQ.

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:

  • Is it really a change in IIDM since no new attribute is added? Maybe it is since an IIDM file with a minQ > maxQ will not be processed the same way as before...
  • Should we throw an exception or should we "fix" one of the values (take the smallest value both for minQ and maxQ to be conservative?) with a warning to make the model more robust?

Signed-off-by: Sophie Frasnedo <[email protected]>
@So-Fras So-Fras requested a review from olperr1 February 7, 2025 14:23
@So-Fras So-Fras self-assigned this Feb 7, 2025
@So-Fras So-Fras changed the title Add a check on Qmin <= Qmax Add a check on minQ <= maxQ Feb 7, 2025
@geofjamg
Copy link
Member

geofjamg commented Feb 10, 2025

Yes this is a breaking change as you won't be able to load old files without any exception. You can add this kind of change BUT only in a new version of IIDM and keeping old behaviour (do nothing) for other IIDM versions.

@geofjamg geofjamg changed the title Add a check on minQ <= maxQ [WIP] Add a check on minQ <= maxQ Feb 10, 2025
Comment on lines +33 to +35
if (minQ > maxQ) {
throw new IllegalStateException("minQ should be inferior or equal to maxQ");
}
Copy link
Contributor

Choose a reason for hiding this comment

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

There's a related TODO written in 2017 (to plan it for IIDM v1.1!!) in the corresponding adder, and a @Disabled in a unit test in AbstractReactiveCapabilityCurveTest. Could you remove them?

This should be only activated for next IIDM version. There should be a check in the importer based on the IIDM version to flip or not.

@So-Fras So-Fras added the Breaking Change API is broken label Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants