Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: CGMES exporter and importer return a correct list in getParameters() #2008

Merged
merged 2 commits into from
Mar 14, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,21 @@ public String getFormat() {
}

public static final String BASE_NAME = "iidm.export.cgmes.base-name";
public static final String CIM_VERSION = "iidm.export.cgmes.cim-version";
public static final String EXPORT_BOUNDARY_POWER_FLOWS = "iidm.export.cgmes.export-boundary-power-flows";
public static final String EXPORT_POWER_FLOWS_FOR_SWITCHES = "iidm.export.cgmes.export-power-flows-for-switches";
public static final String PROFILES = "iidm.export.cgmes.profiles";
public static final String CIM_VERSION = "iidm.export.cgmes.cim-version";

private static final Parameter BASE_NAME_PARAMETER = new Parameter(
BASE_NAME,
ParameterType.STRING,
"Basename for output files",
null);
private static final Parameter CIM_VERSION_PARAMETER = new Parameter(
CIM_VERSION,
ParameterType.STRING,
"CIM version to export",
null);
private static final Parameter EXPORT_BOUNDARY_POWER_FLOWS_PARAMETER = new Parameter(
EXPORT_BOUNDARY_POWER_FLOWS,
ParameterType.BOOLEAN,
Expand All @@ -135,14 +140,10 @@ public String getFormat() {
ParameterType.STRING_LIST,
"Profiles to export",
List.of("EQ", "TP", "SSH", "SV"));
private static final Parameter CIM_VERSION_PARAMETER = new Parameter(
CIM_VERSION,
ParameterType.STRING,
"CIM version to export",
null);

private static final List<Parameter> STATIC_PARAMETERS = List.of(
BASE_NAME_PARAMETER,
CIM_VERSION_PARAMETER,
EXPORT_BOUNDARY_POWER_FLOWS_PARAMETER,
EXPORT_POWER_FLOWS_FOR_SWITCHES_PARAMETER,
PROFILES_PARAMETER);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,12 +329,13 @@ private void copyStream(ReadOnlyDataSource from, DataSource to, String fromName,
CHANGE_SIGN_FOR_SHUNT_REACTIVE_POWER_FLOW_INITIAL_STATE_PARAMETER,
CONVERT_BOUNDARY_PARAMETER,
CONVERT_SV_INJECTIONS_PARAMETER,
CREATE_CGMES_EXPORT_MAPPING_PARAMETER,
CREATE_BUSBAR_SECTION_FOR_EVERY_CONNECTIVITY_NODE_PARAMETER,
CREATE_CGMES_EXPORT_MAPPING_PARAMETER,
ENSURE_ID_ALIAS_UNICITY_PARAMETER,
IMPORT_CONTROL_AREAS_PARAMETER,
POST_PROCESSORS_PARAMETER,
POWSYBL_TRIPLESTORE_PARAMETER,
PROFILE_FOR_INITIAL_VALUES_SHUNT_SECTIONS_TAP_POSITIONS_PARAMETER,
STORE_CGMES_CONVERSION_CONTEXT_AS_NETWORK_EXTENSION_PARAMETER,
STORE_CGMES_MODEL_AS_NETWORK_EXTENSION_PARAMETER);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class CgmesExportContextTest {
public void testExporter() {
var exporter = new CgmesExport();
assertEquals("ENTSO-E CGMES version 2.4.15", exporter.getComment());
assertEquals(4, exporter.getParameters().size());
assertEquals(5, exporter.getParameters().size());
}

@Test
Expand Down