From b824e462a861a1ec46fbb7a50b3b7c082018285e Mon Sep 17 00:00:00 2001 From: Jan Zavadil <79144013+hzavadil98@users.noreply.github.com> Date: Thu, 20 Feb 2025 12:34:22 +0100 Subject: [PATCH] Deleted indivual usps test --- tests/test_dataloaders.py | 37 ------------------------------------- 1 file changed, 37 deletions(-) diff --git a/tests/test_dataloaders.py b/tests/test_dataloaders.py index dbdb14a..8dc0d0d 100644 --- a/tests/test_dataloaders.py +++ b/tests/test_dataloaders.py @@ -38,40 +38,3 @@ def test_load_data(data_name, expected): ) # Should probably restrict this to only int or one-hot encoded tensor or array for consistency. -def test_uspsdataset0_6(): - from tempfile import TemporaryDirectory - - import h5py - import numpy as np - from torchvision import transforms - - # Create a temporary directory (deleted after the test) - with TemporaryDirectory() as tempdir: - tempdir = Path(tempdir) - - tf = tempdir / "usps.h5" - - # Create a h5 file - with h5py.File(tf, "w") as f: - targets = np.array([6, 5, 4, 3, 2, 1, 0, 0, 0, 0]) - indices = np.arange(len(targets)) - # Populate the file with data - f["train/data"] = np.random.rand(10, 16 * 16) - f["train/target"] = targets - - trans = transforms.Compose( - [ - transforms.Resize((16, 16)), - transforms.ToTensor(), - ] - ) - dataset = USPSDataset0_6( - data_path=tempdir, - sample_ids=indices, - train=True, - transform=trans, - ) - assert len(dataset) == 10 - data, target = dataset[0] - assert data.shape == (1, 16, 16) - assert target == 6