Saving and Loading#

Functions for saving and loading your experiment to stop and restart.

boa.storage.scheduler_to_json_file(scheduler, filepath: PathLike = 'scheduler_snapshot.json') None[source]#

Save a JSON-serialized snapshot of this Scheduler’s settings and state to a .json file by the given path.

Parameters:

filepath (PathLike) –

Return type:

None

boa.storage.scheduler_from_json_file(filepath: PathLike = 'scheduler.json', wrapper=None, **kwargs) Scheduler[source]#

Restore an Scheduler and its state from a JSON-serialized snapshot, residing in a .json file by the given path.

Parameters:

filepath (PathLike) –

Return type:

Scheduler

boa.storage.scheduler_to_json_snapshot(scheduler: Scheduler, encoder_registry: Optional[Dict[Type, Callable[[Any], Dict[str, Any]]]] = None, class_encoder_registry: Optional[Dict[Type, Callable[[Any], Dict[str, Any]]]] = None) Dict[str, Any][source]#

Serialize this Scheduler to JSON to be able to interrupt and restart optimization and save it to file by the provided path.

Returns:

A JSON-safe dict representation of this Scheduler.

Parameters:
Return type:

Dict[str, Any]

boa.storage.scheduler_from_json_snapshot(serialized: Dict[str, Any], decoder_registry: Optional[Dict[str, Type]] = None, class_decoder_registry: Optional[Dict[str, Callable[[Dict[str, Any]], Any]]] = None, **kwargs) Scheduler[source]#

Recreate an Scheduler from a JSON snapshot.

Parameters:
Return type:

Scheduler