Skip to content

Commit

Permalink
Fixing split lock key error in vector dataloader
Browse files Browse the repository at this point in the history
  • Loading branch information
hjabbot committed Sep 19, 2024
1 parent 7cb91a6 commit f1c85e8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion meshiphi/dataloaders/vector/abstract_vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,9 @@ def get_hom_condition(self, bounds, splitting_conds, agg_type='MEAN', data=None)
flow = self.calc_dmag(bounds, collapse=False)
sc = splitting_conds['dmag']

if 'split_lock' not in sc:
sc['split_lock'] = False

if isinstance(flow, type(np.nan)) and np.isnan(flow):
return "CLR"
num_over_threshold = (flow > sc['threshold']).sum()
Expand All @@ -585,7 +588,7 @@ def get_hom_condition(self, bounds, splitting_conds, agg_type='MEAN', data=None)
if frac_over_threshold <= sc['lower_bound']:
hom_type = "CLR"
elif frac_over_threshold >= sc['upper_bound']:
if splitting_conds['split_lock'] == True:
if sc['split_lock'] == True:
hom_type = "HOM"
else:
hom_type = "CLR"
Expand Down

0 comments on commit f1c85e8

Please sign in to comment.