From c32105713c76ede6b7724237c544fbac77b1846b Mon Sep 17 00:00:00 2001 From: Xylar Asay-Davis Date: Tue, 16 Aug 2022 13:39:26 +0200 Subject: [PATCH] Fix config options for reference climatologies The start and end year for reference climatologies were getting overridden by the user's specified start and end year for normal climatologies. (This maybe suggests that we should consider a different strategy for setting the start and end years and dates for reference climatologies that doesn't rely on overriding the user config options.) --- .../climatology/ref_year_mpas_climatology_task.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/mpas_analysis/shared/climatology/ref_year_mpas_climatology_task.py b/mpas_analysis/shared/climatology/ref_year_mpas_climatology_task.py index db494b0e9..7f13f1046 100644 --- a/mpas_analysis/shared/climatology/ref_year_mpas_climatology_task.py +++ b/mpas_analysis/shared/climatology/ref_year_mpas_climatology_task.py @@ -100,10 +100,12 @@ def get_start_and_end(self): startDate = '{:04d}-01-01_00:00:00'.format(startYear) endDate = '{:04d}-12-31_23:59:59'.format(endYear) - config.set('climatology', 'startYear', str(startYear)) - config.set('climatology', 'startDate', startDate) - config.set('climatology', 'endYear', str(endYear)) - config.set('climatology', 'endDate', endDate) + # using "user=True" so these changes take priority over user config + # options + config.set('climatology', 'startYear', str(startYear), user=True) + config.set('climatology', 'startDate', startDate, user=True) + config.set('climatology', 'endYear', str(endYear), user=True) + config.set('climatology', 'endDate', endDate, user=True) return startYear, endYear