File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -157,10 +157,11 @@ def _validate_group(group, is_root=False):
157157
158158
159159def _validate_dataset (ds ):
160+
160161 if not type (ds .data ) is np .ndarray :
161162 return ['Dataset.data must be a numpy.ndarray' ]
162163
163- elif np . alen ( ds .data ) < 1 :
164+ elif ds .data . size < 1 :
164165 return ['Dataset.data must not be empty' ]
165166
166167 elif not np .issubdtype (ds .data .dtype , np .float64 ):
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ def save(filename, group):
6262 dimname = s ._display_name
6363 if dimname is None :
6464 dimname = ''
65- h5ds . dims . create_scale ( h5s , _str (dimname ))
65+ h5s . make_scale ( _str (dimname ))
6666 h5ds .dims [i ].attach_scale (h5s )
6767 else :
6868 print ("Cannot attach scale for '" + h5ds .name +
@@ -101,7 +101,7 @@ def _create_dataset(dsobj, datasets):
101101 """ Create a dataset from an h5py dataset """
102102
103103 _ , name = os .path .split (dsobj .name )
104- ds = sdf .Dataset (name , data = dsobj . value )
104+ ds = sdf .Dataset (name , data = dsobj [()] )
105105
106106 for attr in dsobj .attrs :
107107 if attr == 'COMMENT' :
You can’t perform that action at this time.
0 commit comments