[docs] 5classCheckpointFailedWarning(Warning): 6"Warns that a checkpoint failed to save." 7pass
8
[docs] 9classCheckpoint(SaveableObject):10"""A data structure to store the progress of the parallel execution of a11 function `func`.12 """13func_name:str14"""The name of the function being executed in parallel.15 """1617parameters:List[List[Any]]18"""A list of argument lists for the function. The ``i`` th call of the19 function is ``func_name(*parameters[i])``."""2021output:List[Any]22"""An ordered list of the outputs of the function:23 ``output[i]=func_name(*parameters[i])``. ``output[i]`` should be set24 to ``None`` if `func_name(*parameters[i])` is yet to finish execution."""2526completed:List[bool]27"""A list of which outputs have been computed. ``True`` represents the ith28 output has been computed."""2930index:int31"""The largest index of the parameter list currently being computed."""3233done:int34"""The number of outputs already computed."""35
[docs]36def__init__(self,37func_name:str,38parameters:List[List[Any]],39output:List[Any],40completed:List[bool],41index:int,42done:int,43path:Optional[str]=None):44"""Initialises a data structure to store the progress of the parallel45 execution of a function.4647 Parameters48 ----------49 func_name : str50 The name of the function being executed in parallel.51 parameters : List[List[Any]]52 A list of argument lists for the function. The `i`th call of the53 function is ``func_name(*parameters[i])``.54 output : List[Any]55 An ordered list of the outputs of the function:56 ``output[i]=func_name(*parameters[i])``. ``output[i]`` should be set57 to `None` if `func_name(*parameters[i])` is yet to finish execution.58 completed : List[bool]59 A list of which outputs have been computed. ``True`` represents the60 ith output has been computed.61 index : int62 The largest index of the parameter list currently being computed.63 done : int64 The number of outputs already computed.65 path : str, optional66 File path to save the object to. If ``None`` then the object is not67 saved. By default ``None``.68 """69self.func_name=func_name70self.parameters=parameters71self.output=output72self.completed=completed73self.index=index74self.done=done75super().__init__(path=path)