Skip to content

Commit

Permalink
Merge pull request #1009 from oemof/revision/node_dict
Browse files Browse the repository at this point in the history
Assure Model.nodeis a list
  • Loading branch information
p-snft authored Nov 9, 2023
2 parents fb1c5f7 + 36e5f42 commit 7c7ba3b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/oemof/solph/_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,12 +402,11 @@ def _add_parent_block_sets(self):
"""Add all basic sets to the model, i.e. NODES, TIMESTEPS and FLOWS.
Also create sets PERIODS and TIMEINDEX used for multi-period models.
"""
self.nodes = self.es.nodes
self.nodes = list(self.es.nodes)
if self.is_cellular:
# collect all nodes from the child cells
for cell in self.ec:
for node in cell.nodes:
self.nodes.append(node)
self.nodes.extend(cell.nodes)
# create set with all nodes
self.NODES = po.Set(initialize=[n for n in self.nodes])

Expand Down

0 comments on commit 7c7ba3b

Please sign in to comment.