From 9cb152de4506ef722984af4dc0ffc85f8f4cea6f Mon Sep 17 00:00:00 2001 From: algol Date: Fri, 16 Jan 2026 11:09:03 +0000 Subject: [PATCH 1/4] time info for reslice into log --- httomo/data/dataset_store.py | 14 +++++++++++++- httomo/utils.py | 2 ++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/httomo/data/dataset_store.py b/httomo/data/dataset_store.py index bc0d490ec..48d7eb919 100644 --- a/httomo/data/dataset_store.py +++ b/httomo/data/dataset_store.py @@ -40,7 +40,7 @@ from numpy.typing import DTypeLike import weakref -from httomo.utils import log_once, make_3d_shape_from_shape +from httomo.utils import catchtime, log_once, make_3d_shape_from_shape class DataSetStoreWriter(ReadableDataSetSink): @@ -284,7 +284,19 @@ def __init__( self._slicing_dim = source.slicing_dim self._data = source_data else: + start = time.perf_counter() self._data = self._reslice(source.slicing_dim, slicing_dim, source_data) + end = time.perf_counter() + if slicing_dim == 1: + log_once( + f"Slicing axis change (reslice) from projection to sinogram took {(end - start):.9f}s.", + level=logging.INFO, + ) + else: + log_once( + f"Slicing axis change (reslice) from sinogram to projections took {(end - start):.9f}s.", + level=logging.INFO, + ) self._slicing_dim = slicing_dim self._padding = (0, 0) if padding is None else padding diff --git a/httomo/utils.py b/httomo/utils.py index 585db502f..503c5fb83 100644 --- a/httomo/utils.py +++ b/httomo/utils.py @@ -59,6 +59,8 @@ def log_once(output: Any, level: int = logging.INFO) -> None: logger.opt(colors=True).info("{}".format(output)) elif "Advisory" in output: logger.opt(colors=True).info("\033[43m{}\033[0m".format(output)) + elif "reslice" in output: + logger.opt(colors=True).info("{}".format(output)) else: logger.info(output) From 375d7504b335773f8c1a355d9c8b7e1b96b50328 Mon Sep 17 00:00:00 2001 From: algol Date: Fri, 16 Jan 2026 13:56:22 +0000 Subject: [PATCH 2/4] minor start stop clock rearrengments --- httomo/data/dataset_store.py | 2 +- httomo/runner/task_runner.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/httomo/data/dataset_store.py b/httomo/data/dataset_store.py index 48d7eb919..35c735646 100644 --- a/httomo/data/dataset_store.py +++ b/httomo/data/dataset_store.py @@ -117,7 +117,7 @@ def aux_data(self) -> AuxiliaryData: def write_block(self, block: DataSetBlock): if self._readonly: raise ValueError("Cannot write after creating a reader") - block.to_cpu() + block.to_cpu() # TODO: possibly needs moving outside the block writing start = max(block.chunk_index_unpadded) if self._data is None: # if non-slice dims in block are different, update the shapes here diff --git a/httomo/runner/task_runner.py b/httomo/runner/task_runner.py index 7504f9c6d..fbb65eb6b 100644 --- a/httomo/runner/task_runner.py +++ b/httomo/runner/task_runner.py @@ -145,7 +145,6 @@ def _execute_section(self, section: Section, section_index: int = 0): self._pass_min_block_length_to_intermediate_data_wrapper(section) splitter = BlockSplitter(self.source, section.max_slices) - start_source = time.perf_counter_ns() no_of_blocks = len(splitter) # Redirect tqdm progress bar output to /dev/null, and instead manually write block @@ -156,6 +155,7 @@ def _execute_section(self, section: Section, section_index: int = 0): unit="block", ascii=True, ) + start_source = time.perf_counter_ns() for idx, block in enumerate(progress): end_source = time.perf_counter_ns() if self.monitor is not None: @@ -274,9 +274,9 @@ def _execute_method( ) -> DataSetBlock: start = time.perf_counter_ns() block = method.execute(block) + end = time.perf_counter_ns() if block.is_last_in_chunk: self.append_side_outputs(method.get_side_output()) - end = time.perf_counter_ns() if self.monitor is not None: self.monitor.report_method_block( method.method_name, From dc1276bbbac449a7d0285e734e97f6a367d63a2d Mon Sep 17 00:00:00 2001 From: Daniil Kazantsev Date: Fri, 16 Jan 2026 16:08:09 +0000 Subject: [PATCH 3/4] Update httomo/data/dataset_store.py Co-authored-by: Yousef Moazzam --- httomo/data/dataset_store.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/httomo/data/dataset_store.py b/httomo/data/dataset_store.py index 35c735646..3c88017cc 100644 --- a/httomo/data/dataset_store.py +++ b/httomo/data/dataset_store.py @@ -40,7 +40,7 @@ from numpy.typing import DTypeLike import weakref -from httomo.utils import catchtime, log_once, make_3d_shape_from_shape +from httomo.utils import log_once, make_3d_shape_from_shape class DataSetStoreWriter(ReadableDataSetSink): From fc5fcf3a513f1aa464bf0fbaaa43f78f692e93b6 Mon Sep 17 00:00:00 2001 From: algol Date: Fri, 16 Jan 2026 16:09:36 +0000 Subject: [PATCH 4/4] message fixed --- httomo/data/dataset_store.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/httomo/data/dataset_store.py b/httomo/data/dataset_store.py index 3c88017cc..29898782e 100644 --- a/httomo/data/dataset_store.py +++ b/httomo/data/dataset_store.py @@ -294,7 +294,7 @@ def __init__( ) else: log_once( - f"Slicing axis change (reslice) from sinogram to projections took {(end - start):.9f}s.", + f"Slicing axis change (reslice) from sinogram to projection took {(end - start):.9f}s.", level=logging.INFO, ) self._slicing_dim = slicing_dim