Skip to content

Commit 6ebedc5

Browse files
author
Sarah Krebs
committed
Merge development and solve conflicts
2 parents e92f45d + 5814360 commit 6ebedc5

26 files changed

+274
-95
lines changed

.flake8

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ extend-exclude =
77
build
88
extend-ignore =
99
# No whitespace before ':' in [x : y]
10-
E203
10+
E203,
1111
# No lambdas — too strict
12-
E731
12+
E731,

CHANGELOG.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
## Plugins
44
- Add symbolic explanations plugin (#46).
5+
- It is now possible to view multiple unequal runs at once in Cost over Time and Pareto (#93).
6+
- Runs with unequal objectives cannot be displayed together.
7+
- Added an enum for displaying according warning messages.
58

69
## Enhancements
710
- Fix lower bounds of dependency versions.
@@ -11,6 +14,7 @@
1114
- Add exit button which first deletes running jobs and then terminates DeepCave.
1215
- Nicer handling of Keyboard Interrupt.
1316
- Disable debug mode.
17+
- Save plotly plots in higher resolution upon download.
1418

1519
## Bug-Fixes
1620
- Fix missing objective specification in LPI evaluator (#71).
@@ -19,6 +23,12 @@
1923
- Reset inputs to fix error when subsequently selecting runs with different configspaces, objectives or budgets (#106).
2024
- Fix errors due to changing inputs before runselection (#64).
2125
- For fANOVA, remove constant hyperparameters from configspace (#9).
26+
- When getting budget, objectives etc from multiple runs in Cost over Time and Pareto Front:
27+
- Instead of taking the first run as comparative value,
28+
- take the one with the lowest budget, else the index for the budgets could be out of bounds.
29+
- For PCP, show hyperparameters with highest importance closest to the cost, i.e. right (#124).
30+
- Add init files to all test directories.
31+
- Correct LPI importance tests.
2232

2333
## Documentation
2434
- Add How to Contribute section.
@@ -39,6 +49,10 @@
3949
- Major overhaul of docstrings in various files
4050
- Removed unused imports and variables
4151

52+
## Groups
53+
- Groups now get a default name, if no name was entered by the user.
54+
- Groups get sorted alphabetically to appear more ordered.
55+
4256
## Additional Changes
4357
- Added a "make install examples" in Makefile
4458

@@ -68,7 +82,7 @@
6882
- SMAC 2.0
6983

7084
## Dependencies
71-
- Remove SMAC dependency by adding required function directly
85+
- Remove SMAC dependency by adding required function directly.
7286

7387
# Version 1.0.1
7488

deepcave/config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ class Config:
5656
SAVE_IMAGES = False # The figure will be saved to the cache directory.
5757
FIGURE_MARGIN = dict(t=30, b=0, l=0, r=0)
5858
FIGURE_HEIGHT = "40vh"
59+
FIGURE_DOWNLOAD_SCALE = 4.0
5960

6061
# Redis settings
6162
REDIS_PORT: int = 6379

deepcave/layouts/general.py

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ def get_layout(
337337

338338
# Load from cache if page is loaded
339339
children = []
340+
340341
for name, paths in groups.items():
341342
if name is None:
342343
continue
@@ -368,10 +369,29 @@ def callback(group_names: List[str], all_run_paths, i):
368369
self._refresh_groups = False
369370
raise PreventUpdate()
370371

372+
# For the default group names, if no name was entered
373+
group_counter = 0
374+
371375
groups = {}
372376
for group_name, run_paths in zip(group_names, all_run_paths):
373377
if group_name is None or group_name == "":
374-
continue
378+
# Set the default group name with a counter,
379+
# so the groups dont overwrite themselves
380+
group_name_unavailable = True
381+
382+
groups_cache = c.get("groups")
383+
if groups_cache is None:
384+
continue
385+
386+
# Check to see that no group name that already exists
387+
# gets picked
388+
while group_name_unavailable:
389+
group_name = f"Group {group_counter}"
390+
assert groups_cache is not None
391+
if group_name not in groups_cache.keys():
392+
group_name_unavailable = False
393+
else:
394+
group_counter += 1
375395

376396
if run_paths is None or len(run_paths) == 0:
377397
continue
@@ -386,16 +406,20 @@ def callback(group_names: List[str], all_run_paths, i):
386406

387407
groups[group_name] = valid_run_paths
388408

409+
# Sort the groups alphabetically, so when added
410+
# they appear ordered
411+
sorted_groups = dict(sorted(groups.items()))
412+
389413
try:
390414
# Now save it
391-
run_handler.update_groups(groups)
415+
run_handler.update_groups(sorted_groups)
392416
except NotMergeableError:
393417
notification.update("The selected runs are not mergeable.")
394418

395419
# This will automatically trigger the group display s.t. the selection is redo.
396420
return i + 1
397421

398-
self.logger.debug(f"Groups: {groups}")
422+
self.logger.debug(f"Groups: {sorted_groups}")
399423

400424
raise PreventUpdate()
401425

deepcave/plugins/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,6 @@ def __call__(self, render_button: bool = False) -> List[Component]:
917917
]
918918
else:
919919
components += [html.H1(self.name)]
920-
921920
try:
922921
self.check_runs_compatibility(self.all_runs)
923922
except NotMergeableError as message:

deepcave/plugins/budget/budget_correlation.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,11 @@ def get_output_layout(register: Callable) -> List[Any]:
219219
[
220220
dbc.Tab(
221221
dcc.Graph(
222-
id=register("graph", "figure"), style={"height": config.FIGURE_HEIGHT}
222+
id=register("graph", "figure"),
223+
style={"height": config.FIGURE_HEIGHT},
224+
config={
225+
"toImageButtonOptions": {"scale": config.FIGURE_DOWNLOAD_SCALE}
226+
},
223227
),
224228
label="Graph",
225229
),

deepcave/plugins/dynamic.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ def plugin_output_update(_: Any, *inputs_list: str) -> Any:
9595
runs = self.get_selected_runs(inputs)
9696

9797
raw_outputs = {}
98+
rc.clear()
9899
for run in runs:
99100
run_outputs = rc.get(run, self.id, inputs_key)
100101
if run_outputs is None:

deepcave/plugins/hyperparameter/importances.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,11 @@ def get_output_layout(register: Callable) -> dcc.Graph:
357357
dcc.Graph
358358
Layout for the output block.
359359
"""
360-
return dcc.Graph(register("graph", "figure"), style={"height": config.FIGURE_HEIGHT})
360+
return dcc.Graph(
361+
register("graph", "figure"),
362+
style={"height": config.FIGURE_HEIGHT},
363+
config={"toImageButtonOptions": {"scale": config.FIGURE_DOWNLOAD_SCALE}},
364+
)
361365

362366
@staticmethod
363367
def load_outputs(run, inputs, outputs) -> go.Figure: # type: ignore

deepcave/plugins/hyperparameter/pdp.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,11 @@ def get_output_layout(register: Callable) -> dcc.Graph:
366366
dcc.Graph
367367
Layout for the output block.
368368
"""
369-
return dcc.Graph(register("graph", "figure"), style={"height": config.FIGURE_HEIGHT})
369+
return dcc.Graph(
370+
register("graph", "figure"),
371+
style={"height": config.FIGURE_HEIGHT},
372+
config={"toImageButtonOptions": {"scale": config.FIGURE_DOWNLOAD_SCALE}},
373+
)
370374

371375
@staticmethod
372376
def get_pdp_figure( # type: ignore

deepcave/plugins/hyperparameter/symbolic_explanations.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -491,8 +491,16 @@ def get_output_layout(register: Callable) -> List[dcc.Graph]:
491491
Layout for the output block.
492492
"""
493493
return [
494-
dcc.Graph(register("symb_graph", "figure"), style={"height": config.FIGURE_HEIGHT}),
495-
dcc.Graph(register("pdp_graph", "figure"), style={"height": config.FIGURE_HEIGHT}),
494+
dcc.Graph(
495+
register("symb_graph", "figure"),
496+
style={"height": config.FIGURE_HEIGHT},
497+
config={"toImageButtonOptions": {"scale": config.FIGURE_DOWNLOAD_SCALE}},
498+
),
499+
dcc.Graph(
500+
register("pdp_graph", "figure"),
501+
style={"height": config.FIGURE_HEIGHT},
502+
config={"toImageButtonOptions": {"scale": config.FIGURE_DOWNLOAD_SCALE}},
503+
),
496504
]
497505

498506
@staticmethod

0 commit comments

Comments
 (0)