Skip to content

Commit

Permalink
Fix snapshot attributes and log completion only once (#127)
Browse files Browse the repository at this point in the history
  • Loading branch information
tjwsch authored Aug 20, 2024
1 parent 8c3821e commit d11c5e1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion micro_manager/snapshot/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
----------
Expand Down
6 changes: 4 additions & 2 deletions micro_manager/snapshot/snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
"""
Expand Down

0 comments on commit d11c5e1

Please sign in to comment.