ExperimentTracker#

Module: exa.core.sequence.experiment_tracker

class ExperimentTracker(experiment)#

Bases: object

Wraps an instance of Experiment and tracks the run IDs and analysis.

ExperimentTracker behaves like a normal Experiment, but also keeps track of run IDs generated with run() and arguments given to analyze().

The ExperimentTracker is provided so that users may subclass it to customize the behavior of run() and analyze(). See exa.sequence.definitions.trackers for examples.

Note

The ExperimentTracker is only meant to be used for one round of run-analyze. To do multiple rounds, use a new ExperimentTracker object. Otherwise, only the latest results are tracked.

Parameters:

experiment (Experiment) – An instance of Experiment that is wrapped.

Attributes

custom_analysis

Custom analysis function to call for the experiment instead of the native analyze method.

experiment_class_name

Returns the class name of the experiment.

Methods

analyze

Wraps :experiment analyze and captures the used arguments and resulting AnalyzeResult.

run

Wraps Experiment.run() and captures the resulting run ID.

tracked_content

Returns the captured content.

custom_analysis: Callable[[...], AnalyzeResult] | None = None#

Custom analysis function to call for the experiment instead of the native analyze method.

property experiment_class_name: str#

Returns the class name of the experiment.

run(*args, **kwargs)#

Wraps Experiment.run() and captures the resulting run ID.

Return type:

ExperimentTracker

analyze(custom_analysis=None, **kwargs)#

Wraps :experiment analyze and captures the used arguments and resulting AnalyzeResult.

Parameters:
  • custom_analysis (Callable[[...], AnalyzeResult] | None) – Custom analysis function to call for the experiment instead of Experiment.analyze().

  • kwargs – Additional arguments for the analysis function.

Returns:

The analyze result.

Return type:

AnalyzeResult

tracked_content()#

Returns the captured content.

Returns:

The captured result of analyze, and other data needed to reconstruct the analysis.

Return type:

tuple[NodeExecution, AnalyzeResult]

Inheritance

Inheritance diagram of exa.core.sequence.experiment_tracker.ExperimentTracker