Skip to content

Commit

Permalink
Remove hard coded calendar type string
Browse files Browse the repository at this point in the history
Use constants in `isodatetime.data.Calendar` instead.
  • Loading branch information
matthewrmshin committed Jul 16, 2014
1 parent d350bb6 commit 9e30c78
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/cylc/cfgspec/suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def _coerce_interval_list( value, keys, args, back_comp_unit_factor=1 ):
'scheduling' : {
'initial cycle point' : vdr(vtype='cycletime'),
'final cycle point' : vdr(vtype='cycletime'),
'cycling mode' : vdr(vtype='string', default="gregorian", options=["360day","gregorian","integer"] ),
'cycling mode' : vdr(vtype='string', default=Calendar.MODE_GREGORIAN, options=Calendar.MODES.keys() + ["integer"] ),
'runahead factor' : vdr(vtype='integer', default=2 ),
'queues' : {
'default' : {
Expand Down
3 changes: 2 additions & 1 deletion lib/cylc/cycling/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

import integer
import iso8601
from isodatetime.date import Calendar


ISO8601_CYCLING_TYPE = 'iso8601'
Expand Down Expand Up @@ -100,7 +101,7 @@ def get_sequence_cls(cycling_type=None):

def init_cyclers(cfg):
DefaultCycler.TYPE = cfg['scheduling']['cycling mode']
if DefaultCycler.TYPE in ['360day','gregorian']:
if DefaultCycler.TYPE in Calendar.MODES:
DefaultCycler.TYPE = ISO8601_CYCLING_TYPE
for cycling_type, init_func in INIT_FUNCTIONS.items():
init_func(cfg)

0 comments on commit 9e30c78

Please sign in to comment.