openfl.component.director.experiment.ExperimentsRegistry

class openfl.component.director.experiment.ExperimentsRegistry

Bases: object

ExperimentsList class.

Methods

add

Add experiment to queue of not started experiments.

finish_active

Finish active experiment.

get

Get experiment by name.

get_next_experiment

Context manager.

get_user_experiments

Get list of experiments for specific user.

remove

Remove experiment from everywhere.

Attributes

active_experiment

Get active experiment.

pending_experiments

Get queue of not started experiments.

property active_experiment: Experiment | None

Get active experiment.

Returns:

Union[Experiment, None] – The active experiment if exists, None otherwise.

add(experiment: Experiment) None

Add experiment to queue of not started experiments.

Parameters:

experiment (Experiment) – The experiment to add.

finish_active() None

Finish active experiment.

get(key: str, default=None) Experiment

Get experiment by name.

Parameters:
  • key (str) – The name of the experiment.

  • default (optional) – The default value to return if the experiment does not exist.

Returns:

Experiment – The experiment with the given name, or the default value if the experiment does not exist.

get_next_experiment()

Context manager.

On enter get experiment from pending_experiments. On exit put finished experiment to archive_experiments.

get_user_experiments(user: str) List[Experiment]

Get list of experiments for specific user.

Parameters:

user (str) – The name of the user.

Returns:

List[Experiment] – The list of experiments for the specific user.

property pending_experiments: List[str]

Get queue of not started experiments.

Returns:

List[str] – The list of pending experiments.

remove(name: str) None

Remove experiment from everywhere.

Parameters:

name (str) – The name of the experiment to remove.