From 2de4e842d6ba555cc1f18473403c04085dc586b2 Mon Sep 17 00:00:00 2001 From: Donald Campbell <125581724+donaldcampbelljr@users.noreply.github.com> Date: Mon, 27 Nov 2023 13:06:49 -0500 Subject: [PATCH] set pipeline_stats_file if pipestat_results_file IS provided, remove checking for the first record_identifier during get_stat --- pypiper/manager.py | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/pypiper/manager.py b/pypiper/manager.py index 5b6bb3c..1a4b1ab 100644 --- a/pypiper/manager.py +++ b/pypiper/manager.py @@ -337,6 +337,7 @@ def __init__( self.pipestat_results_file = self.pipeline_stats_file elif pipestat_results_file: self.pipestat_results_file = pipestat_results_file + self.pipeline_stats_file = self.pipestat_results_file def _get_arg(args_dict, arg_name): """safely get argument from arg dict -- return None if doesn't exist""" @@ -1859,18 +1860,11 @@ def _refresh_stats(self): if os.path.isfile(self.pipeline_stats_file): _, data = read_yaml_data(path=self.pipeline_stats_file, what="stats_file") - record_identifier = list( - data[self._pipestat_manager.pipeline_name][ - self._pipestat_manager.pipeline_type - ] - )[0] - - # Confirm that the loaded stats file is the same namespace as the pipeline manager - if record_identifier == self._pipestat_manager.record_identifier: - for key, value in data[self._pipestat_manager.pipeline_name][ - self._pipestat_manager.pipeline_type - ][record_identifier].items(): - self.stats_dict[key] = value + + for key, value in data[self._pipestat_manager.pipeline_name][ + self._pipestat_manager.pipeline_type + ][self._pipestat_manager.record_identifier].items(): + self.stats_dict[key] = value def get_stat(self, key): """