|
29 | 29 | from ax.core.base_trial import BaseTrial |
30 | 30 | from ax.core.batch_trial import BatchTrial |
31 | 31 | from ax.core.data import combine_data_rows_favoring_recent, Data |
| 32 | +from ax.core.experiment_status import ExperimentStatus |
32 | 33 | from ax.core.generator_run import GeneratorRun |
33 | 34 | from ax.core.metric import Metric, MetricFetchE, MetricFetchResult |
34 | 35 | from ax.core.objective import MultiObjective |
@@ -146,6 +147,7 @@ def __init__( |
146 | 147 | self._optimization_config: OptimizationConfig | None = None |
147 | 148 | self._tracking_metrics: dict[str, Metric] = {} |
148 | 149 | self._time_created: datetime = datetime.now() |
| 150 | + self._status: ExperimentStatus | None = None |
149 | 151 | self._trials: dict[int, BaseTrial] = {} |
150 | 152 | self._properties: dict[str, Any] = properties or {} |
151 | 153 |
|
@@ -231,6 +233,27 @@ def experiment_type(self, experiment_type: str | None) -> None: |
231 | 233 | """Set the type of the experiment.""" |
232 | 234 | self._experiment_type = experiment_type |
233 | 235 |
|
| 236 | + @property |
| 237 | + def status(self) -> ExperimentStatus | None: |
| 238 | + """The current status of the experiment. |
| 239 | +
|
| 240 | + Status tracks the high-level lifecycle phase of the experiment: |
| 241 | + DRAFT, INITIALIZATION, OPTIMIZATION, COMPLETED. |
| 242 | +
|
| 243 | + For new experiments, status defaults to DRAFT. For legacy experiments |
| 244 | + that were created before the status field was added, status may be None. |
| 245 | + """ |
| 246 | + return self._status |
| 247 | + |
| 248 | + @status.setter |
| 249 | + def status(self, status: ExperimentStatus | None) -> None: |
| 250 | + """Set the status of the experiment. |
| 251 | +
|
| 252 | + Args: |
| 253 | + status: The new status for the experiment. |
| 254 | + """ |
| 255 | + self._status = status |
| 256 | + |
234 | 257 | @property |
235 | 258 | def search_space(self) -> SearchSpace: |
236 | 259 | """The search space for this experiment. |
|
0 commit comments