Skip to content

Commit

Permalink
add test in generator creation
Browse files Browse the repository at this point in the history
Signed-off-by: Etienne LESOT <etienne.lesot@rte-france.com>
  • Loading branch information
EtienneLt committed Jan 11, 2024
1 parent 40be19a commit 951c7a4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/test_network_elements_creation.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,9 @@ def test_create_network_and_run_loadflow():
assert line.p1 == pytest.approx(100, abs=1e-1)
assert line.q1 == pytest.approx(9.7, abs=1e-1)

generator = n.get_generators().loc['GEN']
assert generator.regulated_element_id == 'LOAD'


def test_create_node_breaker_network_and_run_loadflow():
n = pn.create_empty()
Expand Down Expand Up @@ -605,7 +608,7 @@ def test_create_node_breaker_network_and_run_loadflow():

generators = pd.DataFrame.from_records(index='id', data=[
{'voltage_level_id': 'VL1', 'id': 'GEN', 'node': 3, 'target_p': 100, 'min_p': 0, 'max_p': 200,
'target_v': 400, 'voltage_regulator_on': True}
'target_v': 400, 'voltage_regulator_on': True, 'regulating_element_id': 'LOAD'}
])
n.create_generators(generators)

Expand All @@ -618,6 +621,9 @@ def test_create_node_breaker_network_and_run_loadflow():
assert line.p1 == pytest.approx(100, abs=1e-1)
assert line.q1 == pytest.approx(9.7, abs=1e-1)

generator = n.get_generators().loc['GEN']
assert generator.regulated_element_id == 'LOAD'


def test_create_limits():
net = pn.create_eurostag_tutorial_example1_network()
Expand Down

0 comments on commit 951c7a4

Please sign in to comment.