From 36c8c6d9c9e26d57da7cbb7b6729cbf263c16155 Mon Sep 17 00:00:00 2001 From: Xylar Asay-Davis Date: Thu, 21 Dec 2017 08:03:05 +0100 Subject: [PATCH] Fix first file for time series This merge makes the range of files printed in the log ignore the first year if it is not in the requested range, even though it gets added to allow anomaly computations. --- .../shared/time_series/mpas_time_series_task.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/mpas_analysis/shared/time_series/mpas_time_series_task.py b/mpas_analysis/shared/time_series/mpas_time_series_task.py index 4f165d815..684292bdf 100644 --- a/mpas_analysis/shared/time_series/mpas_time_series_task.py +++ b/mpas_analysis/shared/time_series/mpas_time_series_task.py @@ -151,6 +151,12 @@ def setup_and_check(self): # {{{ self._update_time_series_bounds_from_file_names() + self.runMessage = '\nComputing MPAS time series from first year ' \ + 'plus files:\n' \ + ' {} through\n {}'.format( + os.path.basename(self.inputFiles[0]), + os.path.basename(self.inputFiles[-1])) + # Make sure first year of data is included for computing anomalies simulationStartTime = get_simulation_start_time(self.runStreams) firstYear = int(simulationStartTime[0:4]) @@ -180,10 +186,7 @@ def run_task(self): # {{{ # nothing to do return - self.logger.info('\nComputing MPAS time series from files:\n' - ' {} through\n {}'.format( - os.path.basename(self.inputFiles[0]), - os.path.basename(self.inputFiles[-1]))) + self.logger.info(self.runMessage) self._compute_time_series_with_ncrcat()