Skip to content

Commit 6250ea7

Browse files
authored
update LoadFlowProviderAPI (#1299)
Signed-off-by: Didier Vidal <[email protected]>
1 parent 00c64a6 commit 6250ea7

File tree

5 files changed

+8
-6
lines changed

5 files changed

+8
-6
lines changed

src/main/java/com/powsybl/openloadflow/OpenLoadFlowProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ public Optional<Extension<LoadFlowParameters>> loadSpecificParameters(Map<String
313313
}
314314

315315
@Override
316-
public List<Parameter> getSpecificParameters() {
316+
public List<Parameter> getRawSpecificParameters() {
317317
return OpenLoadFlowParameters.SPECIFIC_PARAMETERS;
318318
}
319319

src/test/java/com/powsybl/openloadflow/OpenLoadFlowParametersTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ void testCompareParameters() {
391391
@Test
392392
void testEqualsCloneAndUpdate() {
393393
OpenLoadFlowProvider provider = new OpenLoadFlowProvider();
394-
provider.getSpecificParameters().forEach(sp -> {
394+
provider.getRawSpecificParameters().forEach(sp -> {
395395
var p1 = new LoadFlowParameters();
396396
var p2 = new LoadFlowParameters();
397397
var pe1 = OpenLoadFlowParameters.create(p1);
@@ -459,7 +459,7 @@ void testEqualsCloneAndUpdate() {
459459
void testSerializationRoundTrip() {
460460
Set<String> nullableParams = Set.of("debugDir", "outerLoopNames");
461461
OpenLoadFlowProvider provider = new OpenLoadFlowProvider();
462-
provider.getSpecificParameters().forEach(sp -> {
462+
provider.getRawSpecificParameters().forEach(sp -> {
463463
LoadFlowParameters p1 = new LoadFlowParameters();
464464
OpenLoadFlowParameters e1 = OpenLoadFlowParameters.create(p1);
465465
List<String> vals;

src/test/java/com/powsybl/openloadflow/OpenLoadFlowProviderTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ void testGetExtendedVoltageInitializer() {
8585
@Test
8686
void specificParametersTest() {
8787
OpenLoadFlowProvider provider = new OpenLoadFlowProvider();
88+
8889
assertEquals(79, provider.getSpecificParameters().size());
90+
8991
LoadFlowParameters parameters = new LoadFlowParameters();
9092

9193
provider.loadSpecificParameters(Collections.emptyMap())
@@ -112,7 +114,7 @@ void testCreateMapFromSpecificParameters() {
112114
long nullValueCOunt = parametersExt.toMap().values().stream().filter(Objects::isNull).count();
113115
assertEquals(79, map.size() + nullValueCOunt);
114116
assertEquals(2, nullValueCOunt); // debugDir and outerLoopNames are nullable
115-
assertEquals(provider.getSpecificParameters().size(), map.size() + nullValueCOunt);
117+
assertEquals(provider.getRawSpecificParameters().size(), map.size() + nullValueCOunt);
116118
}
117119

118120
@Test

src/test/java/com/powsybl/openloadflow/ac/solver/AcSolverFactoryTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public AcSolver create(LfNetwork network, AcLoadFlowParameters parameters, Equat
107107
@Test
108108
void testAcSolverTypeParam() {
109109
OpenLoadFlowProvider provider = new OpenLoadFlowProvider();
110-
Parameter acSolverType = provider.getSpecificParameters().stream().filter(p -> p.getName().equals(OpenLoadFlowParameters.AC_SOLVER_TYPE_PARAM_NAME)).findFirst().orElseThrow();
110+
Parameter acSolverType = provider.getRawSpecificParameters().stream().filter(p -> p.getName().equals(OpenLoadFlowParameters.AC_SOLVER_TYPE_PARAM_NAME)).findFirst().orElseThrow();
111111
assertEquals("NEWTON_RAPHSON", acSolverType.getDefaultValue());
112112
assertEquals(List.of("AC_SOLVER_MOCK", "FAST_DECOUPLED", "NEWTON_KRYLOV", "NEWTON_RAPHSON"), acSolverType.getPossibleValues());
113113
}

src/test/java/com/powsybl/openloadflow/sa/extensions/OpenSecurityAnalysisExtensionsTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import com.powsybl.commons.test.AbstractSerDeTest;
1414
import com.powsybl.contingency.BranchContingency;
1515
import com.powsybl.contingency.Contingency;
16-
import com.powsybl.contingency.contingency.list.DefaultContingencyList;
16+
import com.powsybl.contingency.list.DefaultContingencyList;
1717
import com.powsybl.contingency.json.ContingencyJsonModule;
1818
import com.powsybl.loadflow.LoadFlowParameters;
1919
import com.powsybl.openloadflow.OpenLoadFlowParameters;

0 commit comments

Comments
 (0)