Skip to content

Commit

Permalink
Merge pull request #104 from automl/bug/pre-runselection-errors
Browse files Browse the repository at this point in the history
Bugfix/Fix errors due to changing inputs before runselection
  • Loading branch information
sarah-segel authored Jan 17, 2024
2 parents 9b3df78 + 379233a commit da3075d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- Don't convert BOHB runs with status 'running' (consistent with SMAC).
- Fix api examples (#68).
- Reset inputs to fix error when subsequently selecting runs with different configspaces, objectives or budgets (#106).
- Fix errors due to changing inputs before runselection (#64).

# Version 1.1.3

Expand Down
18 changes: 10 additions & 8 deletions deepcave/plugins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,16 +370,18 @@ def plugin_input_update(pathname: str, *inputs_list: str) -> List[str]:
if "hyperparameter_name_2" in _inputs.keys():
update_dict(_inputs, {"hyperparameter_name_2": {"value": None}})

selected_run = run_handler.get_run(_run_id)
if _run_id:
selected_run = run_handler.get_run(_run_id)

# How to update only parameters which have a dependency?
user_dependencies_inputs = self.load_dependency_inputs(
selected_run, _previous_inputs, _inputs
)
if selected_run is not None:
# How to update only parameters which have a dependency?
user_dependencies_inputs = self.load_dependency_inputs(
selected_run, _previous_inputs, _inputs
)

# Update dict
# dict.update() remove keys, so we use our own method to do so
update_dict(inputs, user_dependencies_inputs) # inplace operation
# Update dict
# dict.update() remove keys, so we use our own method to do so
update_dict(inputs, user_dependencies_inputs) # inplace operation

# Let's cast the inputs
inputs = self._cast_inputs(inputs)
Expand Down
1 change: 0 additions & 1 deletion deepcave/plugins/hyperparameter/importances.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ def load_dependency_inputs(self, run, _, inputs):
# Pre-set values
if objective_value is None:
objective_value = objective_ids[0]
n_hps = len(hp_names)

if n_hps == 0:
n_hps = len(hp_names)
Expand Down
1 change: 0 additions & 1 deletion deepcave/plugins/objective/parallel_coordinates.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ def load_dependency_inputs(self, run, _, inputs):
objective_value = objective_ids[0]
budget_value = budget_ids[-1]
hp_value = hp_names
n_hps = len(hp_names)

if n_hps == 0:
n_hps = len(hp_names)
Expand Down

0 comments on commit da3075d

Please sign in to comment.