Skip to content

Commit 64a63aa

Browse files
committed
working swmmnetwork mark I
1 parent eadf0b6 commit 64a63aa

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

swmmnetwork/scenario.py

+7-13
Original file line numberDiff line numberDiff line change
@@ -488,23 +488,17 @@ def edge_list(self):
488488
edges.index = edges.index.set_names('id')
489489
edges = (
490490
edges
491-
# .join(self.load
492-
# .drop('unit', axis='columns')
493-
# .query('xtype == "subcatchments"')
494-
# .drop_duplicates(subset=['subcatchment', 'pollutant'])
495-
# .set_index(['subcatchment', 'pollutant'])
496-
# .loc[:, ['load']]
497-
# .unstack('pollutant')
498-
499-
# .load.loc[:, self.pocs],
500-
# on='inlet_node', lsuffix='_vol')
501491
.reset_index()
502492
.fillna(0)
503493
.set_index(['inlet_node', 'outlet_node'])
504-
.loc[:, ['id', 'xtype', 'volume'] ]#+ self.pocs]
505-
.to_dict('index')
494+
.loc[:, ['id', 'xtype', 'volume'] ]
506495
)
507-
return list((k[0], k[1], v) for k, v in edges.items())
496+
edge_list = []
497+
for dtype in edges.xtype.unique():
498+
499+
_list = edges.query('xtype == @dtype').to_dict('index')
500+
edge_list.extend(list((k[0], k[1], v) for k, v in _list.items()))
501+
return edge_list
508502

509503
@property
510504
def node_list(self):

0 commit comments

Comments
 (0)