From 1de11a1701c17bbb1e3bb7c0a482d632e3912a56 Mon Sep 17 00:00:00 2001 From: algol Date: Fri, 29 May 2026 10:24:31 +0100 Subject: [PATCH] fixing the bug on flattening auxiliary data --- httomo/runner/dataset.py | 2 +- tests/runner/test_dataset_block.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/httomo/runner/dataset.py b/httomo/runner/dataset.py index d1cc5ffda..bb55c5525 100644 --- a/httomo/runner/dataset.py +++ b/httomo/runner/dataset.py @@ -171,7 +171,7 @@ def slicing_dim(self) -> Literal[0, 1, 2]: def _empty_aux_array(self): empty_shape = list(self._data.shape) - empty_shape[self.slicing_dim] = 0 + empty_shape[self.slicing_dim] = 1 return np.empty_like(self._data, shape=empty_shape) @property diff --git a/tests/runner/test_dataset_block.py b/tests/runner/test_dataset_block.py index 5081fe5c5..9cf71ed67 100644 --- a/tests/runner/test_dataset_block.py +++ b/tests/runner/test_dataset_block.py @@ -33,10 +33,10 @@ def test_full_block_for_global_data(): np.testing.assert_array_equal(data, block.data) np.testing.assert_array_equal(angles, block.angles) np.testing.assert_array_equal(angles, block.angles_radians) - assert block.darks.shape == (0, 10, 10) - assert block.dark.shape == (0, 10, 10) - assert block.flats.shape == (0, 10, 10) - assert block.flat.shape == (0, 10, 10) + assert block.darks.shape == (1, 10, 10) + assert block.dark.shape == (1, 10, 10) + assert block.flats.shape == (1, 10, 10) + assert block.flat.shape == (1, 10, 10) assert block.darks.dtype == data.dtype assert block.flats.dtype == data.dtype assert block.dark.dtype == data.dtype