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

Cgmes Import. Line and Substation containers. #2970

Merged
merged 41 commits into from
Oct 30, 2024

Conversation

marqueslanauja
Copy link
Contributor

@marqueslanauja marqueslanauja commented Apr 8, 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?

Cgmes context:

  • LineContainers can only include ACLineSegments, SeriesCompensators, and connectivityNodes.
  • LineContainers can be connected to other containers using switches.
  • SubstationContainers can directly include connectivityNodes. They must be connected to other containers using switches.

IIDM context:

  • Switches must be included inside a voltageLevel.
  • VoltageLevels without substation are supported.

What is the current behavior?

  • For each connectivityNode inside a LineContainer a fictitious voltageLevel is created. (Class: Conversion, method: createFictitiousVoltageLevelsForLineContainers).
  • LineContainers connected to other containers using switches is not supported.
  • SubstationContainers including connectivityNodes are supported by selecting an associated voltageLevel. (Class: AbstracCgmesModel, method: container).

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

  • All the code is integrated into the class SubstationIdMapping.
  • LineContainers connected to other containers using switches is supported.
  • A more general method to find the reference voltageLevel (voltageLevel used as reference when a fictitious voltageLevel must be created) is coded.
  • Fictitious voltageLevels can be created by node or by container. Using the node option the importer creates unnecessary voltageLevels, but in some cases is interesting.

A new configuration parameter has been created: CREATE_FICTITIOUS_VOLTAGE_LEVEL_FOR_EVERY_NODE (True by default). Some modellers use LineContainers to model several T junctions. Graphical representation is improved by defining a voltageLevel by node. Other modellers use LineContainers to model areas of the network with detailed connectivity. In this case is better to define a fictitious voltageLevel by LineContainer.

SubstationIdMapping class.

Define the voltageLevels of the IIDM model:

  • Cgmes voltageLevels connected by switches are grouped in the same voltageLevel set.
  • Each set will define a voltageLevel in the IIDM model.
  • A representative of the set is selected to create the IIDM voltageLevel.
  • Representative is calculated as:
    • Min (alphabetic order) of the real voltageLevels included in the set OR
    • Min (alphabetic order) of the fictitious voltageLevels associated with a LineContainer included in the set OR
    • Min (alphabetic order) of the elements of the Set.

Each cgmes voltageLevel not connected to other containers by switches defines a voltageLevel in the IIDM model (one to one). There is not need of finding a representative for them.

Next step. Determine the fictitious voltageLevels that must be created:

  • Only the representative voltageLevels will be voltageLevels in the IIDM model.
  • We only need to create a new voltageLevel when representative is fictitious.
  • Only the fictitious representatives associated with LineContainers are considered.

It is not expected to create a voltageLevel for a substationContainer including connectivity nodes as it must always be connected by switches to other containers.

Last step. Find a reference voltageLevel.

  • To create a new voltageLevel, a reference voltageLevel is needed to obtain the nominal voltage and other attributes.
  • To obtain the reference voltageLevel:
    • ACLineSegments and SeriesCompensators with one or both ends inside LineContainers are used to group fictitious voltageLevels associated with LineContainers.
    • For each set, a real voltageLevel can be selected as reference.
    • A real voltageLeve is always expected inside each set.
    • If there is more than one, then the Min (alphabetic order) is selected.

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)

  • Conversion.getFictitiousVoltageLevelForNodeInContainer(String containerId, String nodeId)
    was removed. Instead, use SubstationIdMapping.getFictitiousVoltageLevelForContainer(String containerId, String nodeId).

  • CgmesModel has two new methods that should be implemented if you have classes implementing this interface:

    • Optional<String> node(CgmesTerminal t, boolean nodeBreaker);
    • Optional<CgmesContainer> nodeContainer(String nodeId);

Other information:

