Skip to content

Commit ab1290e

Browse files
sharyalZbqth29
andauthored
NC CRAC importer topological actions errors corrections (#1466)
Signed-off-by: Sharyal Zafar <sharyal.zafar@artelys.com> Co-authored-by: Thomas Bouquet <thomas.bouquet@rte-france.com>
1 parent 0d42421 commit ab1290e

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

data/crac/crac-io/crac-io-nc/src/main/java/com/powsybl/openrao/data/crac/io/nc/craccreator/remedialaction/NetworkActionCreator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,11 +245,11 @@ private boolean addTopologicalElementaryAction(Set<StaticPropertyRange> staticPr
245245
}
246246

247247
if (!ValueOffsetKind.ABSOLUTE.toString().equals(nativeStaticPropertyRange.valueKind())) {
248-
throw new OpenRaoImportException(ImportStatus.INCONSISTENCY_IN_DATA, String.format("Remedial action %s will not be imported because the ValueOffsetKind is %s but should be none", remedialActionId, nativeStaticPropertyRange.valueKind()));
248+
throw new OpenRaoImportException(ImportStatus.INCONSISTENCY_IN_DATA, String.format("Remedial action %s will not be imported because the ValueOffsetKind is %s but should be absolute", remedialActionId, nativeStaticPropertyRange.valueKind()));
249249
}
250250

251251
if (!RelativeDirectionKind.NONE.toString().equals(nativeStaticPropertyRange.direction())) {
252-
throw new OpenRaoImportException(ImportStatus.INCONSISTENCY_IN_DATA, String.format("Remedial action %s will not be imported because the RelativeDirectionKind is %s but should be absolute", remedialActionId, nativeStaticPropertyRange.direction()));
252+
throw new OpenRaoImportException(ImportStatus.INCONSISTENCY_IN_DATA, String.format("Remedial action %s will not be imported because the RelativeDirectionKind is %s but should be none", remedialActionId, nativeStaticPropertyRange.direction()));
253253
}
254254

255255
if (nativeTopologyAction.normalEnabled()) {

data/crac/crac-io/crac-io-nc/src/test/java/com/powsybl/openrao/data/crac/io/nc/craccreator/remedialaction/TopologicalActionCreationTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ void importTopologicalActions() {
4242
NcCracCreationTestUtil.assertRaNotImported(cracCreationContext, "remedial-action-4", ImportStatus.NOT_FOR_RAO, "Remedial action remedial-action-4 will not be imported because it has no elementary action");
4343
NcCracCreationTestUtil.assertRaNotImported(cracCreationContext, "remedial-action-5", ImportStatus.INCONSISTENCY_IN_DATA, "Remedial action remedial-action-5 will not be imported because TopologyAction must have a property reference with http://energy.referencedata.eu/PropertyReference/Switch.open value, but it was: http://energy.referencedata.eu/PropertyReference/RotatingMachine.p");
4444
NcCracCreationTestUtil.assertRaNotImported(cracCreationContext, "remedial-action-6", ImportStatus.INCONSISTENCY_IN_DATA, "Remedial action remedial-action-6 will not be imported because StaticPropertyRange must have a property reference with http://energy.referencedata.eu/PropertyReference/Switch.open value, but it was: http://energy.referencedata.eu/PropertyReference/RotatingMachine.p");
45-
NcCracCreationTestUtil.assertRaNotImported(cracCreationContext, "remedial-action-7", ImportStatus.INCONSISTENCY_IN_DATA, "Remedial action remedial-action-7 will not be imported because the RelativeDirectionKind is http://entsoe.eu/ns/nc#RelativeDirectionKind.up but should be absolute");
46-
NcCracCreationTestUtil.assertRaNotImported(cracCreationContext, "remedial-action-8", ImportStatus.INCONSISTENCY_IN_DATA, "Remedial action remedial-action-8 will not be imported because the ValueOffsetKind is http://entsoe.eu/ns/nc#ValueOffsetKind.incrementalPercentage but should be none");
45+
NcCracCreationTestUtil.assertRaNotImported(cracCreationContext, "remedial-action-7", ImportStatus.INCONSISTENCY_IN_DATA, "Remedial action remedial-action-7 will not be imported because the RelativeDirectionKind is http://entsoe.eu/ns/nc#RelativeDirectionKind.up but should be none");
46+
NcCracCreationTestUtil.assertRaNotImported(cracCreationContext, "remedial-action-8", ImportStatus.INCONSISTENCY_IN_DATA, "Remedial action remedial-action-8 will not be imported because the ValueOffsetKind is http://entsoe.eu/ns/nc#ValueOffsetKind.incrementalPercentage but should be absolute");
4747
NcCracCreationTestUtil.assertRaNotImported(cracCreationContext, "remedial-action-9", ImportStatus.INCONSISTENCY_IN_DATA, "Remedial action remedial-action-9 will not be imported because there is no StaticPropertyRange linked to elementary action topology-action-9");
4848
NcCracCreationTestUtil.assertRaNotImported(cracCreationContext, "remedial-action-10", ImportStatus.INCONSISTENCY_IN_DATA, "Remedial action remedial-action-10 will not be imported because the normalValue is 2.0 which does not define a proper action type (open 1 / close 0)");
4949
NcCracCreationTestUtil.assertRaNotImported(cracCreationContext, "remedial-action-11", ImportStatus.INCONSISTENCY_IN_DATA, "Remedial action remedial-action-11 will not be imported because several conflictual StaticPropertyRanges are linked to elementary action topology-action-11");

0 commit comments

Comments
 (0)