Skip to content

Commit 28e9ee9

Browse files
author
Naledi EL CHEIKH
committed
deleted tests for c functions
Signed-off-by: Naledi EL CHEIKH <[email protected]>
1 parent 6a50f50 commit 28e9ee9

File tree

3 files changed

+8
-258
lines changed

3 files changed

+8
-258
lines changed

java/pypowsybl/src/test/java/com/powsybl/python/security/SecurityAnalysisTest.java

+1-12
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import java.util.List;
3333

3434
import static org.assertj.core.api.Assertions.assertThat;
35+
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
3536

3637
/**
3738
* @author Etienne Lesot {@literal <etienne.lesot at rte-france.com>}
@@ -87,16 +88,4 @@ void testSecurityAnalysis() {
8788
Assertions.assertThat(series.get(1).getStrings())
8889
.containsExactly("NHV1_NHV2_2", "VLHV1");
8990
}
90-
91-
@Test
92-
void testToAddActionsAndOperatorStrategiesFromJsonFile() throws IOException {
93-
SecurityAnalysisContext analysisContext = new SecurityAnalysisContext();
94-
fileSystem = Jimfs.newFileSystem(Configuration.unix());
95-
96-
Files.copy(getClass().getResourceAsStream("/ActionFileTestV1.0.json"), fileSystem.getPath("/ActionFileTestV1.0.json"));
97-
analysisContext.addActionFromJsonFile(fileSystem.getPath("/ActionFileTestV1.0.json"));
98-
99-
Files.copy(getClass().getResourceAsStream("/OperatorStrategyFileTestV1.0.json"), fileSystem.getPath("/OperatorStrategyFileTestV1.0.json"));
100-
analysisContext.addOperatorStrategyFromJsonFile(fileSystem.getPath("/OperatorStrategyFileTestV1.0.json"));
101-
}
10291
}

java/pypowsybl/src/test/resources/ActionFileTestV1.0.json

+4-183
Original file line numberDiff line numberDiff line change
@@ -3,191 +3,12 @@
33
"actions" : [ {
44
"type" : "SWITCH",
55
"id" : "id1",
6-
"switchId" : "switchId1",
6+
"switchId" : "S1VL1_LD1_BREAKER",
77
"open" : true
88
}, {
9-
"type" : "MULTIPLE_ACTIONS",
9+
"type" : "SWITCH",
1010
"id" : "id2",
11-
"actions" : [ {
12-
"type" : "SWITCH",
13-
"id" : "id3",
14-
"switchId" : "switchId2",
15-
"open" : true
16-
} ]
17-
}, {
18-
"type" : "TERMINALS_CONNECTION",
19-
"id" : "id3",
20-
"elementId" : "lineId3",
21-
"open" : true
22-
}, {
23-
"type" : "TERMINALS_CONNECTION",
24-
"id" : "id4",
25-
"elementId" : "lineId4",
26-
"open" : false
27-
}, {
28-
"type" : "PHASE_TAP_CHANGER_TAP_POSITION",
29-
"id" : "id5",
30-
"transformerId" : "transformerId1",
31-
"value" : 5,
32-
"relativeValue" : true,
33-
"side" : "TWO"
34-
}, {
35-
"type" : "PHASE_TAP_CHANGER_TAP_POSITION",
36-
"id" : "id6",
37-
"transformerId" : "transformerId2",
38-
"value" : 12,
39-
"relativeValue" : false
40-
}, {
41-
"type" : "PHASE_TAP_CHANGER_TAP_POSITION",
42-
"id" : "id7",
43-
"transformerId" : "transformerId3",
44-
"value" : -5,
45-
"relativeValue" : true,
46-
"side" : "ONE"
47-
}, {
48-
"type" : "PHASE_TAP_CHANGER_TAP_POSITION",
49-
"id" : "id8",
50-
"transformerId" : "transformerId3",
51-
"value" : 2,
52-
"relativeValue" : false,
53-
"side" : "THREE"
54-
}, {
55-
"type" : "GENERATOR",
56-
"id" : "id9",
57-
"generatorId" : "generatorId1",
58-
"activePowerRelativeValue" : true,
59-
"activePowerValue" : 100.0
60-
}, {
61-
"type" : "GENERATOR",
62-
"id" : "id10",
63-
"generatorId" : "generatorId2",
64-
"voltageRegulatorOn" : true,
65-
"targetV" : 225.0
66-
}, {
67-
"type" : "GENERATOR",
68-
"id" : "id11",
69-
"generatorId" : "generatorId2",
70-
"voltageRegulatorOn" : false,
71-
"targetQ" : 400.0
72-
}, {
73-
"type" : "LOAD",
74-
"id" : "id12",
75-
"loadId" : "loadId1",
76-
"relativeValue" : false,
77-
"activePowerValue" : 50.0
78-
}, {
79-
"type" : "LOAD",
80-
"id" : "id13",
81-
"loadId" : "loadId1",
82-
"relativeValue" : true,
83-
"reactivePowerValue" : 5.0
84-
}, {
85-
"type" : "DANGLING_LINE",
86-
"id" : "id17",
87-
"danglingLineId" : "dlId1",
88-
"relativeValue" : true,
89-
"reactivePowerValue" : 5.0
90-
}, {
91-
"type" : "RATIO_TAP_CHANGER_TAP_POSITION",
92-
"id" : "id14",
93-
"transformerId" : "transformerId4",
94-
"value" : 2,
95-
"relativeValue" : false,
96-
"side" : "THREE"
97-
}, {
98-
"type" : "RATIO_TAP_CHANGER_TAP_POSITION",
99-
"id" : "id15",
100-
"transformerId" : "transformerId5",
101-
"value" : 1,
102-
"relativeValue" : true
103-
}, {
104-
"type" : "RATIO_TAP_CHANGER_REGULATION",
105-
"id" : "id16",
106-
"transformerId" : "transformerId5",
107-
"regulating" : true,
108-
"side" : "THREE"
109-
}, {
110-
"type" : "PHASE_TAP_CHANGER_REGULATION",
111-
"id" : "id17",
112-
"transformerId" : "transformerId5",
113-
"regulating" : true,
114-
"side" : "ONE",
115-
"regulationMode" : "ACTIVE_POWER_CONTROL",
116-
"regulationValue" : 10.0
117-
}, {
118-
"type" : "PHASE_TAP_CHANGER_REGULATION",
119-
"id" : "id18",
120-
"transformerId" : "transformerId6",
121-
"regulating" : false,
122-
"side" : "ONE"
123-
}, {
124-
"type" : "PHASE_TAP_CHANGER_REGULATION",
125-
"id" : "id19",
126-
"transformerId" : "transformerId6",
127-
"regulating" : true,
128-
"side" : "ONE",
129-
"regulationMode" : "ACTIVE_POWER_CONTROL",
130-
"regulationValue" : 15.0
131-
}, {
132-
"type" : "RATIO_TAP_CHANGER_REGULATION",
133-
"id" : "id20",
134-
"transformerId" : "transformerId5",
135-
"regulating" : true,
136-
"targetV" : 90.0
137-
}, {
138-
"type" : "RATIO_TAP_CHANGER_REGULATION",
139-
"id" : "id21",
140-
"transformerId" : "transformerId5",
141-
"regulating" : false,
142-
"side" : "THREE"
143-
}, {
144-
"type" : "HVDC",
145-
"id" : "id22",
146-
"hvdcId" : "hvdc1",
147-
"acEmulationEnabled" : false
148-
}, {
149-
"type" : "HVDC",
150-
"id" : "id23",
151-
"hvdcId" : "hvdc2",
152-
"acEmulationEnabled" : true
153-
}, {
154-
"type" : "HVDC",
155-
"id" : "id24",
156-
"hvdcId" : "hvdc2",
157-
"acEmulationEnabled" : true,
158-
"converterMode" : "SIDE_1_RECTIFIER_SIDE_2_INVERTER",
159-
"droop" : 121.0,
160-
"p0" : 42.0,
161-
"relativeValue" : false
162-
}, {
163-
"type" : "HVDC",
164-
"id" : "id25",
165-
"hvdcId" : "hvdc1",
166-
"acEmulationEnabled" : false,
167-
"activePowerSetpoint" : 12.0,
168-
"relativeValue" : true
169-
}, {
170-
"type" : "SHUNT_COMPENSATOR_POSITION",
171-
"id" : "id22",
172-
"shuntCompensatorId" : "shuntId1",
173-
"sectionCount" : 5
174-
}, {
175-
"type" : "STATIC_VAR_COMPENSATOR",
176-
"id" : "id23",
177-
"staticVarCompensatorId" : "svc",
178-
"regulationMode" : "VOLTAGE",
179-
"voltageSetpoint" : 56.0
180-
}, {
181-
"type" : "STATIC_VAR_COMPENSATOR",
182-
"id" : "id24",
183-
"staticVarCompensatorId" : "svc",
184-
"regulationMode" : "REACTIVE_POWER",
185-
"reactivePowerSetpoint" : 120.0
186-
}, {
187-
"type" : "TERMINALS_CONNECTION",
188-
"id" : "id4",
189-
"elementId" : "transformerId25",
190-
"side" : "THREE",
11+
"switchId" : "S1VL2_BBS2_COUPLER_DISCONNECTOR",
19112
"open" : true
192-
} ]
13+
}]
19314
}

java/pypowsybl/src/test/resources/OperatorStrategyFileTestV1.0.json

+3-63
Original file line numberDiff line numberDiff line change
@@ -3,73 +3,13 @@
33
"operatorStrategies" : [ {
44
"id" : "id1",
55
"contingencyContextType" : "SPECIFIC",
6-
"contingencyId" : "contingencyId1",
6+
"contingencyId" : "First contingency",
77
"conditionalActions" : [ {
88
"id" : "stage1",
99
"condition" : {
1010
"type" : "TRUE_CONDITION"
1111
},
12-
"actionIds" : [ "actionId1", "actionId2", "actionId3" ]
12+
"actionIds" : [ "id1", "id2" ]
1313
} ]
14-
}, {
15-
"id" : "id2",
16-
"contingencyContextType" : "SPECIFIC",
17-
"contingencyId" : "contingencyId2",
18-
"conditionalActions" : [ {
19-
"id" : "stage1",
20-
"condition" : {
21-
"type" : "ANY_VIOLATION_CONDITION"
22-
},
23-
"actionIds" : [ "actionId4" ]
24-
} ]
25-
}, {
26-
"id" : "id3",
27-
"contingencyContextType" : "SPECIFIC",
28-
"contingencyId" : "contingencyId1",
29-
"conditionalActions" : [ {
30-
"id" : "stage1",
31-
"condition" : {
32-
"type" : "ANY_VIOLATION_CONDITION",
33-
"filters" : [ "CURRENT" ]
34-
},
35-
"actionIds" : [ "actionId1", "actionId3" ]
36-
} ]
37-
}, {
38-
"id" : "id4",
39-
"contingencyContextType" : "SPECIFIC",
40-
"contingencyId" : "contingencyId3",
41-
"conditionalActions" : [ {
42-
"id" : "stage1",
43-
"condition" : {
44-
"type" : "ANY_VIOLATION_CONDITION",
45-
"filters" : [ "LOW_VOLTAGE" ]
46-
},
47-
"actionIds" : [ "actionId1", "actionId2", "actionId4" ]
48-
} ]
49-
}, {
50-
"id" : "id5",
51-
"contingencyContextType" : "SPECIFIC",
52-
"contingencyId" : "contingencyId4",
53-
"conditionalActions" : [ {
54-
"id" : "stage1",
55-
"condition" : {
56-
"type" : "ALL_VIOLATION",
57-
"filters" : [ "HIGH_VOLTAGE" ],
58-
"violationIds" : [ "violation1", "violation2" ]
59-
},
60-
"actionIds" : [ "actionId1", "actionId5" ]
61-
} ]
62-
}, {
63-
"id" : "id6",
64-
"contingencyContextType" : "SPECIFIC",
65-
"contingencyId" : "contingencyId5",
66-
"conditionalActions" : [ {
67-
"id" : "stage1",
68-
"condition" : {
69-
"type" : "ALL_VIOLATION",
70-
"violationIds" : [ "violation1", "violation2" ]
71-
},
72-
"actionIds" : [ "actionId3" ]
73-
} ]
74-
} ]
14+
}]
7515
}

0 commit comments

Comments
 (0)