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

Fix one leg intern cells #595

Merged
merged 13 commits into from
Mar 25, 2024
Merged

Fix one leg intern cells #595

merged 13 commits into from
Mar 25, 2024

Conversation

flo-dup
Copy link
Contributor

@flo-dup flo-dup commented Mar 18, 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?
No

What kind of change does this PR introduce?
Bug fix

What is the current behavior?
One-leg intern cells, which are intern cells which are displayed as a single vertical line, forces the corresponding busbars to be parallel, which used to lead to unexpected behaviour (mixing components on one of the two bars). Since PR #573, an exception is thrown.

Example of one-leg intern cell from unit tests:
one-leg

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

  • Wannabe one-leg intern cells are detected when organizing blocks like previously but the corresponding shape is now MAYBE_ONE_LEG
  • Then, when building the LegBusSets, the maybe-one-leg cell is
    • either integrated in an existing LegBusSet if all its busNodes are contained in that one, its shape is then confirmed ONE_LEG
    • or split into two LegBlocks based on the LegBusSets it is attached to and its shape is either marked UNDEFINED or MAYBE_FLAT
    • or split into two LegBlocks based on the sectionIndex of their BusNode and its shape is either marked UNDEFINED or MAYBE_FLAT
    • or marked as ONE_LEG
  • Later, when creating subsections, if we detect that the maybe-one-leg cell which was split into two parts is fully included in a subsection, we finally set its shape to ONE_LEG

Note that when splitting in two parts the subBlocks of the internCell, we favour the splitting based on LegBusSets as they can deal with complex subsections which contain more than one sectionIndex (e.g., two parallel busbars with different lengths).

Does this PR introduce a breaking change or deprecate an API?

  • Yes
  • No

flo-dup added 7 commits March 15, 2024 17:17
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
@flo-dup flo-dup requested review from So-Fras and geofjamg March 18, 2024 16:09
So-Fras and others added 3 commits March 20, 2024 10:49
Signed-off-by: Sophie Frasnedo <sophie.frasnedo@rte-france.com>
Signed-off-by: Sophie Frasnedo <sophie.frasnedo@rte-france.com>
List<LegPrimaryBlock> subBlocks = legParallelBlock.getSubBlocks();
if (subBlocks.size() == 2) {
internCell.replaceOneLegByMultiLeg(subBlocks.get(0), subBlocks.get(1));
} else {
Copy link
Member

Choose a reason for hiding this comment

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

This else statement is never used (neither in unit tests nor in other tests I ran with French substations).
Shall we remove it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now there's one unit test which uses it. And I fixed the content of the else, adding comments to explain better what's done.

So-Fras and others added 2 commits March 20, 2024 18:15
Signed-off-by: Sophie Frasnedo <sophie.frasnedo@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
@flo-dup flo-dup force-pushed the maybe_one_leg branch 3 times, most recently from bc1ab03 to 356a1c8 Compare March 25, 2024 13:39
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Copy link

@flo-dup flo-dup requested a review from So-Fras March 25, 2024 15:14
@So-Fras So-Fras merged commit 8463f4b into main Mar 25, 2024
6 checks passed
@So-Fras So-Fras deleted the maybe_one_leg branch March 25, 2024 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants