Skip to content
Closed
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
14 changes: 9 additions & 5 deletions ax/core/base_trial.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from __future__ import annotations

from abc import ABC, abstractmethod, abstractproperty
from abc import ABC, abstractmethod
from collections.abc import Callable
from copy import deepcopy
from datetime import datetime, timedelta
Expand Down Expand Up @@ -133,19 +133,22 @@ def __init__(
# might be getting deployed to.
self._properties: dict[str, Any] = {}

@abstractproperty
@property
@abstractmethod
def arms(self) -> list[Arm]:
"""All arms associated with this trial."""
pass

@abstractproperty
@property
@abstractmethod
def arms_by_name(self) -> dict[str, Arm]:
"""A mapping of from arm names, to all arms associated with
this trial.
"""
pass

@abstractproperty
@property
@abstractmethod
def abandoned_arms(self) -> list[Arm]:
"""All abandoned arms, associated with this trial."""
pass
Expand Down Expand Up @@ -473,7 +476,8 @@ def active_arms(self) -> list[Arm]:
"""All non abandoned arms associated with this trial."""
return [arm for arm in self.arms if arm not in self.abandoned_arms]

@abstractproperty
@property
@abstractmethod
def generator_runs(self) -> list[GeneratorRun]:
"""All generator runs associated with this trial."""
pass
Expand Down
5 changes: 3 additions & 2 deletions ax/core/parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from __future__ import annotations

import math
from abc import ABCMeta, abstractmethod, abstractproperty
from abc import ABCMeta, abstractmethod
from copy import deepcopy
from enum import Enum
from logging import Logger
Expand Down Expand Up @@ -283,7 +283,8 @@ def _base_repr(self) -> str:

return ret_val

@abstractproperty
@property
@abstractmethod
def domain_repr(self) -> str:
"""Returns a string representation of the domain."""
pass
Expand Down
11 changes: 7 additions & 4 deletions ax/storage/registry_bundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from __future__ import annotations

from abc import ABC, abstractproperty
from abc import ABC, abstractmethod
from collections import ChainMap
from collections.abc import Callable
from functools import cached_property
Expand Down Expand Up @@ -129,15 +129,18 @@ def class_encoder_registry(self) -> dict[type, Callable[[Any], dict[str, Any]]]:
def class_decoder_registry(self) -> dict[str, Callable[[dict[str, Any]], Any]]:
return self._json_class_decoder_registry

@abstractproperty
@property
@abstractmethod
def sqa_config(self) -> SQAConfig:
pass

@abstractproperty
@property
@abstractmethod
def encoder(self) -> Encoder:
pass

@abstractproperty
@property
@abstractmethod
def decoder(self) -> Decoder:
pass

Expand Down
11 changes: 7 additions & 4 deletions ax/utils/common/result.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from __future__ import annotations

import traceback
from abc import ABC, abstractmethod, abstractproperty
from abc import ABC, abstractmethod
from collections.abc import Callable
from functools import reduce
from typing import Any, cast, Generic, NoReturn, TypeVar
Expand All @@ -35,15 +35,18 @@ def is_ok(self) -> bool:
def is_err(self) -> bool:
pass

@abstractproperty
@property
@abstractmethod
def ok(self) -> T | None:
pass

@abstractproperty
@property
@abstractmethod
def err(self) -> E | None:
pass

@abstractproperty
@property
@abstractmethod
def value(self) -> T | E:
pass

Expand Down