Code Duplication    Length = 29-29 lines in 4 locations

tests/test_components/test_offset_converter.py 4 locations

@@ 338-366 (lines=29) @@
335
    )
336
337
338
def test_OffsetConverter_single_input_output_ref_input_eta_decreasing():
339
    num_in = 1
340
    num_out = 1
341
    es = create_energysystem_stub(num_in, num_out)
342
343
    nominal_capacity = 10
344
    minimal_value = 3
345
346
    eta_at_nom = {es.groups["bus output 0"]: 0.5}
347
    eta_at_min = {es.groups["bus output 0"]: 0.7}
348
349
    add_OffsetConverter(
350
        es,
351
        es.groups["bus input 0"],
352
        nominal_capacity,
353
        minimal_value,
354
        eta_at_nom,
355
        eta_at_min,
356
    )
357
358
    results = solve_and_extract_results(es)
359
360
    check_results(
361
        results,
362
        es.groups["bus input 0"],
363
        nominal_capacity,
364
        minimal_value,
365
        eta_at_nom,
366
        eta_at_min,
367
    )
368
369
@@ 306-334 (lines=29) @@
303
    )
304
305
306
def test_OffsetConverter_single_input_output_ref_input():
307
    num_in = 1
308
    num_out = 1
309
    es = create_energysystem_stub(num_in, num_out)
310
311
    nominal_capacity = 10
312
    minimal_value = 3
313
314
    eta_at_nom = {es.groups["bus output 0"]: 0.7}
315
    eta_at_min = {es.groups["bus output 0"]: 0.5}
316
317
    add_OffsetConverter(
318
        es,
319
        es.groups["bus input 0"],
320
        nominal_capacity,
321
        minimal_value,
322
        eta_at_nom,
323
        eta_at_min,
324
    )
325
326
    results = solve_and_extract_results(es)
327
328
    check_results(
329
        results,
330
        es.groups["bus input 0"],
331
        nominal_capacity,
332
        minimal_value,
333
        eta_at_nom,
334
        eta_at_min,
335
    )
336
337
@@ 274-302 (lines=29) @@
271
    )
272
273
274
def test_OffsetConverter_single_input_output_ref_output_eta_decreasing():
275
    num_in = 1
276
    num_out = 1
277
    es = create_energysystem_stub(num_in, num_out)
278
279
    nominal_capacity = 10
280
    minimal_value = 3
281
282
    eta_at_nom = {es.groups["bus input 0"]: 0.5}
283
    eta_at_min = {es.groups["bus input 0"]: 0.7}
284
285
    add_OffsetConverter(
286
        es,
287
        es.groups["bus output 0"],
288
        nominal_capacity,
289
        minimal_value,
290
        eta_at_nom,
291
        eta_at_min,
292
    )
293
294
    results = solve_and_extract_results(es)
295
296
    check_results(
297
        results,
298
        es.groups["bus output 0"],
299
        nominal_capacity,
300
        minimal_value,
301
        eta_at_nom,
302
        eta_at_min,
303
    )
304
305
@@ 242-270 (lines=29) @@
239
        )
240
241
242
def test_OffsetConverter_single_input_output_ref_output():
243
    num_in = 1
244
    num_out = 1
245
    es = create_energysystem_stub(num_in, num_out)
246
247
    nominal_capacity = 10
248
    minimal_value = 3
249
250
    eta_at_nom = {es.groups["bus input 0"]: 0.7}
251
    eta_at_min = {es.groups["bus input 0"]: 0.5}
252
253
    add_OffsetConverter(
254
        es,
255
        es.groups["bus output 0"],
256
        nominal_capacity,
257
        minimal_value,
258
        eta_at_nom,
259
        eta_at_min,
260
    )
261
262
    results = solve_and_extract_results(es)
263
264
    check_results(
265
        results,
266
        es.groups["bus output 0"],
267
        nominal_capacity,
268
        minimal_value,
269
        eta_at_nom,
270
        eta_at_min,
271
    )
272
273