Skip to content

Commit 5c41d26

Browse files
authored
Merge pull request #146 from automl/development
Version 0.3.0
2 parents d99b21e + 7e955f5 commit 5c41d26

File tree

273 files changed

+15586
-17381
lines changed

Some content is hidden

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

273 files changed

+15586
-17381
lines changed

.flake8

Lines changed: 0 additions & 11 deletions
This file was deleted.

.github/workflows/docs.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@ on:
1010
push:
1111
branches:
1212
- main
13+
- development
1314

1415
# Trigger on a open/push to a PR targeting one of these branches
1516
pull_request:
1617
branches:
1718
- main
19+
- development
1820

1921
env:
2022
name: DACBench
@@ -42,13 +44,13 @@ jobs:
4244
make doc
4345
4446
- name: Pull latest gh-pages
45-
if: contains(github.ref, 'main') && github.event_name == 'push'
47+
if: github.event_name == 'push'
4648
run: |
4749
cd ..
4850
git clone https://github.com/${{ github.repository }}.git --branch gh-pages --single-branch gh-pages
4951
5052
- name: Copy new docs into gh-pages
51-
if: contains(github.ref, 'main') && github.event_name == 'push'
53+
if: github.event_name == 'push'
5254
run: |
5355
branch_name=${GITHUB_REF##*/}
5456
cd ../gh-pages
@@ -57,7 +59,7 @@ jobs:
5759
5860
5961
- name: Push to gh-pages
60-
if: contains(github.ref, 'main') && github.event_name == 'push'
62+
if: github.event_name == 'push'
6163
run: |
6264
last_commit=$(git log --pretty=format:"%an: %s")
6365
cd ../gh-pages

.github/workflows/main.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

.github/workflows/pre_commit.yml

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,29 @@ on:
66

77
# When a push occurs on either of these branches
88
push:
9-
branches-ignore:
10-
- '**'
11-
# branches:
12-
# - main
13-
# - development
9+
branches:
10+
- main
11+
- development
1412

1513
# When a push occurs on a PR that targets these branches
1614
pull_request:
17-
branches-ignore:
18-
- '**'
19-
# branches:
20-
# - main
21-
# - development
15+
branches:
16+
- main
17+
- development
2218

2319
jobs:
2420
run-all-files:
2521
runs-on: ubuntu-latest
2622

2723
steps:
28-
- uses: actions/checkout@v2
24+
- uses: actions/checkout@v3
2925
with:
3026
submodules: recursive
3127

3228
- name: Setup Python 3.10
33-
uses: actions/setup-python@v2
29+
uses: actions/setup-python@v4
3430
with:
35-
python-version: 3.10
31+
python-version: "3.10"
3632

3733
- name: Install pre-commit
3834
run: |

.github/workflows/pytest.yml

Lines changed: 18 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,35 @@
11
name: tests
22
on:
3+
workflow_dispatch:
34
push:
45
branches:
56
- main
7+
- development
68
pull_request:
79
branches:
810
- main
911

1012
jobs:
1113
build:
12-
runs-on: ubuntu-18.04
14+
runs-on: "ubuntu-latest"
1315
steps:
14-
- uses: actions/checkout@v2
15-
with:
16-
submodules: recursive
17-
- name: Cache MNIST
18-
id: cache-mnist
19-
uses: actions/cache@v2
20-
with:
21-
path: ./data/MNIST
22-
key: mnist
23-
- name: Cache Fast-downward build
24-
id: cache-fast-downward-build
25-
uses: actions/cache@v2
26-
with:
27-
path: ./dacbench/envs/rl-plan/fast-downward
28-
key: fast-downward-build
29-
- name: Install Python 3
16+
- uses: actions/checkout@v3
17+
- name: Set up Python
3018
uses: actions/setup-python@v4
3119
with:
3220
python-version: '3.10'
33-
- name: Install dependencies
21+
- name: Install uv
3422
run: |
35-
python -m pip install --upgrade pip
36-
pip install -e.[dev,all]
37-
- name: Build fast-downward
38-
run: ./dacbench/envs/rl-plan/fast-downward/build.py
39-
- name: Run tests with pytest
40-
run: coverage run -m pytest --html=test-report.html
41-
- name: Run coverage
23+
python -m pip install uv
24+
uv venv
25+
- name: Activate virtualenv
4226
run: |
43-
coverage report
44-
coverage html
45-
- name: Archive code coverage results
46-
uses: actions/upload-artifact@v2
47-
if: ${{ always() }}
48-
with:
49-
name: code-coverage-report
50-
path: coverage_report
51-
- name: Archive test report
52-
uses: actions/upload-artifact@v2
53-
if: ${{ always() }}
54-
with:
55-
name: test-report
56-
path: |
57-
test-report.html
58-
assets
27+
. .venv/bin/activate
28+
which python
29+
echo PATH=$PATH >> $GITHUB_ENV
30+
- name: Install dependencies
31+
run: |
32+
git submodule update --init --recursive
33+
uv pip install -e ".[dev, docs, all, example]"
34+
- name: Run tests with pytest
35+
run: /home/runner/work/DACBench/DACBench/.venv/bin/python -m pytest tests

.gitignore

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,15 @@ port_*.txt
1616
tests/data/
1717
test/*.json
1818

19-
# pycharm specific stuff
19+
# pycharm/vscode specific stuff
2020
.idea
21+
.vscode/
22+
23+
#datasets for sgd
24+
*MNIST/raw*
25+
*raw*
26+
*cifar-10-batches-py*
27+
*cifar*.tar.gz
28+
29+
# venvs
30+
*.lock*

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
[submodule "dacbench/envs/rl-plan"]
22
path = dacbench/envs/rl-plan
33
url = https://github.com/speckdavid/rl-plan.git
4-
[submodule "docs/_themes/sphinx_rtd_theme"]
5-
path = docs/_themes/sphinx_rtd_theme
6-
url = https://github.com/readthedocs/sphinx_rtd_theme.git

.pre-commit-config.yaml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
repos:
2-
- repo: https://github.com/ambv/black
3-
rev: stable
4-
hooks:
5-
- id: black
6-
language_version: python3.10
7-
exclude: dacbench/envs/fast-downward
8-
- repo: https://gitlab.com/pycqa/flake8
9-
rev: 3.8.4
10-
hooks:
11-
- id: flake8
2+
- repo: https://github.com/astral-sh/ruff-pre-commit
3+
# Ruff version.
4+
rev: v0.2.2
5+
hooks:
6+
# Run the linter.
7+
- id: ruff
8+
args: [ --fix ]
9+
# Run the formatter.
10+
- id: ruff-format

CHANGELOG.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,40 @@
1+
# 0.3.0
2+
3+
### Instance Specification
4+
Instances for most benchmarks now have a dataclass Type instead of being a simple list. Additionally, the corresponding datasets are saved as proper csv files with headers now. This should make anything relating to instances much more convenient for the user. The benchmarks in question are:
5+
- CMA-ES
6+
- SGD
7+
- Luby
8+
- ToySGD
9+
- Function Approximation
10+
11+
### Unifying CMA-ES Versions
12+
Instead of having two different versions of CMA-ES, we now have a single environment which covers both step size adaption and algorithm variant selection of CMA-ES (formerly ModCMA). By changing the configuration space, the user can select which hyperparameters to adapt. This change includes a switch to the newer "ioh" package, meaning an increased amount of target functions could be interfaced in principle. Anything outside of BBOB will need to be loaded separately from the "read_instance_set" function of the benchmark, however.
13+
14+
### Unifying Function Approximation Tasks
15+
To reduce the number of separate classes to maintain for simple function approximation, the Sigmoid variations and the Geometric environment have been fused into the FunctionApproximation Benchmark. There are several options for functions to approximate, as in Sigmoid it is possible to use a discrete space and you can add importance weights for the dimensions. The "get_benchmark" method will still provide the original Sigmoid configurations. Apart from that, this new environment should provide all functionality of the previous environments, just with a simpler path to getting there.
16+
17+
### Re-implementing SGD Benchmark
18+
The original SGD benchmark was complex and error prone, lacking important features like compatibility with torchhub. Therefore this has been re-implemented, mostly based on the existing competition version. The code is simpler now and compatible with a larger selection of models and optimizers.
19+
20+
### Deprecating FastDownward
21+
The FastDownward version compatible with the benchmark cannot be used with any Ubuntu version after 16.x - which is fairly old by now. For reference, it is not possible to even build a container for this version of FastDownward on th GitHub servers. Since there is no option to update the planner version without updating the environment and this is tied to significant domain knowledge, FastDownward will now be deprecated. This means there is no testing, the benchmark will not be updated and it will not be listed as an official benchmark any longer. If someone is familiar enough with FastDownward to facilitate an update, please notify us, we'd love to continue this benchmark!
22+
23+
### Updating Instance Sets
24+
Most instance sets have been updated due to the instance specification change. The Sigmoid ones have been preserved, the rest has been updated. Sampling options for all benchmarks are included in the "instance_set" directory, however.
25+
26+
### Logger Update
27+
The logs have been a bit hard to read & work with. We flattened them by removing timestamps, hopefully making them easier to work with.
28+
29+
### Dependency Upgrades
30+
The dependencies have been upgraded to their current highest possible version.
31+
32+
### Simplify Examples
33+
Some examples had a lot of extra dependencies. We removed many of these for now - this means less explicit RL examples, but if you want to use an RL library, DACBench will plug in like any other env, so you should read their documentation anyway.
34+
35+
### Including Instance Files in PyPI
36+
There was a persistent configuration mistake which prevented the instance sets to be included in the PyPI installation - this should now be fixed and all instances sets from the repository come with the PyPI package.
37+
138
# 0.2.0
239

340
### Interface Update

0 commit comments

Comments
 (0)