marqueslanauja and others added 11 commits April 3, 2024 11:58
Signed-off-by: José Antonio Marqués <marquesja@aia.es>
Signed-off-by: José Antonio Marqués <marquesja@aia.es>
Signed-off-by: José Antonio Marqués <marquesja@aia.es>
Signed-off-by: José Antonio Marqués <marquesja@aia.es>
Signed-off-by: José Antonio Marqués <marquesja@aia.es>
Signed-off-by: José Antonio Marqués <marquesja@aia.es>
Signed-off-by: José Antonio Marqués <marquesja@aia.es>

# Conflicts:
#	cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/Conversion.java
Signed-off-by: José Antonio Marqués <marquesja@aia.es>
Copy link

sonarqubecloud bot commented May 2, 2024

@annetill annetill requested a review from rcourtier September 3, 2024 08:10
@rcourtier
Copy link
Member

Hi @marqueslanauja, could you please fill in the current behaviour and the new behaviour in the description? That will help me a lot with the review. Thanks!

@marqueslanauja
Copy link
Contributor Author

marqueslanauja commented Sep 18, 2024 via email

marqueslanauja and others added 5 commits September 18, 2024 14:52
Signed-off-by: marquesja1 <marquesja@aia.es>
Signed-off-by: marquesja1 <marquesja@aia.es>
Signed-off-by: marquesja1 <marquesja@aia.es>
Signed-off-by: marquesja1 <marquesja@aia.es>
@marqueslanauja marqueslanauja marked this pull request as ready for review September 23, 2024 13:55
marqueslanauja and others added 2 commits September 30, 2024 16:06
Signed-off-by: marquesja1 <marquesja@aia.es>

# Conflicts:
#	cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/Conversion.java
@rcourtier
Copy link
Member

Could you also please add a unit test for the following situation described in this pull request comment:
"LineContainers connected to other containers using switches is supported."
Thanks!

marqueslanauja and others added 8 commits October 7, 2024 16:35
…ion/Conversion.java

Co-authored-by: rcourtier <129156292+rcourtier@users.noreply.github.com>
Signed-off-by: marqueslanauja <51124986+marqueslanauja@users.noreply.github.com>
…ion/elements/AbstractConductingEquipmentConversion.java

Co-authored-by: rcourtier <129156292+rcourtier@users.noreply.github.com>
Signed-off-by: marqueslanauja <51124986+marqueslanauja@users.noreply.github.com>
…ion/SubstationIdMapping.java

Co-authored-by: rcourtier <129156292+rcourtier@users.noreply.github.com>
Signed-off-by: marqueslanauja <51124986+marqueslanauja@users.noreply.github.com>
…ion/SubstationIdMapping.java

Co-authored-by: rcourtier <129156292+rcourtier@users.noreply.github.com>
Signed-off-by: marqueslanauja <51124986+marqueslanauja@users.noreply.github.com>
…ion/SubstationIdMapping.java

Co-authored-by: rcourtier <129156292+rcourtier@users.noreply.github.com>
Signed-off-by: marqueslanauja <51124986+marqueslanauja@users.noreply.github.com>
…ion/SubstationIdMapping.java

Co-authored-by: rcourtier <129156292+rcourtier@users.noreply.github.com>
Signed-off-by: marqueslanauja <51124986+marqueslanauja@users.noreply.github.com>
Signed-off-by: marquesja1 <marquesja@aia.es>
Signed-off-by: marquesja1 <marquesja@aia.es>
marqueslanauja and others added 2 commits October 8, 2024 11:12
Signed-off-by: marquesja1 <marquesja@aia.es>
@olperr1 olperr1 added the Breaking Change API is broken label Oct 28, 2024
Signed-off-by: marquesja1 <marquesja@aia.es>
Copy link

@olperr1 olperr1 merged commit 5e36b26 into main Oct 30, 2024
7 checks passed
@olperr1 olperr1 deleted the cgmes_line_and_substation_containers branch October 30, 2024 11:52
@olperr1 olperr1 restored the cgmes_line_and_substation_containers branch October 30, 2024 11:52
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.

4 participants