55from ..core .core_tools import check_json
66from warnings import warn
77
8+
89def 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
4849def 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