Skip to content

Commit 9681e41

Browse files
committed
Integrate powsybl-dependencies 2024.3.1 (#886)
Signed-off-by: Hugo KULESZA <hugo.kulesza@rte-france.com> (cherry picked from commit 72c6dfe)
1 parent 26b39e8 commit 9681e41

File tree

7 files changed

+29
-13
lines changed

7 files changed

+29
-13
lines changed

docs/user_guide/security.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ Information can be obtained on buses, branches and three windings transformers.
5252
.. doctest:: security.monitored_elements
5353
:options: +NORMALIZE_WHITESPACE
5454

55-
>>> network = pp.network.create_eurostag_tutorial_example1_network()
55+
>>> network = pp.network.create_eurostag_tutorial_example1_with_more_generators_network()
5656
>>> security_analysis = pp.security.create_analysis()
5757
>>> security_analysis.add_single_element_contingency('NHV1_NHV2_1', 'NHV1_NHV2_1')
58-
>>> security_analysis.add_single_element_contingency('NGEN_NHV1', 'NGEN_NHV1')
58+
>>> security_analysis.add_single_element_contingency('GEN', 'GEN')
5959
>>> security_analysis.add_monitored_elements(voltage_level_ids=['VLHV2'])
60-
>>> security_analysis.add_postcontingency_monitored_elements(branch_ids=['NHV1_NHV2_2'], contingency_ids=['NHV1_NHV2_1', 'NGEN_NHV1'])
61-
>>> security_analysis.add_postcontingency_monitored_elements(branch_ids=['NHV1_NHV2_1'], contingency_ids='NGEN_NHV1')
60+
>>> security_analysis.add_postcontingency_monitored_elements(branch_ids=['NHV1_NHV2_2'], contingency_ids=['NHV1_NHV2_1', 'GEN'])
61+
>>> security_analysis.add_postcontingency_monitored_elements(branch_ids=['NHV1_NHV2_1'], contingency_ids='GEN')
6262
>>> security_analysis.add_precontingency_monitored_elements(branch_ids=['NHV1_NHV2_2'])
6363
>>> results = security_analysis.run_ac(network)
6464
>>> results.bus_results
@@ -69,8 +69,8 @@ Information can be obtained on buses, branches and three windings transformers.
6969
p1 q1 i1 p2 q2 i2 flow_transfer
7070
contingency_id operator_strategy_id branch_id
7171
NHV1_NHV2_2 302.44 98.74 456.77 -300.43 -137.19 488.99 NaN
72-
NGEN_NHV1 NHV1_NHV2_1 301.06 0.00 302.80 -300.19 -116.60 326.75 NaN
73-
NHV1_NHV2_2 301.06 0.00 302.80 -300.19 -116.60 326.75 NaN
72+
GEN NHV1_NHV2_1 302.44 98.74 456.77 -300.43 -137.19 488.99 NaN
73+
NHV1_NHV2_2 302.44 98.74 456.77 -300.43 -137.19 488.99 NaN
7474
NHV1_NHV2_1 NHV1_NHV2_2 610.56 334.06 1,008.93 -601.00 -285.38 1,047.83 NaN
7575

7676
It also possible to get flow transfer on monitored branches in case of N-1 branch contingencies:

java/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
<junit-jupiter.version>5.10.0</junit-jupiter.version>
6969
<mapdb.version>3.0.8</mapdb.version>
7070
<maven-dependency-plugin.version>3.6.0</maven-dependency-plugin.version>
71-
<powsybl-dependencies.version>2024.3.0</powsybl-dependencies.version>
71+
<powsybl-dependencies.version>2024.3.1</powsybl-dependencies.version>
7272
<powsybl-open-reac.version>0.7.0</powsybl-open-reac.version>
7373
<zstdjni.version>1.5.5-3</zstdjni.version>
7474
</properties>

java/src/main/java/com/powsybl/python/network/Networks.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,11 @@ public static Network createEurostagTutorialExample1() {
9898
return fix(network);
9999
}
100100

101+
public static Network createEurostagTutorialExampleWithMoreGenerators() {
102+
Network network = EurostagTutorialExample1Factory.createWithMoreGenerators();
103+
return fix(network);
104+
}
105+
101106
public static Network createEurostagTutorialExample1WithFixedCurrentLimits() {
102107
Network network = EurostagTutorialExample1Factory.createWithFixedCurrentLimits();
103108
return fix(network);

java/src/main/java/com/powsybl/python/network/PyPowsyblNetworksProvider.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public class PyPowsyblNetworksProvider implements Networks.NetworksProvider {
3737
factory("four_substations_node_breaker", (Supplier<Network>) FourSubstationsNodeBreakerFactory::create),
3838
factory("four_substations_node_breaker_with_extensions", (Supplier<Network>) FourSubstationsNodeBreakerWithExtensionsFactory::create),
3939
factory("eurostag_tutorial_example1", Networks::createEurostagTutorialExample1WithFixedCurrentLimits),
40+
factory("eurostag_tutorial_example1_with_more_generators", Networks::createEurostagTutorialExampleWithMoreGenerators),
4041
factory("eurostag_tutorial_example1_with_power_limits", Networks::createEurostagTutorialExample1WithFixedPowerLimits),
4142
factory("eurostag_tutorial_example1_with_apc_extension", Networks::createEurostagTutorialExample1WithApcExtension),
4243
factory("eurostag_tutorial_example1_with_entsoe_category", Networks::eurostagWithEntsoeCategory),

pypowsybl/network/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
create_ieee118,
2727
create_ieee300,
2828
create_eurostag_tutorial_example1_network,
29+
create_eurostag_tutorial_example1_with_more_generators_network,
2930
create_eurostag_tutorial_example1_with_power_limits_network,
3031
create_eurostag_tutorial_example1_with_tie_lines_and_areas,
3132
create_four_substations_node_breaker_network_with_extensions,

pypowsybl/network/impl/network_creation_util.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,15 @@ def create_eurostag_tutorial_example1_network() -> Network:
102102
"""
103103
return _create_network('eurostag_tutorial_example1')
104104

105+
def create_eurostag_tutorial_example1_with_more_generators_network() -> Network:
106+
"""
107+
Create an instance of example 1 network of Eurostag tutorial, with a second generator
108+
109+
Returns:
110+
a new instance of example 1 network of Eurostag tutorial with a second generator
111+
"""
112+
return _create_network('eurostag_tutorial_example1_with_more_generators')
113+
105114

106115
def create_eurostag_tutorial_example1_with_power_limits_network() -> Network:
107116
"""

tests/test_security_analysis.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,13 @@ def test_variant():
7878

7979

8080
def test_monitored_elements():
81-
n = pp.network.create_eurostag_tutorial_example1_network()
81+
n = pp.network.create_eurostag_tutorial_example1_with_more_generators_network()
8282
sa = pp.security.create_analysis()
8383
sa.add_single_element_contingency('NHV1_NHV2_1', 'NHV1_NHV2_1')
84-
sa.add_single_element_contingency('NGEN_NHV1', 'NGEN_NHV1')
84+
sa.add_single_element_contingency('GEN', 'GEN')
8585
sa.add_monitored_elements(voltage_level_ids=['VLHV2'])
86-
sa.add_postcontingency_monitored_elements(branch_ids=['NHV1_NHV2_2'], contingency_ids=['NHV1_NHV2_1', 'NGEN_NHV1'])
87-
sa.add_postcontingency_monitored_elements(branch_ids=['NHV1_NHV2_1'], contingency_ids='NGEN_NHV1')
86+
sa.add_postcontingency_monitored_elements(branch_ids=['NHV1_NHV2_2'], contingency_ids=['NHV1_NHV2_1', 'GEN'])
87+
sa.add_postcontingency_monitored_elements(branch_ids=['NHV1_NHV2_1'], contingency_ids='GEN')
8888
sa.add_precontingency_monitored_elements(branch_ids=['NHV1_NHV2_2'])
8989

9090
sa_result = sa.run_ac(n)
@@ -100,8 +100,8 @@ def test_monitored_elements():
100100
assert branch_results.columns.tolist() == ['p1', 'q1', 'i1', 'p2', 'q2', 'i2', 'flow_transfer']
101101
assert len(branch_results) == 4
102102
assert branch_results.loc['', '', 'NHV1_NHV2_2']['p1'] == pytest.approx(302.44, abs=1e-2)
103-
assert branch_results.loc['NGEN_NHV1', '', 'NHV1_NHV2_1']['p1'] == pytest.approx(301.05, abs=1e-2)
104-
assert branch_results.loc['NGEN_NHV1', '', 'NHV1_NHV2_2']['p1'] == pytest.approx(301.05, abs=1e-2)
103+
assert branch_results.loc['GEN', '', 'NHV1_NHV2_1']['p1'] == pytest.approx(302.44, abs=1e-2)
104+
assert branch_results.loc['GEN', '', 'NHV1_NHV2_2']['p1'] == pytest.approx(302.44, abs=1e-2)
105105
assert branch_results.loc['NHV1_NHV2_1', '', 'NHV1_NHV2_2']['p1'] == pytest.approx(610.56, abs=1e-2)
106106

107107

0 commit comments

Comments
 (0)