Skip to content

Commit 1335ecf

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 4183451 commit 1335ecf

2 files changed

Lines changed: 14 additions & 8 deletions

File tree

src/spikeinterface/widgets/sorting_summary.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ class SortingSummaryWidget(BaseWidget):
4343
List of labels to be added to the curation table
4444
(sortingview backend)
4545
unit_table_properties : list or None, default: None
46-
List of properties to be added to the unit table.
47-
These may be drawn from the sorting extractor, and, if available,
46+
List of properties to be added to the unit table.
47+
These may be drawn from the sorting extractor, and, if available,
4848
the quality_metrics and template_metrics extensions of the SortingAnalyzer.
4949
See all properties available with sorting.get_property_keys(), and, if available,
50-
analyzer.get_extension("quality_metrics").get_data().columns and
50+
analyzer.get_extension("quality_metrics").get_data().columns and
5151
analyzer.get_extension("template_metrics").get_data().columns.
5252
(sortingview backend)
5353
"""

src/spikeinterface/widgets/utils_sortingview.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from ..core.core_tools import check_json
66
from warnings import warn
77

8+
89
def make_serializable(*args):
910
dict_to_serialize = {int(i): a for i, a in enumerate(args)}
1011
serializable_dict = check_json(dict_to_serialize)
@@ -47,8 +48,9 @@ def handle_display_and_url(widget, view, **backend_kwargs):
4748

4849
def generate_unit_table_view(analyzer, unit_properties=None, similarity_scores=None):
4950
import sortingview.views as vv
51+
5052
sorting = analyzer.sorting
51-
53+
5254
# Find available unit properties from all sources
5355
sorting_props = sorting.get_property_keys()
5456
if analyzer.get_extension("quality_metrics") is not None:
@@ -66,7 +68,9 @@ def generate_unit_table_view(analyzer, unit_properties=None, similarity_scores=N
6668
all_props = sorting_props + qm_props + tm_props
6769
overlap_props = [prop for prop in all_props if all_props.count(prop) > 1]
6870
if len(overlap_props) > 0:
69-
warn(f"Warning: Overlapping properties found in sorting, quality_metrics, and template_metrics: {overlap_props}")
71+
warn(
72+
f"Warning: Overlapping properties found in sorting, quality_metrics, and template_metrics: {overlap_props}"
73+
)
7074

7175
# Get unit properties
7276
if unit_properties is None:
@@ -92,7 +96,7 @@ def generate_unit_table_view(analyzer, unit_properties=None, similarity_scores=N
9296
property_values = tm_data[prop_name].values
9397
else:
9498
raise ValueError(f"Property '{prop_name}' not found in sorting, quality_metrics, or template_metrics")
95-
99+
96100
# make dtype available
97101
val0 = np.array(property_values[0])
98102
if val0.dtype.kind in ("i", "u"):
@@ -121,8 +125,10 @@ def generate_unit_table_view(analyzer, unit_properties=None, similarity_scores=N
121125
elif prop_name in tm_props:
122126
property_values = tm_data[prop_name].values
123127
else:
124-
raise ValueError(f"Property '{prop_name}' not found in sorting, quality_metrics, or template_metrics")
125-
128+
raise ValueError(
129+
f"Property '{prop_name}' not found in sorting, quality_metrics, or template_metrics"
130+
)
131+
126132
# Check for NaN values
127133
val0 = np.array(property_values[0])
128134
if val0.dtype.kind == "f":

0 commit comments

Comments
 (0)