From 28c5e3fd159eeab83f9842ece8ca9563b834da62 Mon Sep 17 00:00:00 2001 From: jipea Date: Thu, 11 Jul 2024 12:55:19 +0200 Subject: [PATCH] isInfiniteDuration optional and true by default Signed-off-by: jipea --- .../creator/csaprofile/nc/VoltageLimit.java | 2 +- .../craccreator/cnec/VoltageCnecCreationTest.java | 15 ++++++++++++--- docs/input-data/crac/csa.md | 2 +- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/data/crac-creation/crac-creator-csa-profiles/src/main/java/com/powsybl/openrao/data/craccreation/creator/csaprofile/nc/VoltageLimit.java b/data/crac-creation/crac-creator-csa-profiles/src/main/java/com/powsybl/openrao/data/craccreation/creator/csaprofile/nc/VoltageLimit.java index 0a543c84ac..0e87239bd8 100644 --- a/data/crac-creation/crac-creator-csa-profiles/src/main/java/com/powsybl/openrao/data/craccreation/creator/csaprofile/nc/VoltageLimit.java +++ b/data/crac-creation/crac-creator-csa-profiles/src/main/java/com/powsybl/openrao/data/craccreation/creator/csaprofile/nc/VoltageLimit.java @@ -19,7 +19,7 @@ public static VoltageLimit fromPropertyBag(PropertyBag propertyBag) { Double.parseDouble(propertyBag.get(CsaProfileConstants.REQUEST_OPERATIONAL_LIMIT_VALUE)), propertyBag.getId(CsaProfileConstants.REQUEST_OPERATIONAL_LIMIT_EQUIPMENT), propertyBag.get(CsaProfileConstants.REQUEST_OPERATIONAL_LIMIT_TYPE), - Boolean.parseBoolean(propertyBag.get(CsaProfileConstants.REQUEST_VOLTAGE_LIMIT_IS_INFINITE_DURATION)) + Boolean.parseBoolean(propertyBag.getOrDefault(CsaProfileConstants.REQUEST_VOLTAGE_LIMIT_IS_INFINITE_DURATION, "true")) ); } } diff --git a/data/crac-creation/crac-creator-csa-profiles/src/test/java/com/powsybl/openrao/data/craccreation/creator/csaprofile/craccreator/cnec/VoltageCnecCreationTest.java b/data/crac-creation/crac-creator-csa-profiles/src/test/java/com/powsybl/openrao/data/craccreation/creator/csaprofile/craccreator/cnec/VoltageCnecCreationTest.java index cbc5da8547..07167fb678 100644 --- a/data/crac-creation/crac-creator-csa-profiles/src/test/java/com/powsybl/openrao/data/craccreation/creator/csaprofile/craccreator/cnec/VoltageCnecCreationTest.java +++ b/data/crac-creation/crac-creator-csa-profiles/src/test/java/com/powsybl/openrao/data/craccreation/creator/csaprofile/craccreator/cnec/VoltageCnecCreationTest.java @@ -25,7 +25,7 @@ void importVoltageCnecs() { CsaProfileCracCreationContext cracCreationContext = getCsaCracCreationContext("/profiles/cnecs/VoltageCNECs.zip", NETWORK); List importedVoltageCnecs = cracCreationContext.getCrac().getVoltageCnecs().stream().sorted(Comparator.comparing(VoltageCnec::getId)).toList(); - assertEquals(4, importedVoltageCnecs.size()); + assertEquals(5, importedVoltageCnecs.size()); CsaProfileCracCreationTestUtil.assertVoltageCnecEquality( importedVoltageCnecs.get(0), @@ -67,13 +67,22 @@ void importVoltageCnecs() { -72d, "RTE"); - assertEquals(6, cracCreationContext.getCnecCreationContexts().stream().filter(context -> !context.isImported()).toList().size()); + CsaProfileCracCreationTestUtil.assertVoltageCnecEquality( + importedVoltageCnecs.get(4), + "RTE_AE7 (assessed-element-7) - preventive", + "BBE1AA1 ", + PREVENTIVE_INSTANT_ID, + null, + 100d, + null, + "RTE"); + + assertEquals(5, cracCreationContext.getCnecCreationContexts().stream().filter(context -> !context.isImported()).toList().size()); assertCnecNotImported(cracCreationContext, "assessed-element-3", ImportStatus.INCONSISTENCY_IN_DATA, "AssessedElement assessed-element-3 ignored because a voltage limit can only be of kind highVoltage or lowVoltage"); assertCnecNotImported(cracCreationContext, "assessed-element-4", ImportStatus.NOT_YET_HANDLED_BY_OPEN_RAO, "AssessedElement assessed-element-4 ignored because only permanent voltage limits (with infinite duration) are currently handled"); assertCnecNotImported(cracCreationContext, "assessed-element-5", ImportStatus.INCONSISTENCY_IN_DATA, "AssessedElement assessed-element-5 ignored because the network element FFR1AA1 _generator is not a bus bar section"); assertCnecNotImported(cracCreationContext, "assessed-element-6", ImportStatus.ELEMENT_NOT_FOUND_IN_NETWORK, "AssessedElement assessed-element-6 ignored because the voltage limit equipment unknown-equipment is missing in network"); - assertCnecNotImported(cracCreationContext, "assessed-element-7", ImportStatus.NOT_YET_HANDLED_BY_OPEN_RAO, "AssessedElement assessed-element-7 ignored because only permanent voltage limits (with infinite duration) are currently handled"); assertCnecNotImported(cracCreationContext, "assessed-element-8", ImportStatus.INCOMPLETE_DATA, "AssessedElement assessed-element-8 ignored because no ConductingEquipment or OperationalLimit was provided"); assertHasOnConstraintUsageRule(cracCreationContext, "remedial-action-1", "RTE_AE1 (assessed-element-1) - RTE_CO1 - curative 3", cracCreationContext.getCrac().getInstant(CURATIVE_3_INSTANT_ID), UsageMethod.AVAILABLE, VoltageCnec.class); diff --git a/docs/input-data/crac/csa.md b/docs/input-data/crac/csa.md index 1fea6fe92c..c39fbba2d6 100644 --- a/docs/input-data/crac/csa.md +++ b/docs/input-data/crac/csa.md @@ -487,7 +487,7 @@ found in the **EQ** profile (CGMES file). ``` -To be valid, the VoltageCNEC's `isInfiniteDuration` field must be set to `true`. If it is missing or set to `false` it will +The VoltageCNEC's `isInfiniteDuration` field is optional and its default value is `true`. If it is set to `false` the voltageCNEC will be ignored. The CNEC's threshold value (in KILOVOLTS) is determined by the `value` field of the `VoltageLimit` and must be positive.