@@ -379,7 +379,8 @@ def __init__(
379379 raise WorkflowConfigError ("missing [scheduling][[graph]] section." )
380380 # (The check that 'graph' is defined is below).
381381
382- # Override the workflow defn with an initial point from the CLI.
382+ # Override the workflow defn with an initial point from the CLI
383+ # or from reload/restart:
383384 icp_str = getattr (self .options , 'icp' , None )
384385 if icp_str is not None :
385386 self .cfg ['scheduling' ]['initial cycle point' ] = icp_str
@@ -564,7 +565,7 @@ def __init__(
564565 self ._upg_wflow_event_names ()
565566
566567 self .mem_log ("config.py: before load_graph()" )
567- self .load_graph ()
568+ self ._load_graph ()
568569 self .mem_log ("config.py: after load_graph()" )
569570
570571 self ._set_completion_expressions ()
@@ -684,10 +685,10 @@ def prelim_process_graph(self) -> None:
684685 all (item in ['graph' , '1' , 'R1' ] for item in graphdict )
685686 ):
686687 # Pure acyclic graph, assume integer cycling mode with '1' cycle
687- self .cfg ['scheduling' ]['cycling mode' ] = INTEGER_CYCLING_TYPE
688688 for key in ('initial cycle point' , 'final cycle point' ):
689689 if key not in self .cfg ['scheduling' ]:
690690 self .cfg ['scheduling' ][key ] = '1'
691+ self .cfg ['scheduling' ]['cycling mode' ] = INTEGER_CYCLING_TYPE
691692
692693 def process_utc_mode (self ):
693694 """Set UTC mode from config or from stored value on restart.
@@ -761,7 +762,6 @@ def process_initial_cycle_point(self) -> None:
761762 Sets:
762763 self.initial_point
763764 self.cfg['scheduling']['initial cycle point']
764- self.evaluated_icp
765765 Raises:
766766 WorkflowConfigError - if it fails to validate
767767 """
@@ -775,11 +775,6 @@ def process_initial_cycle_point(self) -> None:
775775 raise WorkflowConfigError (
776776 "This workflow requires an initial cycle point." )
777777 icp = _parse_iso_cycle_point (orig_icp )
778- self .evaluated_icp = None
779- if icp != orig_icp :
780- # now/next()/previous() was used, need to store
781- # evaluated point in DB
782- self .evaluated_icp = icp
783778 self .initial_point = get_point (icp ).standardise ()
784779 self .cfg ['scheduling' ]['initial cycle point' ] = str (self .initial_point )
785780
@@ -2312,7 +2307,7 @@ def _close_families(l_id, r_id, clf_map):
23122307
23132308 return lret , rret
23142309
2315- def load_graph (self ):
2310+ def _load_graph (self ):
23162311 """Parse and load dependency graph."""
23172312 LOG .debug ("Parsing the dependency graph" )
23182313
@@ -2336,18 +2331,14 @@ def load_graph(self):
23362331 section = get_sequence_cls ().get_async_expr ()
23372332 graphdict [section ] = graphdict .pop ('graph' )
23382333
2339- icp = self .cfg [ 'scheduling' ][ 'initial cycle point' ]
2334+ icp = str ( self .initial_point )
23402335 fcp = self .cfg ['scheduling' ]['final cycle point' ]
23412336
23422337 # Make a stack of sections and graphs [(sec1, graph1), ...]
23432338 sections = []
23442339 for section , value in self .cfg ['scheduling' ]['graph' ].items ():
23452340 # Substitute initial and final cycle points.
2346- if icp :
2347- section = section .replace ("^" , icp )
2348- elif "^" in section :
2349- raise WorkflowConfigError ("Initial cycle point referenced"
2350- " (^) but not defined." )
2341+ section = section .replace ("^" , icp )
23512342 if fcp :
23522343 section = section .replace ("$" , fcp )
23532344 elif "$" in section :
0 commit comments