Skip to content

Commit

Permalink
Merge pull request #1003 from lensum/features/cellular
Browse files Browse the repository at this point in the history
make BasicModel consider all constraint groups
  • Loading branch information
p-snft authored Oct 23, 2023
2 parents 39f59f5 + bf430f4 commit 214ef46
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions src/oemof/solph/_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,21 @@ def __init__(self, energysystem, **kwargs):
"constraint_groups", []
)

self._constraint_groups += [
i
for i in self.es.groups
if hasattr(i, "CONSTRAINT_GROUP")
and i not in self._constraint_groups
]
if self.is_cellular:
for es in energysystem:
self._constraint_groups += [
i
for i in es.groups
if hasattr(i, "CONSTRAINT_GROUP")
and i not in self._constraint_groups
]
else:
self._constraint_groups += [
i
for i in self.es.groups
if hasattr(i, "CONSTRAINT_GROUP")
and i not in self._constraint_groups
]

self.flows = self.es.flows()
if self.is_cellular:
Expand Down

0 comments on commit 214ef46

Please sign in to comment.