@@ -72,21 +72,11 @@ def __init__(self, cfg: DictConfig):
7272 # TODO get mike johnson et al. to fix the subset bug: https://github.com/owp-spatial/hfsubsetR/issues/9
7373 wb_ordered_index = [f"wb-{ _id } " for _id in self .order ]
7474 cat_ordered_index = [f"cat-{ _id } " for _id in self .order ]
75- < << << << HEAD
76- self .divides_sorted = self .divides .reindex (cat_ordered_index ).dropna (how = 'all' )
77- self .divide_attr_sorted = self .divide_attr .reindex (self .divides_sorted .index )
78-
79- self .flowpaths_sorted = self .flowpaths .reindex (wb_ordered_index ).dropna (how = 'all' )
80- self .flowpath_attr = self .flowpath_attr [~ self .flowpath_attr .index .duplicated (keep = 'first' )].dropna (how = 'all' )
81- self .flowpath_attr_sorted = self .flowpath_attr .reindex (wb_ordered_index ).dropna (how = 'all' )
82- == == == =
8375 self .divides_sorted = self .divides .reindex (cat_ordered_index )
8476 self .divide_attr_sorted = self .divide_attr .reindex (self .divides_sorted .index )
8577
8678 self .flowpaths_sorted = self .flowpaths .reindex (wb_ordered_index )
8779 self .flowpath_attr = self .flowpath_attr [~ self .flowpath_attr .index .duplicated (keep = 'first' )]
88- self .flowpath_attr_sorted = self .flowpath_attr .reindex (wb_ordered_index )
89- >> >> >> > 0 d4ac462119f1794587f7524713c2bc274512c07
9080
9181 # self.idx_mapper = {_id: idx for idx, _id in enumerate(self.divides_sorted.index)}
9282 # self.catchment_mapper = {_id : idx for idx, _id in enumerate(self.divides_sorted["divide_id"])}
@@ -139,10 +129,6 @@ def collate_fn(self, *args, **kwargs) -> Hydrofabric:
139129 observations = self .observations ,
140130 )
141131
142- < << << << HEAD
143- # TODO make this a dynamic lookup
144- transition_matrix = pd .read_csv (self .cfg .data_sources .transition_matrix ).set_index ("COMID" )
145- == == == =
146132 tm , tm_root_coo = read_coo (Path (self .cfg .data_sources .transition_matrix ), "73" )
147133 csc_tm = tm .tocsc ()
148134 merit_basins_order = tm_root_coo ["merit_basins_order" ][:]
@@ -152,7 +138,6 @@ def collate_fn(self, *args, **kwargs) -> Hydrofabric:
152138 mask = np .sum (_transition_matrix , axis = 1 ).A1 > 0
153139 transition_matrix = _transition_matrix [mask ]
154140 merit_basins = merit_basins_order [mask ]
155- >> >> >> > 0 d4ac462119f1794587f7524713c2bc274512c07
156141
157142 return Hydrofabric (
158143 spatial_attributes = spatial_attributes ,
0 commit comments