Skip to content

Commit

Permalink
Update src/spyglass/spikesorting/v1/metric_curation.py
Browse files Browse the repository at this point in the history
Co-authored-by: Chris Brozdowski <[email protected]>
  • Loading branch information
khl02007 and CBroz1 authored Dec 8, 2023
1 parent 94a31c8 commit 7ed4bfe
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions src/spyglass/spikesorting/v1/metric_curation.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,27 +474,27 @@ def _compute_merge_groups(

if not merge_params:
return []
else:
unit_ids = list(metrics[list(metrics.keys())[0]].keys())
merge_groups = {unit_id: [] for unit_id in unit_ids}
for metric in merge_params:
if metric not in metrics:
Warning(f"{metric} not found in quality metrics; skipping")
else:
compare = _comparison_to_function[merge_params[metric][0]]
for unit_id in unit_ids:
other_unit_ids = [
other_unit_id
for other_unit_id in unit_ids
if other_unit_id != unit_id
]
for other_unit_id in other_unit_ids:
if compare(
metrics[metric][unit_id][other_unit_id],
merge_params[metric][1],
):
merge_groups[unit_id].extend(other_unit_id)
return merge_groups

unit_ids = list(metrics[list(metrics.keys())[0]].keys())
merge_groups = {unit_id: [] for unit_id in unit_ids}
for metric in merge_params:
if metric not in metrics:
Warning(f"{metric} not found in quality metrics; skipping")
continue
compare = _comparison_to_function[merge_params[metric][0]]
for unit_id in unit_ids:
other_unit_ids = [
other_unit_id
for other_unit_id in unit_ids
if other_unit_id != unit_id
]
for other_unit_id in other_unit_ids:
if compare(
metrics[metric][unit_id][other_unit_id],
merge_params[metric][1],
):
merge_groups[unit_id].extend(other_unit_id)
return merge_groups


def _write_metric_curation_to_nwb(
Expand Down

0 comments on commit 7ed4bfe

Please sign in to comment.