Skip to content

Commit

Permalink
base enum always also on (str, Enum) (#458)
Browse files Browse the repository at this point in the history
  • Loading branch information
jduerholt authored Nov 12, 2024
1 parent f47a008 commit 811fcbf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions bofire/data_models/enum.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
from enum import Enum


class SamplingMethodEnum(Enum):
class SamplingMethodEnum(str, Enum):
UNIFORM = "UNIFORM"
SOBOL = "SOBOL"
LHS = "LHS"


class CategoricalMethodEnum(Enum):
class CategoricalMethodEnum(str, Enum):
"""Enumeration class of supported methods how to handle categorical features
Currently, exhaustive search and free relaxation are implemented.
"""
Expand All @@ -17,7 +17,7 @@ class CategoricalMethodEnum(Enum):
# PR = "PR" available soon


class CategoricalEncodingEnum(Enum):
class CategoricalEncodingEnum(str, Enum):
"""Enumeration class of implemented categorical encodings
Currently, one-hot and ordinal encoding are implemented.
"""
Expand All @@ -28,19 +28,19 @@ class CategoricalEncodingEnum(Enum):
DESCRIPTOR = "DESCRIPTOR" # only possible for categorical with descriptors


class ClassificationMetricsEnum(Enum):
class ClassificationMetricsEnum(str, Enum):
"""Enumeration class for classification metrics."""

ACCURACY = "ACCURACY"
F1 = "F1"


class OutputFilteringEnum(Enum):
class OutputFilteringEnum(str, Enum):
ALL = "ALL"
ANY = "ANY"


class RegressionMetricsEnum(Enum):
class RegressionMetricsEnum(str, Enum):
"""Enumeration class for regression metrics."""

R2 = "R2"
Expand All @@ -52,7 +52,7 @@ class RegressionMetricsEnum(Enum):
FISHER = "FISHER"


class UQRegressionMetricsEnum(Enum):
class UQRegressionMetricsEnum(str, Enum):
"""Enumeration class for ucertainty regression metrics."""

PEARSON_UQ = "PEARSON_UQ"
Expand Down
2 changes: 1 addition & 1 deletion bofire/data_models/surrogates/scaler.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from enum import Enum


class ScalerEnum(Enum):
class ScalerEnum(str, Enum):
"""Enumeration class of supported scalers
Currently, normalization and standardization are implemented.
"""
Expand Down
2 changes: 1 addition & 1 deletion bofire/strategies/enum.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from enum import Enum


class OptimalityCriterionEnum(Enum):
class OptimalityCriterionEnum(str, Enum):
D_OPTIMALITY = "D_OPTIMALITY"
E_OPTIMALITY = "E_OPTIMALITY"
A_OPTIMALITY = "A_OPTIMALITY"
Expand Down

0 comments on commit 811fcbf

Please sign in to comment.