Skip to content

Commit

Permalink
test add test for storage
Browse files Browse the repository at this point in the history
  • Loading branch information
rouille committed Sep 11, 2022
1 parent f973c78 commit d38502e
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion powersimdata/input/converter/tests/test_pypsa_to_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
import pytest
from pandas.testing import assert_series_equal

from powersimdata.input.change_table import ChangeTable
from powersimdata.input.converter.pypsa_to_grid import FromPyPSA
from powersimdata.input.exporter.export_to_pypsa import export_to_pypsa
from powersimdata.input.grid import Grid
from powersimdata.input.transform_grid import TransformGrid


@pytest.mark.skipif(find_spec("pypsa") is None, reason="Package PyPSA not available.")
Expand Down Expand Up @@ -36,7 +38,16 @@ def test_import_network_including_storages_from_pypsa_to_grid():
@pytest.mark.skipif(find_spec("pypsa") is None, reason="Package PyPSA not available.")
def test_import_exported_network():

ref = Grid("Western")
grid = Grid("Western")
ct = ChangeTable(grid)
storage = [
{"bus_id": 2021005, "capacity": 116.0},
{"bus_id": 2028827, "capacity": 82.5},
{"bus_id": 2028060, "capacity": 82.5},
]
ct.add_storage_capacity(storage)
ref = TransformGrid(grid, ct.ct).get_grid()

kwargs = dict(add_substations=True, add_load_shedding=False, add_all_columns=True)
n = export_to_pypsa(ref, **kwargs)
test = FromPyPSA(n, add_pypsa_cols=False)
Expand Down

0 comments on commit d38502e

Please sign in to comment.