Skip to content

Commit

Permalink
Test coefficient check in OffsetTransformer
Browse files Browse the repository at this point in the history
  • Loading branch information
p-snft committed Jul 3, 2024
1 parent 6a87fb4 commit 9290ab2
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/test_components/test_offset_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,19 @@ def test_invalid_normed_offset():
)


def test_wrong_number_of_coefficients():
bus1 = solph.Bus()
bus2 = solph.Bus()
with pytest.raises(ValueError, match="Two coefficients"):
solph.components.OffsetTransformer(
inputs={
bus1: solph.Flow(nominal_value=2, nonconvex=solph.NonConvex())
},
outputs={bus2: solph.Flow()},
coefficients=(1, 2, 3),
)


def test_OffsetConverter_single_input_output_ref_output():
num_in = 1
num_out = 1
Expand Down

0 comments on commit 9290ab2

Please sign in to comment.