Skip to content

Commit

Permalink
Fix obejective weighting in case no timeincrement is set
Browse files Browse the repository at this point in the history
  • Loading branch information
henhuy committed Nov 1, 2023
1 parent 251542b commit ef75a5a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/oemof/solph/_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,10 @@ def __init__(self, energysystem, **kwargs):
self.timeincrement = kwargs.get("timeincrement", self.es.timeincrement)

self.objective_weighting = kwargs.get(
"objective_weighting", [1] * len(self.timeincrement)
"objective_weighting",
[1] * len(self.timeincrement)
if self.timeincrement is not None
else [1],
)

self._constraint_groups = type(self).CONSTRAINT_GROUPS + kwargs.get(
Expand Down

0 comments on commit ef75a5a

Please sign in to comment.