saveable_objects.checkpointing.succeeded¶
- saveable_objects.checkpointing.succeeded(load_attempt: SaveableObject | bool | Tuple[SaveableObject, bool]) bool[source]¶
Determines if a
SaveableObject.load(),.tryload(),.loadif(), or.loadifparams()attempt succeeds.- Parameters:
load_attempt (SaveableObject | bool | (SaveableObject, bool)) – The output of
load(),tryload(),loadif(), orloadifparams().- Returns:
Returns
Trueis the the load_attempt succeeded, elseFalse.- Return type:
bool
Notes
Example use:
if succeeded(obj := SaveableObject.loadif(*args, path="filename.pkl", **kwargs)): ... # code that uses a successfully loaded obj else: ... # code to run if obj failed to load