Skip to content

Commit

Permalink
adjusted the notification & exception
Browse files Browse the repository at this point in the history
  • Loading branch information
KrissiHub committed Dec 7, 2023
1 parent 0d5f324 commit 857c17b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
20 changes: 15 additions & 5 deletions deepcave/plugins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -803,11 +803,21 @@ def __call__(self, render_button: bool = False) -> List[Component]:
else:
components += [html.H1(self.name)]

try:
self.check_runs_compatibility(self.all_runs)
except NotMergeableError as message:
notification.update(str(message))
return components
#If the runs for cost over time are not compatible
#it should still be possible to look at them separatly
if self.id == "cost_over_time":
try:
self.check_runs_compatibility(self.all_runs)
except NotMergeableError as message:
notification.update("The runs you chose could not be combined. You can still choose to look at the Cost Over Time for one specific run though.")
self.activate_run_selection = True
return components
else:
try:
self.check_runs_compatibility(self.all_runs)
except NotMergeableError as message:
notification.update(str(message))
return components

if self.activate_run_selection:
run_input_layout = [self.__class__.get_run_input_layout(self.register_input)]
Expand Down
2 changes: 1 addition & 1 deletion deepcave/plugins/objective/cost_over_time.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class CostOverTime(DynamicPlugin):
id = "cost_over_time"
name = "Cost Over Time"
icon = "fas fa-chart-line"
activate_run_selection = True
activate_run_selection = False
help = "docs/plugins/cost_over_time.rst"

def check_runs_compatibility(self, runs: List[AbstractRun]) -> None:
Expand Down

0 comments on commit 857c17b

Please sign in to comment.