Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pandas warnings fixes #1089

Merged
merged 6 commits into from
Jul 31, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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]

Comment on lines -289 to 291
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for jumping in here @p-snft. I was actually wrapping my head around this sequence stuff the first time I saw it when implementing the changes for the OffsetConverter and it took me quite a while to figure out what was going on. I see the practical point of the sequences, but I was wondering, if we could not just use scalars or numpy arrays instead in general. Because if you (by accident) provide a half length sequence (with respect to the timeindex) you would end up with some kind of nonsense anyway, right? So why not let people either pass scalars or correct-length lists or arrays?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is that we do not know the correct length before the Entity is added to the EnergySystem. An option would be to just let scalar stay scalars until we need to have arrays.

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