File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -91,13 +91,6 @@ def append_set_dimension(self, labels=None):
91
91
index = len (self .dimensions ) + 1
92
92
setdim = SetDimension .create_new (self , index )
93
93
if labels is not None :
94
- if not hasattr (labels , '__iter__' ) or isinstance (labels , str ):
95
- raise ValueError ('`labels` has to be a list-like object.' )
96
- for label in labels :
97
- if not isinstance (label , str ):
98
- raise ValueError (f'`labels` has to contain string objects, not { type (label )} ' )
99
- if not isinstance (labels , list ):
100
- labels = list (labels )
101
94
setdim .labels = labels
102
95
if self .file .auto_update_timestamps :
103
96
self .force_updated_at ()
Original file line number Diff line number Diff line change @@ -684,6 +684,13 @@ def labels(self, labels):
684
684
raise RuntimeError ("The labels of a SetDimension linked to a "
685
685
"data object cannot be modified" )
686
686
dt = util .vlen_str_dtype
687
+ if not hasattr (labels , '__iter__' ) or isinstance (labels , str ):
688
+ raise ValueError ('`labels` has to be a list-like object.' )
689
+ for label in labels :
690
+ if not isinstance (label , str ):
691
+ raise ValueError (f'`labels` has to contain string objects, not { type (label )} ' )
692
+ if not isinstance (labels , list ):
693
+ labels = list (labels )
687
694
self ._h5group .write_data ("labels" , labels , dtype = dt )
688
695
689
696
def index_of (self , position , mode = IndexMode .LessOrEqual ):
You can’t perform that action at this time.
0 commit comments