Skip to content

Commit 5889a04

Browse files
PhMuellerdwoiwode
andauthored
HPOBench with python >= 3.10 (#162)
Make installable for Python 3.10.6 * Add 3.10 to test pipeline * Remove upper Python version limit * Change python-versions to strings * Surround action python-version with quotation marks * Install paramnet dependencies only for Python <= 3.9 * Disable local paramnet test for Python > 3.9 Co-authored-by: Dominik Woiwode <[email protected]>
1 parent 4c4f1d9 commit 5889a04

File tree

6 files changed

+51
-20
lines changed

6 files changed

+51
-20
lines changed

.github/workflows/run_tests.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,36 +11,42 @@ jobs:
1111
strategy:
1212
matrix:
1313
include:
14-
- python-version: 3.7
14+
- python-version: "3.7"
1515
DISPLAY_NAME: "Singularity Tests + CODECOV"
1616
RUN_TESTS: true
1717
USE_SINGULARITY: true
1818
SINGULARITY_VERSION: "3.8"
1919
RUN_CODECOV: true
2020

21-
- python-version: 3.7
21+
- python-version: "3.7"
2222
DISPLAY_NAME: "Codestyle"
2323
RUN_CODESTYLE: true
2424
USE_SINGULARITY: false
2525

26-
- python-version: 3.7
26+
- python-version: "3.7"
2727
DISPLAY_NAME: "Singularity Container Examples"
2828
RUN_CONTAINER_EXAMPLES: true
2929
USE_SINGULARITY: true
3030
SINGULARITY_VERSION: "3.8"
3131

32-
- python-version: 3.7
32+
- python-version: "3.7"
3333
DISPLAY_NAME: "Local Examples"
3434
RUN_LOCAL_EXAMPLES: true
3535
USE_SINGULARITY: false
3636

37-
- python-version: 3.8
37+
- python-version: "3.8"
3838
DISPLAY_NAME: "Singularity Tests"
3939
RUN_TESTS: true
4040
USE_SINGULARITY: true
4141
SINGULARITY_VERSION: "3.8"
4242

43-
- python-version: 3.9
43+
- python-version: "3.9"
44+
DISPLAY_NAME: "Singularity Tests"
45+
RUN_TESTS: true
46+
USE_SINGULARITY: true
47+
SINGULARITY_VERSION: "3.8"
48+
49+
- python-version: "3.10"
4450
DISPLAY_NAME: "Singularity Tests"
4551
RUN_TESTS: true
4652
USE_SINGULARITY: true
@@ -63,7 +69,7 @@ jobs:
6369
- name: Set up Python ${{ matrix.python-version }}
6470
uses: actions/setup-python@v2
6571
with:
66-
python-version: ${{ matrix.python-version }}
72+
python-version: "${{ matrix.python-version }}"
6773
- name: Set up Go for Singularity
6874
if: matrix.USE_SINGULARITY == true
6975
uses: actions/setup-go@v2
@@ -78,4 +84,4 @@ jobs:
7884
python -m pip install --upgrade pip
7985
chmod +x ci_scripts/install.sh && source ./ci_scripts/install.sh
8086
- name: Run Tests
81-
run: chmod +x ci_scripts/script.sh && source ./ci_scripts/script.sh
87+
run: chmod +x ci_scripts/script.sh && source ./ci_scripts/script.sh

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,3 +149,19 @@ See whether in `~/.singularity/instances/sing/$HOSTNAME/*/` there is a file that
149149

150150
**Note:** If you are looking for a different or older version of our benchmarking library, you might be looking for
151151
[HPOlib1.5](https://github.com/automl/HPOlib1.5)
152+
153+
## Reference
154+
155+
If you use HPOBench, please cite the following paper:
156+
157+
```bibtex
158+
@inproceedings{
159+
eggensperger2021hpobench,
160+
title={{HPOB}ench: A Collection of Reproducible Multi-Fidelity Benchmark Problems for {HPO}},
161+
author={Katharina Eggensperger and Philipp M{\"u}ller and Neeratyoy Mallik and Matthias Feurer and Rene Sass and Aaron Klein and Noor Awad and Marius Lindauer and Frank Hutter},
162+
booktitle={Thirty-fifth Conference on Neural Information Processing Systems Datasets and Benchmarks Track (Round 2)},
163+
year={2021},
164+
url={https://openreview.net/forum?id=1k4rJYEwda-}
165+
}
166+
```
167+

ci_scripts/install.sh

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,21 @@ install_packages=""
44

55
if [[ "$RUN_TESTS" == "true" ]]; then
66
echo "Install tools for testing"
7-
install_packages="${install_packages}xgboost,pytest,test_paramnet,test_tabular_datamanager,"
7+
install_packages="${install_packages}xgboost,pytest,test_tabular_datamanager,"
88
pip install codecov
99

10-
# The param net benchmark does not work with a scikit-learn version != 0.23.2. (See notes in the benchmark)
11-
# To make sure that no newer version is installed, we install it before the other requirements.
12-
# Since we are not using a "--upgrade" option later on, pip skips to install another scikit-learn version.
13-
echo "Install the right scikit-learn function for the param net tests."
14-
pip install --upgrade scikit-learn==0.23.2
10+
PYVERSION=$(python -V 2>&1 | sed 's/.* \([0-9]\).\([0-9]*\).*/\1\2/')
11+
if [[ "${PYVERSION}" != "310" ]]; then
12+
# The param net benchmark does not work with a scikit-learn version != 0.23.2. (See notes in the benchmark)
13+
# To make sure that no newer version is installed, we install it before the other requirements.
14+
# Since we are not using a "--upgrade" option later on, pip skips to install another scikit-learn version.
15+
echo "Install the right scikit-learn function for the param net tests."
16+
pip install --upgrade scikit-learn==0.23.2
17+
install_packages="${install_packages}test_paramnet,"
18+
else
19+
echo "Skip installing the extra paramnet tests."
20+
fi
21+
1522
else
1623
echo "Skip installing tools for testing"
1724
fi

extra_requirements/tests.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"codestyle": ["pycodestyle","flake8","pylint"],
33
"pytest": ["pytest>=4.6","pytest-cov"],
44
"test_paramnet": ["tqdm", "scikit-learn==0.23.2"],
5-
"test_tabular_datamanager": ["pyarrow", "fastparquet"]
5+
"test_tabular_datamanager": ["tqdm","pyarrow", "fastparquet"]
66
}

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def read_file(file_name):
3636
version=read_file('hpobench/__version__.py').split()[-1].strip('\''),
3737
packages=setuptools.find_packages(exclude=['*.tests', '*.tests.*',
3838
'tests.*', 'tests'],),
39-
python_requires='>=3.6, <=3.10',
39+
python_requires='>=3.6',
4040
install_requires=read_file('./requirements.txt').split('\n'),
4141
extras_require=get_extra_requirements(),
4242
test_suite='pytest',

tests/test_paramnet.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import pytest
2+
import sys
23

3-
# import logging
4-
# logging.basicConfig(level=logging.DEBUG)
5-
# from hpobench.util.container_utils import enable_container_debug
6-
# enable_container_debug()
74

5+
MSG = 'Skip this test for new (>3.9) python versions. ' \
6+
'The paramnet benchmarks require an specific old scikit learn version. This version however does not work under ' \
7+
'python 3.10. Therefore we skip this test. The containerized version does still work under 3.10.'
88

9+
10+
@pytest.mark.skipif(sys.version_info > (3, 9), reason=MSG)
911
def test_load_data():
1012
from hpobench.util.data_manager import ParamNetDataManager
1113

0 commit comments

Comments
 (0)