(self)
| 136 | assert_allclose(c, test_data, type_test=False) |
| 137 | |
| 138 | def test_channel_dim(self): |
| 139 | test_data = np.random.randint(0, 256, size=[3, 4, 5, 2]) |
| 140 | with tempfile.TemporaryDirectory() as tempdir: |
| 141 | filepath = os.path.join(tempdir, "test_data.npy") |
| 142 | np.save(filepath, test_data) |
| 143 | |
| 144 | reader = NumpyReader(channel_dim=-1) |
| 145 | result = reader.get_data(reader.read(filepath)) |
| 146 | np.testing.assert_allclose(result[1]["spatial_shape"], test_data.shape[:-1]) |
| 147 | self.assertEqual(result[1]["original_channel_dim"], -1) |
| 148 | |
| 149 | |
| 150 | if __name__ == "__main__": |
nothing calls this directly
no test coverage detected