-
Notifications
You must be signed in to change notification settings - Fork 44
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
Create adders from existing objects: ReactiveCapabilityCurve, PhaseTapChanger, RatioTapChanger #3130
Conversation
2a7fd64
to
cd5ce9d
Compare
9645e84
to
4bfb458
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The whole mechanism is ok, but the interfaces introduced to think it as a generic solution makes it obscure or too complex I think (and besides it's not completely covering the usecase I think).
iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/LineAdderImpl.java
Outdated
Show resolved
Hide resolved
iidm/iidm-api/src/main/java/com/powsybl/iidm/network/AdderUser.java
Outdated
Show resolved
Hide resolved
iidm/iidm-api/src/main/java/com/powsybl/iidm/network/CurrentLimitsNestedAdder.java
Outdated
Show resolved
Hide resolved
iidm/iidm-api/src/main/java/com/powsybl/iidm/network/AdderUser.java
Outdated
Show resolved
Hide resolved
iidm/iidm-api/src/main/java/com/powsybl/iidm/network/NestedAdder.java
Outdated
Show resolved
Hide resolved
iidm/iidm-api/src/main/java/com/powsybl/iidm/network/CurrentLimitsPayload.java
Outdated
Show resolved
Hide resolved
iidm/iidm-api/src/main/java/com/powsybl/iidm/network/Network.java
Outdated
Show resolved
Hide resolved
iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/CurrentLimitsNestedAdderImpl.java
Outdated
Show resolved
Hide resolved
iidm/iidm-api/src/main/java/com/powsybl/iidm/network/LineAdder.java
Outdated
Show resolved
Hide resolved
iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/TemporaryLimitNestedAdderImpl.java
Outdated
Show resolved
Hide resolved
53da2eb
to
c903d96
Compare
c903d96
to
347db8e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this PR, we'd better stick with the basic but tedious cases of PhaseTapChanger/RatioTapChanger/ReactiveCapabilityCurve.
iidm/iidm-api/src/main/java/com/powsybl/iidm/network/Network.java
Outdated
Show resolved
Hide resolved
iidm/iidm-api/src/main/java/com/powsybl/iidm/network/Network.java
Outdated
Show resolved
Hide resolved
iidm/iidm-api/src/main/java/com/powsybl/iidm/network/Network.java
Outdated
Show resolved
Hide resolved
iidm/iidm-api/src/main/java/com/powsybl/iidm/network/BranchAdder.java
Outdated
Show resolved
Hide resolved
iidm/iidm-api/src/main/java/com/powsybl/iidm/network/PhaseTapChangerHolder.java
Outdated
Show resolved
Hide resolved
iidm/iidm-api/src/main/java/com/powsybl/iidm/network/RatioTapChangerHolder.java
Outdated
Show resolved
Hide resolved
347db8e
to
9687aae
Compare
…ity curve as template Signed-off-by: CHIQUET Benoit <[email protected]>
Signed-off-by: CHIQUET Benoit <[email protected]>
9687aae
to
6180bf7
Compare
iidm/iidm-impl/src/test/java/com/powsybl/iidm/network/impl/tck/TapChangerHolderTest.java
Show resolved
Hide resolved
iidm/iidm-tck/src/test/java/com/powsybl/iidm/network/tck/AbstractTapChangerHolderTest.java
Outdated
Show resolved
Hide resolved
…actTapChangerHolderTest.java Co-authored-by: Florian Dupuy <[email protected]> Signed-off-by: bc-rte <[email protected]>
Signed-off-by: CHIQUET Benoit <[email protected]>
95d0bca
to
a239827
Compare
|
.setTargetDeadband(ratioTapChanger.getTargetDeadband()); | ||
for (int tapPosition = ratioTapChanger.getLowTapPosition(); tapPosition <= ratioTapChanger.getHighTapPosition(); tapPosition++) { | ||
RatioTapChangerStep step = ratioTapChanger.getStep(tapPosition); | ||
adder.beginStep() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wouldn't it be interesting to add a A beginStep(D step)
in TapChangerAdder
interface? It's probably not very useful, but in that way each level would have its copy method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer to stick to the perimeter you defined previously.
If the need for copy-adder on steps solidifies, they could be added in a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even if you consider the code duplication in PhaseTapChangerHolder and RatioTapChangerHolder?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After looking back into it, the issue I have with it is that beginStep
carries a state that would be unrelated to existing step: the order in which steps are created currently encodes the tap position. Being able to initialize beginStep
by copying a step with a different tap position may be confusing for users.
A helper class could be used to mutualize the code, but it is unclear to me whether this would be better than the current situation.
|
Please check if the PR fulfills these requirements
Does this PR already have an issue describing the problem?
What kind of change does this PR introduce?
This PR introduces adder initialized by copying an existing component.
What is the current behavior?
What is the new behavior (if this is a feature change)?
Does this PR introduce a breaking change or deprecate an API?
If yes, please check if the following requirements are fulfilled
What changes might users need to make in their application due to this PR? (migration steps)
the
NetworkImpl::newLine
method now has two parametric implementations with one parameter.Users that used
network.newLine(null)
need to cast nullnetwork.newLine((String) null)
in order to pass compilationOther information:
This PR is inspired from previous work there.