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

Create adders from existing objects: ReactiveCapabilityCurve, PhaseTapChanger, RatioTapChanger #3130

Merged
merged 7 commits into from
Dec 2, 2024

Conversation

bc-rte
Copy link
Contributor

@bc-rte bc-rte commented Sep 4, 2024

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?

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?

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

the NetworkImpl::newLine method now has two parametric implementations with one parameter.
Users that used network.newLine(null) need to cast null network.newLine((String) null) in order to pass compilation

Other information:

This PR is inspired from previous work there.

@bc-rte bc-rte force-pushed the add_builders_from_existing_objects branch 2 times, most recently from 2a7fd64 to cd5ce9d Compare September 4, 2024 09:21
@bc-rte bc-rte requested a review from geofjamg September 6, 2024 13:50
@bc-rte bc-rte force-pushed the add_builders_from_existing_objects branch from 9645e84 to 4bfb458 Compare September 6, 2024 14:06
@bc-rte bc-rte requested a review from flo-dup September 9, 2024 11:39
Copy link
Contributor

@flo-dup flo-dup left a 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).

@bc-rte bc-rte force-pushed the add_builders_from_existing_objects branch 6 times, most recently from 53da2eb to c903d96 Compare September 16, 2024 09:30
@bc-rte bc-rte changed the title WIP: Add builders from existing objects Add builders from existing objects Sep 16, 2024
@bc-rte bc-rte changed the title Add builders from existing objects WIP: Add builders from existing objects Sep 16, 2024
@bc-rte bc-rte force-pushed the add_builders_from_existing_objects branch from c903d96 to 347db8e Compare September 16, 2024 09:36
@bc-rte bc-rte changed the title WIP: Add builders from existing objects Add builders from existing objects Sep 16, 2024
@bc-rte bc-rte requested a review from flo-dup September 16, 2024 11:02
Copy link
Contributor

@flo-dup flo-dup left a 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.

@flo-dup flo-dup changed the title Add builders from existing objects Create adders from existing objects: ReactiveCapabilityCurve, PhaseTapChanger, RatioTapChanger Sep 30, 2024
@bc-rte bc-rte force-pushed the add_builders_from_existing_objects branch 2 times, most recently from 347db8e to 9687aae Compare September 30, 2024 12:25
@bc-rte bc-rte requested a review from flo-dup September 30, 2024 12:28
@bc-rte bc-rte force-pushed the add_builders_from_existing_objects branch from 9687aae to 6180bf7 Compare September 30, 2024 14:06
@bc-rte bc-rte requested a review from flo-dup September 30, 2024 14:06
…actTapChangerHolderTest.java

Co-authored-by: Florian Dupuy <[email protected]>
Signed-off-by: bc-rte <[email protected]>
@bc-rte bc-rte requested a review from flo-dup October 2, 2024 07:47
Signed-off-by: CHIQUET Benoit <[email protected]>
@bc-rte bc-rte force-pushed the add_builders_from_existing_objects branch from 95d0bca to a239827 Compare October 2, 2024 08:03
Copy link

sonarqubecloud bot commented Oct 2, 2024

.setTargetDeadband(ratioTapChanger.getTargetDeadband());
for (int tapPosition = ratioTapChanger.getLowTapPosition(); tapPosition <= ratioTapChanger.getHighTapPosition(); tapPosition++) {
RatioTapChangerStep step = ratioTapChanger.getStep(tapPosition);
adder.beginStep()
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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?

Copy link
Contributor Author

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.

@flo-dup flo-dup merged commit 94abfaa into main Dec 2, 2024
7 checks passed
@flo-dup flo-dup deleted the add_builders_from_existing_objects branch December 2, 2024 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants