Skip to content

Drop support for CIM14 #3375

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

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Drop support for CIM14 #3375

wants to merge 10 commits into from

Conversation

quinarygio
Copy link
Contributor

@quinarygio quinarygio commented Mar 20, 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) --> The documentation mentions only version 2.4.15 (CIM 16) and 3.0 (CIM 100). CIM 14 was not mentioned.
  • A PR or issue has been opened in all impacted repositories (if any)

Does this PR already have an issue describing the problem?

Fixes #3290

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)

  • CIM 14 CGMES files are not supported anymore. Please use CIM16 (2.4.15) or CIM100 (3.0) files.
  • As a direct consequence, the followings were removed:
    • CgmesModel.CIM_14_NAMESPACE,
    • CgmesModel.CIM_14,
    • CgmesOnDataSource.existsCim14() : now it would have always returned false,
    • CgmesModel.Cim.hasProfiles(): now it would have always returned true.
  • The CgmesModel interface was also modified. The method modelProfiles is no longer a default method, meaning that you have now to implement it if you designed your own implementation of the interface.
  • The public constant CIM_LIST from the CgmesNamespace class has gone from List.of(CIM_14, CIM_16, CIM_100) to List.of(CIM_16, CIM_100)
  • Deleted CIM14 network files are available in previous releases ( $vX.Y.Z \leq v6.7.0$) if needed.

Signed-off-by: Giovanni Ferrari <[email protected]>
@quinarygio quinarygio linked an issue Mar 20, 2025 that may be closed by this pull request
@quinarygio quinarygio marked this pull request as draft March 20, 2025 10:39
@quinarygio quinarygio changed the title [WIP] Drop support for CIM14 Drop support for CIM14 Mar 20, 2025
@quinarygio quinarygio marked this pull request as ready for review March 20, 2025 13:51
Copy link
Member

@So-Fras So-Fras left a comment

Choose a reason for hiding this comment

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

Thanks for your work! I left a few comments and some questions for @rcourtier :)

@So-Fras So-Fras requested a review from rcourtier March 20, 2025 16:07
Signed-off-by: Giovanni Ferrari <[email protected]>
@So-Fras
Copy link
Member

So-Fras commented Mar 27, 2025

Thanks for the changes, I left new comments too (things I missed the first time).

There are also 2 test resources files that you can delete: empty_cim14_EQ.xml and empty_cim14_SV.xml.

There are also tests where "cim14" still appears, namely:

  • CgmesNamingStrategyTest
  • EquipmentExportTest
  • EquipementExportTest
  • CgmesOnDataSourceTest

(the cgmes-conversion module test resources cim14 folder should be deleted too)

In the OperationalLimitConversion class, there is a comment mentioning CIM14 (line 52).

The file invalidContent_EQ in the cgmes-model-test still mentions "cim14" as well.

@quinarygio
Copy link
Contributor Author

Thanks for the changes, I left new comments too (things I missed the first time).

There are also 2 test resources files that you can delete: empty_cim14_EQ.xml and empty_cim14_SV.xml.

There are also tests where "cim14" still appears, namely:

  • CgmesNamingStrategyTest
  • EquipmentExportTest
  • EquipementExportTest
  • CgmesOnDataSourceTest

(the cgmes-conversion module test resources cim14 folder should be deleted too)

In the OperationalLimitConversion class, there is a comment mentioning CIM14 (line 52).

The file invalidContent_EQ in the cgmes-model-test still mentions "cim14" as well.

CgmesNamingStrategyTest and EquipmentExportTest use files nordic32.xiidm and ieee14.xiidm from cim14 folder, but the files are in XIIDM format. What should I do ?

CgmesOnDataSourceTest.testExists() test is using empty_cim14_EQ.xml to test that CIM14 is not supported

OperationalLimitConversion what should I do with this check ?

 if (limitSubclass == null) {
                // Support for CIM14, all limits are assumed to be current
                limitSubclass = CgmesNames.CURRENT_LIMIT;
 }

@rcourtier
Copy link
Member

In CgmesNamespace class, can you please remove the hasProfiles() from the Cim interface and AbstractCim implementation?
It was intended to highlight the difference between CIM14 which has no profiles and CIM16 and above which have profiles. Now the method always return true, so it has lost its interest.

@rcourtier
Copy link
Member

rcourtier commented Mar 28, 2025

CgmesNamingStrategyTest and EquipmentExportTest use files nordic32.xiidm and ieee14.xiidm from cim14 folder, but the files are in XIIDM format. What should I do ?

You can remove the files (the whole folder cim14 actually) and the corresponding tests in CgmesNamingStrategyTest and EquipmentExportTest

CgmesOnDataSourceTest.testExists() test is using empty_cim14_EQ.xml to test that CIM14 is not supported

