Skip to content

Commit

Permalink
Avoid chained casts to solph.sequence
Browse files Browse the repository at this point in the history
Note thatthis is just a workaround. chaned casts chould either work or be
prohibited.
  • Loading branch information
p-snft committed Jul 4, 2024
1 parent f3df7c3 commit 6e02ae4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/oemof/solph/components/_offset_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,12 +282,12 @@ def normed_offset_and_conversion_factors_from_coefficients(
c0, c1 = slope_offset_from_nonconvex_output(
flow.max[i], flow.min[i], eta_at_max, eta_at_min
)
slope += [c0]
offset += [c1]
slope.append(c0)
offset.append(c1)

if max_len == 1:
slope = sequence(slope[0])
offset = sequence(offset[0])
slope = slope[0]
offset = offset[0]

conversion_factors = {input_bus: slope}
normed_offsets = {input_bus: offset}
Expand Down

0 comments on commit 6e02ae4

Please sign in to comment.