(self)
| 49 | np.testing.assert_allclose(result[0], test_data1) |
| 50 | |
| 51 | def test_npz2(self): |
| 52 | test_data1 = np.random.randint(0, 256, size=[3, 4, 4]) |
| 53 | test_data2 = np.random.randint(0, 256, size=[3, 4, 4]) |
| 54 | with tempfile.TemporaryDirectory() as tempdir: |
| 55 | filepath = os.path.join(tempdir, "test_data.npz") |
| 56 | np.savez(filepath, test_data1, test_data2) |
| 57 | |
| 58 | reader = NumpyReader() |
| 59 | result = reader.get_data(reader.read(filepath)) |
| 60 | np.testing.assert_allclose(result[1]["spatial_shape"], test_data1.shape) |
| 61 | np.testing.assert_allclose(result[0].shape, (2, 3, 4, 4)) |
| 62 | np.testing.assert_allclose(result[0], np.stack([test_data1, test_data2])) |
| 63 | |
| 64 | def test_npz3(self): |
| 65 | test_data1 = np.random.randint(0, 256, size=[3, 4, 4]) |
nothing calls this directly
no test coverage detected