From d11c5e18caad4b79b1d6dbbf02ea06ad5583e80a Mon Sep 17 00:00:00 2001 From: Torben Schiz <49746900+tjwsch@users.noreply.github.com> Date: Tue, 20 Aug 2024 14:18:03 +0200 Subject: [PATCH] Fix snapshot attributes and log completion only once (#127) --- micro_manager/snapshot/dataset.py | 2 +- micro_manager/snapshot/snapshot.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/micro_manager/snapshot/dataset.py b/micro_manager/snapshot/dataset.py index 36172e8..19ed3f0 100644 --- a/micro_manager/snapshot/dataset.py +++ b/micro_manager/snapshot/dataset.py @@ -219,7 +219,7 @@ def write_crashed_snapshots(self, file_path: str, crashed_input: list): def set_status(self, file_path: str, status: str): """ - Set the status of the file to "finished" to indicate that it is no longer accessed. + Set the status of file to the given status. Parameters ---------- diff --git a/micro_manager/snapshot/snapshot.py b/micro_manager/snapshot/snapshot.py index 3e2be75..e94456d 100644 --- a/micro_manager/snapshot/snapshot.py +++ b/micro_manager/snapshot/snapshot.py @@ -129,7 +129,6 @@ def solve(self) -> None: self._data_storage.write_crashed_snapshots( self._output_file_path, self._crashed_snapshots ) - self._data_storage.set_status(self._output_file_path, "none") # Merge output files if self._is_parallel: @@ -144,7 +143,10 @@ def solve(self) -> None: list_of_output_files, self._parameter_space_size, ) - self._logger.info("Snapshot computation completed.") + else: + self._data_storage.set_status(self._output_file_path, "finished") + if self._rank == 0: + self._logger.info("Snapshot computation completed.") def initialize(self) -> None: """