Skip to content

Commit

Permalink
Add asserts for mimo outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
henhuy committed Nov 15, 2023
1 parent 4f8bc91 commit a15161d
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def test_flow_shares():
es.add(
Sink(
label="heat_demand",
inputs={b_heat: Flow(fix=[100, 100], nominal_value=1)},
inputs={b_heat: Flow()},
)
)

Expand All @@ -136,11 +136,11 @@ def test_flow_shares():
# create result object
results = processing.convert_keys_to_strings(processing.results(om))

assert all(
results[("gas", "mimo")]["sequences"]["flow"].values[:-1]
== [100 * 0.8 * 1.2, 100 * 0.3 * 1.2]
)
assert all(
results[("hydro", "mimo")]["sequences"]["flow"].values[:-1]
== [100 * 0.2 * 1.3, 100 * 0.7 * 1.3]
)
assert results[("gas", "mimo")]["sequences"]["flow"].values[0] == 100 * 0.8 * 1.2
assert results[("gas", "mimo")]["sequences"]["flow"].values[1] == 100 * 0.3 * 1.2
assert results[("hydro", "mimo")]["sequences"]["flow"].values[0] == 100 * 0.2 * 1.3
assert results[("hydro", "mimo")]["sequences"]["flow"].values[1] == 100 * 0.7 * 1.3
assert results[("mimo", "electricity")]["sequences"]["flow"].values[0] == 100
assert results[("mimo", "electricity")]["sequences"]["flow"].values[1] == 100
assert results[("mimo", "heat")]["sequences"]["flow"].values[0] == 100
assert results[("mimo", "heat")]["sequences"]["flow"].values[1] == 100

0 comments on commit a15161d

Please sign in to comment.