Skip to content

Commit

Permalink
Fix config options for reference climatologies
Browse files Browse the repository at this point in the history
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.)
  • Loading branch information
xylar committed Aug 16, 2022
1 parent a29eeed commit c321057
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit c321057

Please sign in to comment.