You can keep empty_cim14_EQ.xml as you said to highlight the fact that CIM14 is not supported.

OperationalLimitConversion what should I do with this check ?

 if (limitSubclass == null) {
                // Support for CIM14, all limits are assumed to be current
                limitSubclass = CgmesNames.CURRENT_LIMIT;
 }

You can consider that limitSubclass is not null:

if (limitSubclass.equals(CgmesNames.ACTIVE_POWER_LIMIT) || limitSubclass.equals(CgmesNames.APPARENT_POWER_LIMIT) || limitSubclass.equals(CgmesNames.CURRENT_LIMIT)) {
    if (terminalId != null) {
    ...

Signed-off-by: Giovanni Ferrari <[email protected]>
Signed-off-by: Giovanni Ferrari <[email protected]>
@So-Fras So-Fras added the Breaking Change API is broken label Apr 2, 2025
So-Fras
So-Fras previously approved these changes Apr 2, 2025
rcourtier
rcourtier previously approved these changes Apr 3, 2025
Copy link
Member

@rcourtier rcourtier left a comment

Choose a reason for hiding this comment

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

Thank you for your work!

@So-Fras So-Fras requested review from olperr1 and flo-dup April 3, 2025 12:30
@olperr1 olperr1 changed the title Drop support for CIM14 Drop support for CIM14 Apr 3, 2025
@olperr1 olperr1 changed the title Drop support for CIM14 Drop support for CIM14 Apr 3, 2025
// Support for CIM14, all limits are assumed to be current
limitSubclass = CgmesNames.CURRENT_LIMIT;
}
if (limitSubclass.equals(CgmesNames.ACTIVE_POWER_LIMIT) || limitSubclass.equals(CgmesNames.APPARENT_POWER_LIMIT) || limitSubclass.equals(CgmesNames.CURRENT_LIMIT)) {
Copy link
Member

Choose a reason for hiding this comment

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

It would be cleaner this way:

Suggested change
if (limitSubclass.equals(CgmesNames.ACTIVE_POWER_LIMIT) || limitSubclass.equals(CgmesNames.APPARENT_POWER_LIMIT) || limitSubclass.equals(CgmesNames.CURRENT_LIMIT)) {
if (CgmesNames.ACTIVE_POWER_LIMIT.equals(limitSubclass) || CgmesNames.APPARENT_POWER_LIMIT.equals(limitSubclass) || CgmesNames.CURRENT_LIMIT.equals(limitSubclass)) {

@@ -30,8 +30,7 @@ public class SynchronousMachineConversion extends AbstractReactiveLimitsOwnerCon
public SynchronousMachineConversion(PropertyBag sm, Context context) {
super(CgmesNames.SYNCHRONOUS_MACHINE, sm, context);
String type = p.getLocal("type");
// CIM14 uses Type.condenser, CIM16 and CIM100 use Kind.condenser
isCondenser = type != null && type.endsWith(".condenser");
isCondenser = type.equals("SynchronousMachineKind.condenser");
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
isCondenser = type.equals("SynchronousMachineKind.condenser");
isCondenser = "SynchronousMachineKind.condenser".equals(type);

Arguments.of("rdf cim16 not cim14", "empty_cim16_EQ.xml", "14", false),
Arguments.of("rdf cim14 not cim16", "empty_cim14_EQ.xml", "16", false)
);
Arguments.of("EQ cim14", "empty_cim14_EQ.xml", false),
Copy link
Member

Choose a reason for hiding this comment

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

Just to be clear why we have kept this test:

Suggested change
Arguments.of("EQ cim14", "empty_cim14_EQ.xml", false),
Arguments.of("EQ cim14", "empty_cim14_EQ.xml", false), // CIM14 is not supported

@@ -41,23 +37,6 @@
*/
class CgmesNamingStrategyTest extends AbstractSerDeTest {

@Test
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't we keep an equivalent of the deleted tests, but in another CIM version?

Copy link
Member

Choose a reason for hiding this comment

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

A test with NamingStrategyFactory.CGMES has been kept (testExportUsingCgmesNamingStrategyMicroGrid()). It was deemed complete enough to test the naming strategy.

@@ -199,145 +194,6 @@ void microGridCreateEquivalentInjectionAliases() throws IOException, XMLStreamEx
assertTrue(compareNetworksEQdata(expected, actual));
}

@Test
void nordic32() throws IOException, XMLStreamException {
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't we also try to keep these tests?

(On a note side, there's still a CIM16 nordic32.xml file in the resources which doesn't seem to be called.)

Signed-off-by: Giovanni Ferrari <[email protected]>
@quinarygio quinarygio dismissed stale reviews from rcourtier and So-Fras via eb95a36 April 10, 2025 10:24
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.

Drop support for CIM14
4 participants