Skip to content

Commit

Permalink
update to ConfigSpace 0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul-Saves committed Nov 28, 2023
1 parent f956d45 commit 262c211
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ matplotlib # used in examples and tests
pytest # tests runner
pytest-xdist # allows running parallel testing with pytest -n <num_workers>
black # check code format
ConfigSpace~=0.6.1
ConfigSpace~=0.7.1
6 changes: 3 additions & 3 deletions smt/utils/design_space.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
ForbiddenInClause,
ForbiddenAndConjunction,
)
from ConfigSpace.exceptions import ForbiddenValueError
from ConfigSpace.exceptions import ForbiddenValueError, InactiveHyperparameter
from ConfigSpace.util import get_random_neighbor

HAS_CONFIG_SPACE = True
Expand Down Expand Up @@ -967,9 +967,9 @@ def _get_correct_config(self, vector: np.ndarray) -> Configuration:
config.is_valid_configuration()
return config

except ValueError as e:
except Exception as e:
error_str = str(e)
if "Inactive hyperparameter" in error_str:
if isinstance(e, InactiveHyperparameter):
# Deduce which parameter is inactive
inactive_param_name = error_str.split("'")[1]
param_idx = self._cs.get_idx_by_hyperparameter_name(
Expand Down

0 comments on commit 262c211

Please sign in to comment.