Skip to content

Commit cfd2700

Browse files
to black
1 parent 981aa30 commit cfd2700

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

tests/test_datasets.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -299,27 +299,29 @@ def test_ace(tmpdir):
299299
f2.flush()
300300
f2.close()
301301

302+
302303
@mark.parametrize("num_files", [1, 3])
303304
@mark.parametrize("tile_embed", [True, False])
304305
@mark.parametrize("batch_size", [1, 5])
305306
def test_hdf5_with_and_without_caching(num_files, tile_embed, batch_size, tmpdir):
306307
"""This test ensures that the output from the get of the HDF5 dataset is the same
307308
when the dataset is loaded with and without caching."""
309+
308310
# set up necessary files
309311
_ = write_sample_npy_files(True, True, tmpdir, num_files)
310312
files = {}
311313
files["pos"] = sorted(glob.glob(join(tmpdir, "coords*")))
312314
files["z"] = sorted(glob.glob(join(tmpdir, "embed*")))
313315
files["y"] = sorted(glob.glob(join(tmpdir, "energy*")))
314316
files["neg_dy"] = sorted(glob.glob(join(tmpdir, "forces*")))
315-
317+
316318
write_as_hdf5(files, join(tmpdir, "test.hdf5"), tile_embed)
317319
# Assert file is present in the disk
318320
assert os.path.isfile(join(tmpdir, "test.hdf5")), "HDF5 file was not created"
319321

320-
data = HDF5(join(tmpdir, "test.hdf5"), dataset_preload_limit=0) # no caching
321-
data_cached = HDF5(join(tmpdir, "test.hdf5"), dataset_preload_limit=256) # caching
322-
assert len(data) == len(data_cached), "Number of samples does not match"
322+
data = HDF5(join(tmpdir, "test.hdf5"), dataset_preload_limit=0) # no caching
323+
data_cached = HDF5(join(tmpdir, "test.hdf5"), dataset_preload_limit=256) # caching
324+
assert len(data) == len(data_cached), "Number of samples does not match"
323325

324326
dl = DataLoader(data, batch_size)
325327
dl_cached = DataLoader(data_cached, batch_size)

0 commit comments

Comments
 (0)