diff --git a/src/agora/io/writer.py b/src/agora/io/writer.py index 7ea02335e488d7ef460794972c09741489a142fa..01e3d64915e49a87a51ffad253aaaf1c748dfe5d 100644 --- a/src/agora/io/writer.py +++ b/src/agora/io/writer.py @@ -704,9 +704,12 @@ class Writer(BridgeH5): dset.resize(dset.shape[1] + df.shape[1], axis=1) dset[:, ntps:] = np.nan + # TODO refactor this indices sorting. Could be simpler found_indices_sorted = self.id_cache[df.index.nlevels][ "found_indices" ] + + # Cover for case when all labels are new if found_indices_sorted.any(): # h5py does not allow bidimensional indexing, # so we have to iterate over the columns