@@ -244,7 +244,7 @@ def _create_task_log_info(self, task_record):
244244 task_log_info ['task_joins' ] = None
245245 return task_log_info
246246
247- def _count_deps (self , depends ) :
247+ def _count_deps (self , depends : Sequence [ Future ]) -> int :
248248 """Count the number of unresolved futures in the list depends.
249249 """
250250 count = 0
@@ -256,7 +256,7 @@ def _count_deps(self, depends):
256256 return count
257257
258258 @property
259- def config (self ):
259+ def config (self ) -> Config :
260260 """Returns the fully initialized config that the DFK is actively using.
261261
262262 Returns:
@@ -483,14 +483,14 @@ def _unwrap_remote_exception_wrapper(future: Future) -> Any:
483483 result .reraise ()
484484 return result
485485
486- def wipe_task (self , task_id ) :
486+ def wipe_task (self , task_id : int ) -> None :
487487 """ Remove task with task_id from the internal tasks table
488488 """
489489 if self .config .garbage_collect :
490490 del self .tasks [task_id ]
491491
492492 @staticmethod
493- def check_staging_inhibited (kwargs ) :
493+ def check_staging_inhibited (kwargs : Dict [ str , Any ]) -> bool :
494494 return kwargs .get ('_parsl_staging_inhibit' , False )
495495
496496 def launch_if_ready (self , task_record : TaskRecord ) -> None :
@@ -642,7 +642,7 @@ def launch_task(self, task_record: TaskRecord, executable: Callable, *args: Tupl
642642
643643 return exec_fu
644644
645- def _add_input_deps (self , executor , args , kwargs , func ) :
645+ def _add_input_deps (self , executor : str , args : Sequence [ Any ] , kwargs : Dict [ str , Any ], func : Callable ) -> Tuple [ Sequence [ Any ], Dict [ str , Any ], Callable ] :
646646 """Look for inputs of the app that are files. Give the data manager
647647 the opportunity to replace a file with a data future for that file,
648648 for example wrapping the result of a staging action.
@@ -672,7 +672,7 @@ def _add_input_deps(self, executor, args, kwargs, func):
672672
673673 return tuple (newargs ), kwargs , func
674674
675- def _add_output_deps (self , executor , args , kwargs , app_fut , func ) :
675+ def _add_output_deps (self , executor : str , args : Sequence [ Any ] , kwargs : Dict [ str , Any ], app_fut : AppFuture , func : Callable ) -> Callable :
676676 logger .debug ("Adding output dependencies" )
677677 outputs = kwargs .get ('outputs' , [])
678678 app_fut ._outputs = []
@@ -720,7 +720,7 @@ def _gather_all_deps(self, args: Sequence[Any], kwargs: Dict[str, Any]) -> List[
720720 """
721721 depends : List [Future ] = []
722722
723- def check_dep (d ) :
723+ def check_dep (d : Any ) -> None :
724724 if isinstance (d , Future ):
725725 depends .extend ([d ])
726726
@@ -953,7 +953,7 @@ def submit(self, func, app_args, executors='all', cache=False, ignore_for_cache=
953953
954954 for d in depends :
955955
956- def callback_adapter (dep_fut ) :
956+ def callback_adapter (dep_fut : Future ) -> None :
957957 self .launch_if_ready (task_def )
958958
959959 try :
@@ -972,7 +972,7 @@ def callback_adapter(dep_fut):
972972 # and a drain function might look like this.
973973 # If tasks have their states changed, this won't work properly
974974 # but we can validate that...
975- def log_task_states (self ):
975+ def log_task_states (self ) -> None :
976976 logger .info ("Summary of tasks in DFK:" )
977977
978978 with self .task_state_counts_lock :
@@ -1221,7 +1221,7 @@ def checkpoint(self, tasks: Optional[Sequence[TaskRecord]] = None) -> str:
12211221
12221222 return checkpoint_dir
12231223
1224- def _load_checkpoints (self , checkpointDirs ) :
1224+ def _load_checkpoints (self , checkpointDirs : Sequence [ str ]) -> Dict [ str , Future [ Any ]] :
12251225 """Load a checkpoint file into a lookup table.
12261226
12271227 The data being loaded from the pickle file mostly contains input
@@ -1248,7 +1248,7 @@ def _load_checkpoints(self, checkpointDirs):
12481248 try :
12491249 data = pickle .load (f )
12501250 # Copy and hash only the input attributes
1251- memo_fu = Future ()
1251+ memo_fu : Future = Future ()
12521252 assert data ['exception' ] is None
12531253 memo_fu .set_result (data ['result' ])
12541254 memo_lookup_table [data ['hash' ]] = memo_fu
0 commit comments