@@ 206-222 (lines=17) @@ | ||
203 | ) |
|
204 | ||
205 | ||
206 | def test_invalid_normed_offset(): |
|
207 | bus1 = solph.Bus() |
|
208 | bus2 = solph.Bus() |
|
209 | with pytest.raises(ValueError, match="Normed offsets cannot be "): |
|
210 | solph.components.OffsetConverter( |
|
211 | inputs={ |
|
212 | bus1: solph.Flow( |
|
213 | nominal_capacity=2, nonconvex=solph.NonConvex() |
|
214 | ) |
|
215 | }, |
|
216 | outputs={bus2: solph.Flow()}, |
|
217 | conversion_factors={ |
|
218 | bus2: 2, |
|
219 | }, |
|
220 | normed_offsets={ |
|
221 | bus1: -0.2, |
|
222 | bus2: -0.5, |
|
223 | }, |
|
224 | ) |
|
225 | ||
@@ 187-202 (lines=16) @@ | ||
184 | assert oc.custom_properties["foo"] == "bar" |
|
185 | ||
186 | ||
187 | def test_invalid_conversion_factor(): |
|
188 | bus1 = solph.Bus() |
|
189 | bus2 = solph.Bus() |
|
190 | with pytest.raises(ValueError, match="Conversion factors cannot be "): |
|
191 | solph.components.OffsetConverter( |
|
192 | inputs={ |
|
193 | bus1: solph.Flow( |
|
194 | nominal_capacity=2, nonconvex=solph.NonConvex() |
|
195 | ) |
|
196 | }, |
|
197 | outputs={bus2: solph.Flow()}, |
|
198 | conversion_factors={ |
|
199 | bus1: 1, |
|
200 | bus2: 2, |
|
201 | }, |
|
202 | normed_offsets={bus2: -0.5}, |
|
203 | ) |
|
204 | ||
205 |