Skip to content

Commit

Permalink
Revert "Doe categorical (#243)"
Browse files Browse the repository at this point in the history
This reverts commit 126393e.
  • Loading branch information
ufukguenes authored Aug 11, 2023
1 parent 126393e commit 1f924f3
Show file tree
Hide file tree
Showing 22 changed files with 13,413 additions and 1,844 deletions.
1 change: 0 additions & 1 deletion bofire/data_models/constraints/nchoosek.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ def is_fulfilled(self, experiments: pd.DataFrame, tol: float = 1e-6) -> pd.Serie
Returns:
bool: True if fulfilled else False.
"""

cols = self.features
sums = (np.abs(experiments[cols]) > tol).sum(axis=1)

Expand Down
4 changes: 2 additions & 2 deletions bofire/data_models/constraints/nonlinear.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def jacobian(self, experiments: pd.DataFrame) -> pd.DataFrame:


class NonlinearEqualityConstraint(NonlinearConstraint):
"""Nonlinear equality constraint of the form 'expression == 0'.
"""Nonlinear inequality constraint of the form 'expression <= 0'.
Attributes:
expression: Mathematical expression that can be evaluated by `pandas.eval`.
Expand All @@ -91,7 +91,7 @@ def __str__(self):


class NonlinearInequalityConstraint(NonlinearConstraint):
"""Nonlinear inequality constraint of the form 'expression <= 0'.
"""Linear inequality constraint of the form 'expression == 0'.
Attributes:
expression: Mathematical expression that can be evaluated by `pandas.eval`.
Expand Down
2 changes: 1 addition & 1 deletion bofire/data_models/domain/domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def validate_linear_constraints(cls, v, values):
# gather continuous inputs in dictionary
continuous_inputs_dict = {}
for f in values["inputs"]:
if isinstance(f, ContinuousInput):
if type(f) is ContinuousInput:
continuous_inputs_dict[f.key] = f

# check if non continuous input features appear in linear constraints
Expand Down
9 changes: 3 additions & 6 deletions bofire/data_models/strategies/doe.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

from bofire.data_models.constraints.api import Constraint
from bofire.data_models.features.api import (
CategoricalInput,
DiscreteInput,
Feature,
MolecularInput,
)
Expand All @@ -20,19 +22,14 @@ class DoEStrategy(Strategy):
],
str,
]
optimization_strategy: Literal[
"default", "exhaustive", "branch-and-bound", "partially-random", "relaxed"
] = "default"

verbose: bool = False

@classmethod
def is_constraint_implemented(cls, my_type: Type[Constraint]) -> bool:
return True

@classmethod
def is_feature_implemented(cls, my_type: Type[Feature]) -> bool:
if my_type in [MolecularInput]:
if my_type in [CategoricalInput, DiscreteInput, MolecularInput]:
return False
return True

Expand Down
6 changes: 0 additions & 6 deletions bofire/data_models/strategies/samplers/polytope.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@
Feature,
)
from bofire.data_models.strategies.samplers.sampler import SamplerStrategy
from bofire.strategies.doe.utils_features import (
RelaxableBinaryInput,
RelaxableDiscreteInput,
)


class PolytopeSampler(SamplerStrategy):
Expand Down Expand Up @@ -49,6 +45,4 @@ def is_feature_implemented(cls, my_type: Type[Feature]) -> bool:
CategoricalInput,
DiscreteInput,
CategoricalDescriptorInput,
RelaxableBinaryInput,
RelaxableDiscreteInput,
]
232 changes: 0 additions & 232 deletions bofire/strategies/doe/branch_and_bound.py

This file was deleted.

Loading

0 comments on commit 1f924f3

Please sign in to comment.