Skip to content

Commit 5dfc980

Browse files
author
Sarah Krebs
committed
Solve merge conflict
2 parents 7172849 + a835f52 commit 5dfc980

File tree

107 files changed

+18691
-1145
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+18691
-1145
lines changed

.flake8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ extend-ignore =
99
# No whitespace before ':' in [x : y]
1010
E203,
1111
# No lambdas — too strict
12-
E731,
12+
E731,

.pre-commit-config.yaml

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ repos:
1414
files: tests
1515

1616
- repo: https://github.com/ambv/black
17-
rev: 23.1.0
17+
rev: 23.3.0
1818
hooks:
1919
- id: black
2020
name: black formatter deepcave
@@ -33,14 +33,38 @@ repos:
3333
hooks:
3434
- id: pydocstyle
3535
files: deepcave
36-
additional_dependencies: ["toml"] # Needed to parse pyproject.toml
36+
additional_dependencies: ["tomli"] # Needed to parse pyproject.toml
3737

3838
- repo: https://github.com/pre-commit/mirrors-mypy
39-
rev: v0.930
39+
rev: v1.5.1
4040
hooks:
4141
- id: mypy
4242
name: mypy deepcave
4343
files: deepcave
44+
args: [--install-types, --non-interactive]
45+
additional_dependencies: [
46+
'wheel>=0.41.2',
47+
'setuptools==68.2.2',
48+
'absl-py>=1.0.0',
49+
'jsonlines>=3.0.0',
50+
'pandas>=1.3.4',
51+
'numpy>=1.22.2',
52+
'matplotlib>=3.5.1',
53+
'pyyaml>=6.0.1',
54+
'kaleido>=0.2.1',
55+
'gplearn>=0.4.2',
56+
'sympy>=1.12',
57+
'ConfigSpace==0.6.1',
58+
'pyrfr>=0.9.0',
59+
'hpbandster==0.7.4',
60+
'dash==2.0.0',
61+
'dash-extensions==0.0.71',
62+
'dash-bootstrap-components==1.0.3',
63+
'redis>=4.1.4',
64+
'rq>=1.10.1',
65+
'werkzeug==2.0.3',
66+
'pyPDPPartitioner>=0.1.8'
67+
] # Needed for mypy, so that it knows the types to check
4468

4569
- repo: https://github.com/PyCQA/flake8
4670
rev: 6.0.0

CHANGELOG.md

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,48 @@
1-
# Version 1.1.4
1+
# Version 1.2
22

