diff --git a/wetb/gtsdf/gtsdf.py b/wetb/gtsdf/gtsdf.py index 4a99549a217f920b018e16c312bf9872cce9166a..9ebf787774ff817bf18cb7af9d71ed0ce99a9b61 100644 --- a/wetb/gtsdf/gtsdf.py +++ b/wetb/gtsdf/gtsdf.py @@ -155,7 +155,9 @@ def load(filename, dtype=None): data.append(block_data) f.close() - return np.array(time).astype(np.float64), np.vstack(data).astype(dtype), info + if no_blocks > 0: + data = np.vstack(data) + return np.array(time).astype(np.float64), np.array(data).astype(dtype), info except (ValueError, AssertionError): f.close() raise @@ -327,9 +329,9 @@ def append_block(filename, data, **kwargs): block.create_dataset('time', data=kwargs['time']) if 'time_step' in kwargs: time_step = kwargs['time_step'] - block.attrs['time_step'] = time_step.astype(np.float64) + block.attrs['time_step'] = np.float64(time_step) if 'time_start' in kwargs: - block.attrs['time_start'] = kwargs['time_start'].astype(np.float64) + block.attrs['time_start'] = np.float64(kwargs['time_start']) pct_res = np.array([1]) if "int" in str(dtype):