File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99
1010from abc import ABC
1111from dataclasses import dataclass
12- from enum import Enum , unique
12+ from enum import StrEnum , unique
1313from typing import TYPE_CHECKING
1414
1515from ax .core .data import Data
@@ -51,7 +51,7 @@ def _unique_id(self) -> str:
5151
5252
5353@unique
54- class AuxiliaryExperimentPurpose (Enum ):
54+ class AuxiliaryExperimentPurpose (StrEnum ):
5555 # BOPE Aux Experiment Usage pattern:
5656 # 1. Run the exploratory batch for the main / BO experiment.
5757 # 2. Use the BO experiment as the auxiliary experiment for the PE experiment
Original file line number Diff line number Diff line change 3333from __future__ import annotations
3434
3535from dataclasses import dataclass
36- from enum import Enum
36+ from enum import StrEnum
3737from functools import lru_cache
3838from pathlib import Path
3939from typing import Any
4848from pyre_extensions import none_throws
4949
5050
51- class ChemistryProblemType (Enum ):
52- # pyre-fixme[35]: Target cannot be annotated.
53- SUZUKI : str = "suzuki"
54- # pyre-fixme[35]: Target cannot be annotated.
55- DIRECT_ARYLATION : str = "direct_arylation"
51+ class ChemistryProblemType (StrEnum ):
52+ SUZUKI = "suzuki"
53+ DIRECT_ARYLATION = "direct_arylation"
5654
5755
5856@dataclass (frozen = True )
Original file line number Diff line number Diff line change 99from __future__ import annotations
1010
1111from copy import deepcopy
12- from enum import Enum
12+ from enum import StrEnum
1313from functools import lru_cache
1414from math import sqrt
1515from typing import Any
2828from sklearn .neural_network import MLPClassifier , MLPRegressor
2929
3030
31- class SklearnModelType (Enum ):
32- # pyre-fixme[35]: Target cannot be annotated.
33- RF : str = "rf"
34- # pyre-fixme[35]: Target cannot be annotated.
35- NN : str = "nn"
31+ class SklearnModelType (StrEnum ):
32+ RF = "rf"
33+ NN = "nn"
3634
3735
38- class SklearnDataset (Enum ):
39- # pyre-fixme[35]: Target cannot be annotated.
40- DIGITS : str = "digits"
41- # pyre-fixme[35]: Target cannot be annotated.
42- BOSTON : str = "boston"
43- # pyre-fixme[35]: Target cannot be annotated.
44- CANCER : str = "cancer"
36+ class SklearnDataset (StrEnum ):
37+ DIGITS = "digits"
38+ BOSTON = "boston"
39+ CANCER = "cancer"
4540
4641
4742@lru_cache (maxsize = 8 )
Original file line number Diff line number Diff line change 99import enum
1010from collections import OrderedDict
1111from collections .abc import Mapping
12+ from enum import StrEnum
1213from hashlib import md5
1314
1415import pandas as pd
@@ -25,7 +26,7 @@ class DomainType(enum.Enum):
2526 DERIVED = 4
2627
2728
28- class MetricIntent (enum . Enum ):
29+ class MetricIntent (StrEnum ):
2930 """Class for enumerating metric use types."""
3031
3132 OBJECTIVE = "objective"
Original file line number Diff line number Diff line change 66
77# pyre-strict
88
9- from enum import Enum , unique
9+ from enum import StrEnum , unique
1010
1111# ------------------------- Miscellaneous -------------------------
1212
3636
3737
3838@unique
39- class Keys (str , Enum ):
39+ class Keys (StrEnum ):
4040 """Enum of reserved keys in options dicts etc, alphabetized.
4141
4242
Original file line number Diff line number Diff line change 66# pyre-strict
77
88from collections .abc import Mapping
9- from enum import Enum
9+ from enum import StrEnum
1010from logging import Logger
1111from typing import Protocol
1212
3333KENDALL_TAU_RANK_CORRELATION = "Kendall tau rank correlation"
3434
3535
36- class ModelFitMetricDirection (Enum ):
36+ class ModelFitMetricDirection (StrEnum ):
3737 """Model fit metric directions."""
3838
3939 MINIMIZE = "minimize"
You can’t perform that action at this time.
0 commit comments