Skip to content

Commit 9c0fabe

Browse files
committed
CoT and PF correctly show warnings
1 parent 735843f commit 9c0fabe

File tree

3 files changed

+18
-12
lines changed

3 files changed

+18
-12
lines changed

deepcave/plugins/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,7 @@ def __call__(self, render_button: bool = False) -> List[Component]:
750750
Layout as list of components.
751751
"""
752752
from deepcave import c, notification
753-
753+
print(self.__class__)
754754
# Reset runtime variables
755755
self.previous_inputs = {}
756756
self.raw_outputs = None

deepcave/plugins/objective/cost_over_time.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class CostOverTime(DynamicPlugin):
2525
help = "docs/plugins/cost_over_time.rst"
2626

2727
def check_runs_compatibility(self, runs: List[AbstractRun]) -> None:
28-
print("HALLO")
28+
print("check_runs_compatibility in CoT has been called.")
2929
try:
3030
check_equality(runs, objectives=True, budgets=True)
3131
except NotMergeableError as e:
@@ -42,6 +42,8 @@ def check_runs_compatibility(self, runs: List[AbstractRun]) -> None:
4242
notification.update("The objectives of the runs are not equal.", color="warning")
4343

4444
# Set some attributes here
45+
# It is necessary to get the run with the smallest budget as
46+
# first comparative value, else there is gonna be an index problem
4547
objective_options = []
4648
budget_options = []
4749
for run in runs:
@@ -54,8 +56,6 @@ def check_runs_compatibility(self, runs: List[AbstractRun]) -> None:
5456
budget_options.append(get_select_options(budgets, budget_ids))
5557
self.objective_options = min(objective_options, key=len)
5658
self.budget_options = min(budget_options, key=len)
57-
print(self.budget_options)
58-
print(self.objective_options)
5959

6060

6161
@staticmethod

deepcave/plugins/objective/pareto_front.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,21 @@ def check_runs_compatibility(self, runs):
4141
notification.update("The objectives of the runs are not equal.", color="warning")
4242

4343
# Set some attributes here
44-
run = runs[0]
44+
# It is necessary to get the run with the smallest budget as
45+
# first comparative value, else there is gonna be an index problem
46+
objective_options = []
47+
budget_options = []
48+
for run in runs:
49+
objective_names = run.get_objective_names()
50+
objective_ids = run.get_objective_ids()
51+
objective_options.append(get_select_options(objective_names, objective_ids))
52+
53+
budgets = run.get_budgets(human=True)
54+
budget_ids = run.get_budget_ids()
55+
budget_options.append(get_select_options(budgets, budget_ids))
56+
self.objective_options = min(objective_options, key=len)
57+
self.budget_options = min(budget_options, key=len)
4558

46-
objective_names = run.get_objective_names()
47-
objective_ids = run.get_objective_ids()
48-
self.objective_options = get_select_options(objective_names, objective_ids)
49-
50-
budgets = run.get_budgets(human=True)
51-
budget_ids = run.get_budget_ids()
52-
self.budget_options = get_select_options(budgets, budget_ids)
5359

5460
@staticmethod
5561
def get_input_layout(register):

0 commit comments

Comments
 (0)