3-
## General
4-
- It is now possible to view multiple unequal runs at once.
3+
## Plugins
4+
- Add symbolic explanations plugin (#46).
5+
- It is now possible to view multiple unequal runs at once in Cost over Time and Pareto (#93).
56
- Added an enum for displaying according warning messages.
6-
- Updated the Cost over Time documentation accordingly.
7+
8+
## Enhancements
9+
- Fix lower bounds of dependency versions.
10+
- Allow to load multi-objective SMAC3v2 and add example (#69)
11+
- Do not disable existing loggers.
12+
- Update author email.
13+
- Add exit button which first deletes running jobs and then terminates DeepCave.
14+
- Nicer handling of Keyboard Interrupt.
15+
- Disable debug mode.
716

817
## Bug-Fixes
18+
- Fix missing objective specification in LPI evaluator (#71).
19+
- Don't convert BOHB runs with status 'running' (consistent with SMAC).
20+
- Fix api examples (#68).
21+
- Reset inputs to fix error when subsequently selecting runs with different configspaces, objectives or budgets (#106).
22+
- Fix errors due to changing inputs before runselection (#64).
23+
- For fANOVA, remove constant hyperparameters from configspace (#9).
924
- When getting budget, objectives etc from multiple runs in Cost over Time and Pareto Front:
1025
- Instead of taking the first run as comparative value,
1126
- take the one with the lowest budget, else the index for the budgets could be out of bounds.
1227

28+
## Version-Updates
29+
- Black version from 23.1.0 to 23.3.0
30+
- Mypy from 0.930 to 1.5.1
31+
32+
## Mypy
33+
- Updated args so there are no missing imports
34+
- Updated additional dependencies, so mypy can check all types
35+
- Note: If the installs in requirements change, it has to be adapted in additional dependencies
36+
- Added many type annotations
37+
- In some cases internal refactoring for variables, due to typing
38+
39+
## Pydocstyle and Linter
40+
- Major overhaul of docstrings in various files
41+
- Removed unused imports and variables
42+
43+
## Additional Changes
44+
- Added a "make install examples" in Makefile
45+
1346
# Version 1.1.3
1447

1548
## Bug-Fixes

Makefile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# are usually completed in github actions.
33

44
SHELL := /bin/bash
5-
VERSION := 1.1.3
5+
VERSION := 1.2
66

77
NAME := DeepCAVE
88
PACKAGE_NAME := deepcave
@@ -42,13 +42,16 @@ MYPY ?= mypy
4242
PRECOMMIT ?= pre-commit
4343
FLAKE8 ?= flake8
4444

45-
install:
45+
install:
4646
$(PIP) install -e .
4747

4848
install-dev:
4949
$(PIP) install -e ".[dev]"
5050
pre-commit install
51-
51+
52+
install-examples:
53+
$(PIP) install -e ".[examples]"
54+
5255
check-black:
5356
$(BLACK) ${SOURCE_DIR} --check || :
5457
$(BLACK) ${EXAMPLES_DIR} --check || :
@@ -62,7 +65,7 @@ check-pydocstyle:
6265
$(PYDOCSTYLE) ${SOURCE_DIR} || :
6366

6467
check-mypy:
65-
$(MYPY) ${SOURCE_DIR} || :
68+
$(MYPY) --check-untyped-defs --install-types --non-interactive --ignore-missing-imports ${SOURCE_DIR} || :
6669

6770
check-flake8:
6871
$(FLAKE8) ${SOURCE_DIR} || :
@@ -115,7 +118,7 @@ build:
115118
# This is done to prevent accidental publishing but provide the same conveniences
116119
publish: clean build
117120
read -p "Did you update the version number in Makefile and deepcave/__init__.py?"
118-
121+
119122
$(PIP) install twine
120123
$(PYTHON) -m twine upload --repository testpypi ${DIST}/*
121124
@echo

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ conda install -c anaconda swig
4747
make install-dev
4848
```
4949

50+
If you want to use the given examples, run this after installing:
51+
```bash
52+
make install-examples
53+
```
54+
5055
Please visit the [documentation](https://automl.github.io/DeepCAVE/main/installation.html) to get
5156
further help (e.g. if you can not install redis server or you are on a mac).
5257

deepcave/__init__.py

Lines changed: 56 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
# noqa: D400
2+
"""
3+
# DeepCAVE
4+
5+
This module is used to initialize and set up the configuration for the DeepCAVE framework.
6+
7+
The Dash application gets created.
8+
"""
9+
110
from typing import Any, Callable, TypeVar, cast
211

312
import datetime
@@ -9,23 +18,36 @@
918
name = "DeepCAVE"
1019
package_name = "deepcave"
1120
author = "R. Sass and E. Bergman and A. Biedenkapp and F. Hutter and M. Lindauer"
12-
author_email = "sass@tnt.uni-hannover.de"
21+
author_email = "s.segel@ai.uni-hannover.de"
1322
description = "An interactive framework to visualize and analyze your AutoML process in real-time."
1423
url = "automl.org"
1524
project_urls = {
1625
"Documentation": "https://automl.github.io/DeepCAVE/main",
1726
"Source Code": "https://github.com/automl/deepcave",
1827
}
1928
copyright = f"Copyright {datetime.date.today().strftime('%Y')}, {author}"
20-
version = "1.1.3"
29+
version = "1.2"
2130

2231
_exec_file = sys.argv[0]
2332
_exec_files = ["server.py", "worker.py", "sphinx-build"]
2433

2534
ROOT_DIR = Path(__file__).parent
2635

2736

28-
def get_app(title: str):
37+
def get_app(title: str) -> Any:
38+
"""
39+
Get the Dash Proxy.
40+
41+
Parameters
42+
----------
43+
title : str
44+
The title of the application.
45+
46+
Returns
47+
-------
48+
DashProxy
49+
The dash proxy.
50+
"""
2951
import dash_bootstrap_components as dbc
3052
from dash_extensions.enrich import (
3153
DashProxy,
@@ -61,8 +83,8 @@ def get_app(title: str):
6183
if any(file in _exec_file for file in _exec_files):
6284
from deepcave.custom_queue import Queue
6385
from deepcave.runs.handler import RunHandler
64-
from deepcave.runs.objective import Objective # noqa
65-
from deepcave.runs.recorder import Recorder # noqa
86+
from deepcave.runs.objective import Objective
87+
from deepcave.runs.recorder import Recorder
6688
from deepcave.utils.cache import Cache
6789
from deepcave.utils.configs import parse_config
6890
from deepcave.utils.notification import Notification
@@ -129,8 +151,37 @@ def get_app(title: str):
129151

130152

131153
def interactive(func: F) -> F:
154+
"""
155+
Define the interactive decorator.
156+
157+
Parameters
158+
----------
159+
func : F
160+
The function to be decorated.
161+
162+
Returns
163+
-------
164+
F
165+
The decorated function.
166+
"""
167+
132168
@wraps(func)
133169
def inner(*args: Any, **kwargs: Any) -> Any:
170+
"""
171+
Inner function of the decorator.
172+
173+
Parameters
174+
----------
175+
*args : Any
176+
Arguments to be passed to the wrap function.
177+
**kwargs : Any
178+
Keyword arguments to be passed to the wrap function.
179+
180+
Returns
181+
-------
182+
Any
183+
The result of the function.
184+
"""
134185
if _api_mode:
135186
return
136187

deepcave/cli.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
1-
from typing import Any, List
1+
# noqa: D400
2+
"""
3+
# CLI
4+
5+
This module defines command-line options using flags.
6+
7+
This includes the entry point for the programs execution.
8+
"""
9+
10+
from typing import Any
211

312
import multiprocessing
413
import subprocess
@@ -23,7 +32,8 @@
2332
)
2433

2534

26-
def execute(_) -> None:
35+
def execute(_: Any) -> None:
36+
"""Entry point for the programs execution."""
2737
if (config_key := FLAGS.get_config_value) is not None:
2838
config = FLAGS.config
2939
if config is not None:
@@ -49,4 +59,8 @@ def execute(_) -> None:
4959

5060

5161
def main() -> None:
52-
app.run(execute)
62+
"""Call the execute function."""
63+
try:
64+
app.run(execute)
65+
except KeyboardInterrupt:
66+
exit("KeyboardInterrupt.")

0 commit comments

Comments
 (0)