(self)
| 92 | np.testing.assert_allclose(result["test"], test_data["test"]) |
| 93 | |
| 94 | def test_kwargs(self): |
| 95 | test_data = {"test": np.random.randint(0, 256, size=[3, 4, 4])} |
| 96 | with tempfile.TemporaryDirectory() as tempdir: |
| 97 | filepath = os.path.join(tempdir, "test_data.npy") |
| 98 | np.save(filepath, test_data, allow_pickle=True) |
| 99 | |
| 100 | reader = NumpyReader(mmap_mode="r") |
| 101 | |
| 102 | with self.assertRaises(ValueError): |
| 103 | reader.get_data(reader.read(filepath, mmap_mode=None)) |
| 104 | |
| 105 | reader = NumpyReader(mmap_mode="r", allow_pickle=True) |
| 106 | result = reader.get_data(reader.read(filepath, mmap_mode=None))[0].item() |
| 107 | np.testing.assert_allclose(result["test"].shape, test_data["test"].shape) |
| 108 | |
| 109 | def test_dataloader(self): |
| 110 | test_data = np.random.randint(0, 256, size=[3, 4, 5]) |
nothing calls this directly
no test coverage detected