Skip to content

Commit 2434f2b

Browse files
committed
merged upstream changes
2 parents e436a95 + 8c380e6 commit 2434f2b

File tree

108 files changed

+18767
-1179
lines changed

Some content is hidden

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

108 files changed

+18767
-1179
lines changed

.flake8

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

.github/workflows/docs.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: docs
22

3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
5+
cancel-in-progress: true
6+
37
on:
48
# Trigger manually
59
workflow_dispatch:
@@ -22,19 +26,22 @@ env:
2226
jobs:
2327
build-and-deploy:
2428
runs-on: ubuntu-latest
29+
defaults:
30+
run:
31+
shell: bash # Default to using bash on all
2532
steps:
2633
- name: Checkout
27-
uses: actions/checkout@v2
34+
uses: actions/checkout@v4
2835

2936
- name: Setup Python
30-
uses: actions/setup-python@v2
37+
uses: actions/setup-python@v5
3138
with:
3239
python-version: 3.9
3340

3441
- name: Install dependencies
3542
run: |
3643
pip install .
37-
pip install .[dev]
44+
pip install ".[dev]"
3845
3946
- name: Make docs
4047
run: |

.github/workflows/pytest.yml

Lines changed: 40 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,50 @@
11
name: tests
2-
on: [ push ]
2+
3+
# Cancel previous tests for this branch if a new commit is pushed
4+
concurrency:
5+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
6+
cancel-in-progress: true
7+
8+
on:
9+
# Allow manual trigger of workflow
10+
workflow_dispatch:
11+
12+
# Run tests on push/merge to main
13+
push:
14+
branches:
15+
- main
16+
17+
# Run tests on anything that has a pull request to main/development
18+
pull_request:
19+
branches:
20+
- main
21+
- development
22+
323
jobs:
424
pytest:
5-
name: PyTest
6-
runs-on: ubuntu-latest
7-
steps:
8-
- uses: actions/checkout@v2
9-
- name: Add conda to system path
10-
run: |
11-
# $CONDA is an environment variable pointing to the root of the miniconda directory
12-
echo $CONDA/bin >> $GITHUB_PATH
25+
name: Test ${{ matrix.python-version }}-${{ matrix.os }}
26+
runs-on: ${{ matrix.os }}
27+
defaults:
28+
run:
29+
shell: bash # Default to using bash on all
30+
31+
strategy:
32+
fail-fast: false
33+
matrix:
34+
python-version: ["3.9", "3.10"] # "3.11" fails due to swig
35+
os: ["ubuntu-latest"] # "macos-latest", "windows-latest" fails due to swig
1336

37+
steps:
38+
- uses: actions/checkout@v4
1439
- name: Setup Python 3.9
15-
uses: actions/setup-python@v2
40+
uses: actions/setup-python@v5
1641
with:
17-
python-version: 3.9
42+
python-version: ${{ matrix.python-version }}
1843

1944
- name: Install dependencies
2045
run: |
21-
conda install -c anaconda swig
22-
make install-dev
23-
24-
- name: Run pytest
46+
pip install swig
47+
python -m pip install ".[dev]"
48+
49+
- name: Run pytest
2550
run: pytest tests

.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: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,47 @@
1-
# Version 1.1.4
1+
# Version 1.2
2+
3+
## Plugins
4+
- Add symbolic explanations plugin (#46).
5+
6+
## Enhancements
7+
- Fix lower bounds of dependency versions.
8+
- Allow to load multi-objective SMAC3v2 and add example (#69)
9+
- Do not disable existing loggers.
10+
- Update author email.
11+
- Add exit button which first deletes running jobs and then terminates DeepCave.
12+
- Nicer handling of Keyboard Interrupt.
13+
- Disable debug mode.
14+
15+
## Bug-Fixes
16+
- Fix missing objective specification in LPI evaluator (#71).
17+
- Don't convert BOHB runs with status 'running' (consistent with SMAC).
18+
- Fix api examples (#68).
19+
- Reset inputs to fix error when subsequently selecting runs with different configspaces, objectives or budgets (#106).
20+
- Fix errors due to changing inputs before runselection (#64).
21+
- For fANOVA, remove constant hyperparameters from configspace (#9).
22+
23+
## Version-Updates
24+
- Black version from 23.1.0 to 23.3.0
25+
- Mypy from 0.930 to 1.5.1
26+
27+
## Mypy
28+
- Updated args so there are no missing imports
29+
- Updated additional dependencies, so mypy can check all types
30+
- Note: If the installs in requirements change, it has to be adapted in additional dependencies
31+
- Added many type annotations
32+
- In some cases internal refactoring for variables, due to typing
33+
34+
## Pydocstyle and Linter
35+
- Major overhaul of docstrings in various files
36+
- Removed unused imports and variables
237

338
## Groups
439
- Groups now get a default name, if no name was entered by the user.
540
- Groups get sorted alphabetically to appear more ordered.
641

42+
## Additional Changes
43+
- Added a "make install examples" in Makefile
44+
745
# Version 1.1.3
846

947
## 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

0 commit comments

Comments
 (0)