Experiments¶
- class ExperimentClient(beaker: Beaker)[source]¶
Methods for interacting with Beaker Experiments. Accessed via the
Beaker.experiment
property.Note
If you’re coming from the v1 client you may think we’re missing some important methods here. Those were moved to
Beaker.workload
methods since workloads encompass experiments.Warning
Do not instantiate this class directly! The
Beaker
client will create one automatically which you can access through the corresponding property.- create(*, spec: BeakerExperimentSpec | PathLike | str, name: str | None = None, workspace: Workspace | None = None) Workload [source]¶
Create/launch a new experiment workload.
See also
Use
Beaker.workload
methods for working with workload objects.- Returns:
A
BeakerWorkload
object.- Raises:
BeakerExperimentConflict – If an experiment with the given name already exists.
- get_spec(experiment: Experiment | Workload) BeakerExperimentSpec [source]¶
Get the spec that defined an experiment.
- Parameters:
experiment – The
BeakerExperiment
orBeakerWorkload
.- Returns:
The corresponding
BeakerExperimentSpec
.
- restart_tasks(experiment: Experiment | Workload) Workload [source]¶
Restart all failed or canceled tasks of an experiment.
See also
- Parameters:
experiment – The
BeakerExperiment
orBeakerWorkload
.- Returns:
The updated
BeakerWorkload
.