Skip to content

Commit 4ae5029

Browse files
committed
update LoadFlowProviderAPI (#1299)
Signed-off-by: Didier Vidal <[email protected]>
1 parent 6777681 commit 4ae5029

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
@@ -305,7 +305,7 @@ public Optional<Extension<LoadFlowParameters>> loadSpecificParameters(Map<String
305305
}
306306

307307
@Override
308-
public List<Parameter> getSpecificParameters() {
308+
public List<Parameter> getRawSpecificParameters() {
309309
return OpenLoadFlowParameters.SPECIFIC_PARAMETERS;
310310
}
311311

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
@@ -87,7 +87,9 @@ void testGetExtendedVoltageInitializer() {
8787
@Test
8888
void specificParametersTest() {
8989
OpenLoadFlowProvider provider = new OpenLoadFlowProvider();
90+
9091
assertEquals(80, provider.getSpecificParameters().size());
92+
9193
LoadFlowParameters parameters = new LoadFlowParameters();
9294

9395
provider.loadSpecificParameters(Collections.emptyMap())
@@ -114,7 +116,7 @@ void testCreateMapFromSpecificParameters() {
114116
long nullValueCOunt = parametersExt.toMap().values().stream().filter(Objects::isNull).count();
115117
assertEquals(80, map.size() + nullValueCOunt);
116118
assertEquals(2, nullValueCOunt); // debugDir and outerLoopNames are nullable
117-
assertEquals(provider.getSpecificParameters().size(), map.size() + nullValueCOunt);
119+
assertEquals(provider.getRawSpecificParameters().size(), map.size() + nullValueCOunt);
118120
}
119121

120122
@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)