Skip to content

Commit

Permalink
change name parameter + add copyrigth/author
Browse files Browse the repository at this point in the history
Signed-off-by: vmouradian <[email protected]>
  • Loading branch information
vmouradian committed Dec 23, 2024
1 parent a8f0dab commit 74c7960
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public ContingencyLoadFlowParameters(boolean distributedSlack, boolean areaInter

@Override
public String getName() {
return "contingency-parameters";
return "contingency-load-flow-parameters";
}

public boolean isDistributedSlack() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* Copyright (c) 2024, Coreso SA (https://www.coreso.eu/) and TSCNET Services GmbH (https://www.tscnet.eu/)
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
* SPDX-License-Identifier: MPL-2.0
*/
package com.powsybl.openloadflow.sa.extensions;

import com.fasterxml.jackson.annotation.JsonIgnore;
Expand All @@ -13,12 +20,15 @@

import java.io.IOException;

/**
* @author Valentin Mouradian {@literal <valentin.mouradian at artelys.com>}
*/
@AutoService(ExtensionJsonSerializer.class)
public class ContingencyLoadFlowParametersJsonSerializer implements ExtensionJsonSerializer<Contingency, ContingencyLoadFlowParameters> {

@Override
public String getExtensionName() {
return "contingency-parameters";
return "contingency-load-flow-parameters";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void testContingencyLoadFlowParametersExtension() {

ContingencyLoadFlowParameters contingencyLoadFlowParameters = contingency.getExtension(ContingencyLoadFlowParameters.class);

assertEquals(contingencyLoadFlowParameters, contingency.getExtensionByName("contingency-parameters"));
assertEquals(contingencyLoadFlowParameters, contingency.getExtensionByName("contingency-load-flow-parameters"));
assertFalse(contingencyLoadFlowParameters.isDistributedSlack());
assertTrue(contingencyLoadFlowParameters.isAreaInterchangeControl());
assertEquals(LoadFlowParameters.BalanceType.PROPORTIONAL_TO_LOAD, contingencyLoadFlowParameters.getBalanceType());
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/contingencies.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type" : "BRANCH"
} ],
"extensions" : {
"contingency-parameters" : {
"contingency-load-flow-parameters" : {
"distributedSlack" : false,
"areaInterchangeControl" : true,
"balanceType" : "PROPORTIONAL_TO_LOAD"
Expand Down

0 comments on commit 74c7960

Please sign in to comment.