Skip to content

Commit ed4c3cf

Browse files
committed
Allow ndarray metadata.
1 parent e6d8d35 commit ed4c3cf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cubids/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ def cluster_single_parameters(df, config, modality):
591591
if "tolerance" in column_fmt and len(df) > 1:
592592
column_data = df[column_name].to_numpy()
593593

594-
if any(isinstance(x, list) for x in column_data):
594+
if any(isinstance(x, (list, np.ndarray)) for x in column_data):
595595
# For array/list data, we should first define "clusters" based on the number of
596596
# elements, then apply the clustering within each set of lengths.
597597
# For example, if there are four runs with five elements and 10 runs with three
@@ -654,7 +654,7 @@ def cluster_single_parameters(df, config, modality):
654654
# but arrays of strings need to be handled differently.
655655
column_data = df[column_name].tolist()
656656

657-
if any(isinstance(x, list) for x in column_data):
657+
if any(isinstance(x, (list, np.ndarray)) for x in column_data):
658658
cluster_idx = 0
659659

660660
column_data = ["|&|".join(str(val) for val in cell) for cell in column_data]

0 commit comments

Comments
 (0)