-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Fsv handling in integration test Curve renaming 2 Signed-off-by: lisrte <[email protected]>
- Loading branch information
Showing
30 changed files
with
243 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 12 additions & 3 deletions
15
docs/dynamic_simulation/curves-dsl.md → ...ynamic_simulation/output-variables-dsl.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
dynawo-simulation/src/main/java/com/powsybl/dynawo/outputvariables/CsvFsvParser.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/** | ||
* Copyright (c) 2023, RTE (http://www.rte-france.com/) | ||
* 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.dynawo.outputvariables; | ||
|
||
import com.powsybl.dynawo.commons.AbstractCsvParser; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import java.util.Optional; | ||
|
||
/** | ||
* @author Laurent Issertial {@literal <laurent.issertial at rte-france.com>} | ||
*/ | ||
public final class CsvFsvParser extends AbstractCsvParser<FsvEntry> { | ||
|
||
private static final Logger LOGGER = LoggerFactory.getLogger(CsvFsvParser.class); | ||
|
||
private static final int NB_COLUMNS = 4; | ||
|
||
public CsvFsvParser() { | ||
this(DEFAULT_SEPARATOR); | ||
} | ||
|
||
public CsvFsvParser(char separator) { | ||
super(separator, true); | ||
} | ||
|
||
@Override | ||
protected Optional<FsvEntry> createEntry(String[] tokens) { | ||
String model = tokens[0]; | ||
String variable = tokens[1]; | ||
String value = tokens[2]; | ||
if (model == null || variable == null || value == null) { | ||
LOGGER.warn("Inconsistent FSV entry (model: '{}', variable: '{}', value: '{}')", model, variable, value); | ||
} else { | ||
try { | ||
double valueD = Double.parseDouble(value); | ||
return Optional.of(new FsvEntry(model, variable, valueD)); | ||
} catch (NumberFormatException e) { | ||
LOGGER.warn("Inconsistent value entry '{}'", value); | ||
} | ||
} | ||
return Optional.empty(); | ||
} | ||
|
||
@Override | ||
protected boolean hasCorrectNbColumns(int tokensSize) { | ||
return tokensSize == NB_COLUMNS; | ||
} | ||
|
||
@Override | ||
protected int getNbColumns() { | ||
return NB_COLUMNS; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
dynawo-simulation/src/main/java/com/powsybl/dynawo/outputvariables/FsvEntry.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/** | ||
* Copyright (c) 2024, RTE (http://www.rte-france.com/) | ||
* 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.dynawo.outputvariables; | ||
|
||
/** | ||
* @author Laurent Issertial {@literal <laurent.issertial at rte-france.com>} | ||
*/ | ||
public record FsvEntry(String model, String variable, double value) { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.