File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -183,7 +183,7 @@ def generate_code(self, hdf5_file):
183183 # contain embedded nulls'. Presumably our binary data
184184 # must contain nulls sometimes. So this crashes if we
185185 # don't convert to a numpy 'fixes length' string:
186- binary_group .create_dataset ('DDS%d' % dds , data = np .string_ (binary_data ))
186+ binary_group .create_dataset ('DDS%d' % dds , data = np .bytes_ (binary_data ))
187187 finally :
188188 # Delete the temporary files:
189189 os .remove (temp_assembly_filepath )
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ def _ensure_str(s):
3939 """
4040 if isinstance (s , bytes ):
4141 return s .decode ()
42- elif isinstance (s , np .string_ ):
42+ elif isinstance (s , np .bytes_ ):
4343 return str (s )
4444 else :
4545 return s
@@ -390,9 +390,9 @@ def transition_to_static(self, h5_filepath):
390390 dtype = 'uint16' , compression = 'gzip' )
391391 if self .imageify :
392392 # Specify this dataset should be viewed as an image
393- dset .attrs ['CLASS' ] = np .string_ ('IMAGE' )
394- dset .attrs ['IMAGE_VERSION' ] = np .string_ ('1.2' )
395- dset .attrs ['IMAGE_SUBCLASS' ] = np .string_ (
393+ dset .attrs ['CLASS' ] = np .bytes_ ('IMAGE' )
394+ dset .attrs ['IMAGE_VERSION' ] = np .bytes_ ('1.2' )
395+ dset .attrs ['IMAGE_SUBCLASS' ] = np .bytes_ (
396396 'IMAGE_GRAYSCALE' )
397397 dset .attrs ['IMAGE_WHITE_IS_ZERO' ] = np .uint8 (0 )
398398 print ('Saved frame {:}' .format (exposure ['frametype' ]))
You can’t perform that action at this time.
0 commit comments