Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions ax/core/base_trial.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,15 @@ def __init__(
self._ttl_seconds: int | None = ttl_seconds
self._index: int = self._experiment._attach_trial(self, index=index)

trial_type = (
self._trial_type: str = (
trial_type
if trial_type is not None
else self._experiment.default_trial_type
)
if not self._experiment.supports_trial_type(trial_type):
if not self._experiment.supports_trial_type(self._trial_type):
raise ValueError(
f"Trial type {trial_type} is not supported by the experiment."
f"Trial type {self._trial_type} is not supported by the experiment."
)
self._trial_type = trial_type

self.__status: TrialStatus | None = None
# Uses `_status` setter, which updates trial statuses to trial indices
Expand Down Expand Up @@ -285,7 +284,7 @@ def stop_metadata(self) -> dict[str, Any]:
return self._stop_metadata

@property
def trial_type(self) -> str | None:
def trial_type(self) -> str:
"""The type of the trial.

Relevant for experiments containing different kinds of trials
Expand Down
Loading
Loading