-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Christian Biasuzzi <[email protected]> Signed-off-by: Sylvain Leclerc <[email protected]> Co-authored-by: Christian Biasuzzi <[email protected]> Co-authored-by: Sylvain Leclerc <[email protected]>
- Loading branch information
Showing
4 changed files
with
40 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# | ||
# Copyright (c) 2022, 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/. | ||
# | ||
import pypowsybl as pp | ||
|
||
from pypowsybl.loadflow import ( | ||
run_ac, | ||
ComponentStatus | ||
) | ||
|
||
|
||
def test_dynaflow_ieee9(): | ||
""" | ||
Running that test requires to have installed dynaflow, | ||
and configured its path in your config.yml. | ||
""" | ||
network = pp.network.create_ieee9() | ||
assert network.get_generators()['p'].isna().all() # No data for computed P | ||
|
||
res = run_ac(network, provider='DynaFlow') | ||
assert res[0].status == ComponentStatus.CONVERGED | ||
# checks that computed P is almost equal to target_p | ||
gens = network.get_generators() | ||
assert max(abs(gens.p + gens.target_p)) < 0.1 | ||
|
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