-
Notifications
You must be signed in to change notification settings - Fork 3
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
Bump core 6.0.1 #34
Merged
Merged
Bump core 6.0.1 #34
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
47 changes: 47 additions & 0 deletions
47
open-reac/src/test/java/com/powsybl/openreac/parameters/output/ReactiveSlackOutputTest.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,47 @@ | ||
/** | ||
* 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.openreac.parameters.output; | ||
|
||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import java.io.BufferedReader; | ||
import java.io.IOException; | ||
import java.io.InputStream; | ||
import java.io.InputStreamReader; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
/** | ||
* @author Olivier Perrin {@literal <olivier.perrin at rte-france.com>} | ||
*/ | ||
class ReactiveSlackOutputTest { | ||
|
||
@Test | ||
void readTest() throws IOException { | ||
ReactiveSlackOutput output = new ReactiveSlackOutput(); | ||
try (InputStream input = getClass().getResourceAsStream("/mock_outputs/reactiveopf_results_reactive_slacks.csv"); | ||
InputStreamReader in = new InputStreamReader(input); | ||
BufferedReader reader = new BufferedReader(in)) { | ||
|
||
output.read(reader, null); | ||
assertEquals(2, output.getSlacks().size()); | ||
ReactiveSlackOutput.ReactiveSlack slack1 = output.getSlacks().get(0); | ||
ReactiveSlackOutput.ReactiveSlack slack2 = output.getSlacks().get(1); | ||
Assertions.assertAll( | ||
() -> assertEquals(1.6, slack1.getSlack(), 0.01), | ||
() -> assertEquals("slack1", slack1.getBusId()), | ||
() -> assertEquals("voltageLevel1", slack1.getVoltageLevelId()), | ||
() -> assertEquals(Double.NaN, slack2.getSlack()), | ||
() -> assertEquals("slack2", slack2.getBusId()), | ||
() -> assertEquals("voltageLevel2", slack2.getVoltageLevelId()) | ||
); | ||
} | ||
} | ||
|
||
} |
3 changes: 3 additions & 0 deletions
3
open-reac/src/test/resources/mock_outputs/reactiveopf_results_reactive_slacks.csv
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,3 @@ | ||
col1;col2;col3;col4;col5;col6; | ||
'a1';'b1';5.3;6.9;'slack1';'voltageLevel1'; | ||
'a2';'b2';1.2;-99999;'slack2';'voltageLevel2'; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a little difference here.
Previously, no exception was thrown when an
IOException
was thrown duringreadAllLines
.Now, no exception is thrown when the file is not a regular file (real file + read access on it), but if another
IOException
is thrown, it will be propagated as anUncheckedIOException
by the caller (seeAmplModelExecutionHandler.readCustomFiles
in powsybl-core). But I don't know if it can really happen.