File tree 1 file changed +7
-13
lines changed
1 file changed +7
-13
lines changed Original file line number Diff line number Diff line change @@ -488,23 +488,17 @@ def edge_list(self):
488
488
edges .index = edges .index .set_names ('id' )
489
489
edges = (
490
490
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')
501
491
.reset_index ()
502
492
.fillna (0 )
503
493
.set_index (['inlet_node' , 'outlet_node' ])
504
- .loc [:, ['id' , 'xtype' , 'volume' ] ]#+ self.pocs]
505
- .to_dict ('index' )
494
+ .loc [:, ['id' , 'xtype' , 'volume' ] ]
506
495
)
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
508
502
509
503
@property
510
504
def node_list (self ):
You can’t perform that action at this time.
0 commit comments