Skip to content

Commit bc3a736

Browse files
committed
Port over to AutoML common (#1318)
* Add submodule * Port to abstract_ensemble, backend from automl_common * Updated workflow files * Update imports * Trigger actions * Another import fix * update import * m * Backend fixes * Backend parameter update * fixture fix for backend * Fix tests * readd old abstract ensemble for now * flake8'd * Added install from source to readme * Moved installation w.r.t submodules to the docs * Temporarily remove submodule * Readded submodule * Updated to use automl_common under autosklearn * Updated MANIFEST * Removed uneeded statements from MANIFEST * Fixed import * Fixed comment line in MANIFEST.in * Added automl_common/setup.py to MANIFEST * Added prefix to script * Re-added removed title # * Added note for submodule for CONTRIBUTING * Made the submodule step a bit more clear for contributing.md * CONTRIBUTING fixes
1 parent 1a36458 commit bc3a736

29 files changed

+205
-486
lines changed

.github/workflows/dist.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,34 @@ on: [push, pull_request]
55
jobs:
66
dist:
77
runs-on: ubuntu-latest
8+
89
steps:
9-
- uses: actions/checkout@v2
10+
- name: Check out the repo
11+
uses: actions/checkout@v2
12+
with:
13+
submodules: recursive
14+
1015
- name: Setup Python
1116
uses: actions/setup-python@v2
1217
with:
1318
python-version: 3.8
19+
1420
- name: Build dist
1521
run: |
1622
python setup.py sdist
23+
1724
- name: Twine check
1825
run: |
1926
pip install twine
2027
last_dist=$(ls -t dist/auto-sklearn-*.tar.gz | head -n 1)
2128
twine_output=`twine check "$last_dist"`
2229
if [[ "$twine_output" != "Checking $last_dist: PASSED" ]]; then echo $twine_output && exit 1;fi
30+
2331
- name: Install dist
2432
run: |
2533
last_dist=$(ls -t dist/auto-sklearn-*.tar.gz | head -n 1)
2634
pip install $last_dist
35+
2736
- name: PEP 561 Compliance
2837
run: |
2938
pip install mypy

.github/workflows/docker-publish.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,18 @@ jobs:
1212
push_to_registry:
1313
name: Push Docker image to GitHub Packages
1414
runs-on: ubuntu-latest
15+
1516
steps:
1617
- name: Check out the repo
1718
uses: actions/checkout@v2
19+
with:
20+
submodules: recursive
21+
1822
- name: Extract branch name
1923
shell: bash
2024
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
2125
id: extract_branch
26+
2227
- name: Push to GitHub Packages
2328
uses: docker/build-push-action@v1
2429
with:
@@ -28,26 +33,32 @@ jobs:
2833
repository: automl/auto-sklearn/auto-sklearn
2934
tag_with_ref: true
3035
tags: ${{ steps.extract_branch.outputs.branch }}
36+
3137
- name: Push to Docker Hub
3238
uses: docker/build-push-action@v1
3339
with:
3440
username: ${{ secrets.DOCKER_USERNAME }}
3541
password: ${{ secrets.DOCKER_PASSWORD }}
3642
repository: mfeurer/auto-sklearn
3743
tags: ${{ steps.extract_branch.outputs.branch }}
44+
3845
- name: Docker Login
3946
run: docker login docker.pkg.github.com -u $GITHUB_ACTOR -p $GITHUB_TOKEN
4047
env:
4148
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
49+
4250
- name: Pull Docker image
4351
run: docker pull docker.pkg.github.com/$GITHUB_REPOSITORY/auto-sklearn:$BRANCH
4452
env:
4553
BRANCH: ${{ steps.extract_branch.outputs.branch }}
54+
4655
- name: Run image
4756
run: docker run -i -d --name unittester -v $GITHUB_WORKSPACE:/workspace -w /workspace docker.pkg.github.com/$GITHUB_REPOSITORY/auto-sklearn:$BRANCH
4857
env:
4958
BRANCH: ${{ steps.extract_branch.outputs.branch }}
59+
5060
- name: Auto-Sklearn loaded
5161
run: docker exec -i unittester python3 -c 'import autosklearn; print(f"Auto-sklearn imported from {autosklearn.__file__}")'
62+
5263
- name: Run unit testing
5364
run: docker exec -i unittester python3 -m pytest -v test

.github/workflows/docs.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,42 @@ jobs:
66
runs-on: ubuntu-latest
77
steps:
88
- uses: actions/checkout@v2
9+
with:
10+
submodules: recursive
11+
912
- name: Setup Python
1013
uses: actions/setup-python@v2
1114
with:
1215
python-version: 3.8
16+
1317
- name: Install dependencies
1418
run: |
15-
pip install -e .[docs,examples,examples_unix]
19+
pip install -e .[docs,examples]
20+
1621
- name: Make docs
1722
run: |
1823
cd doc
1924
make html
25+
2026
- name: Check links
2127
run: |
2228
cd doc
2329
make linkcheck
30+
2431
- name: Pull latest gh-pages
2532
if: (contains(github.ref, 'develop') || contains(github.ref, 'master')) && github.event_name == 'push'
2633
run: |
2734
cd ..
2835
git clone https://github.com/automl/auto-sklearn.git --branch gh-pages --single-branch gh-pages
36+
2937
- name: Copy new doc into gh-pages
3038
if: (contains(github.ref, 'develop') || contains(github.ref, 'master')) && github.event_name == 'push'
3139
run: |
3240
branch_name=${GITHUB_REF##*/}
3341
cd ../gh-pages
3442
rm -rf $branch_name
3543
cp -r ../auto-sklearn/doc/build/html $branch_name
44+
3645
- name: Push to gh-pages
3746
if: (contains(github.ref, 'develop') || contains(github.ref, 'master')) && github.event_name == 'push'
3847
run: |

.github/workflows/pre-commit.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,19 @@ jobs:
77
runs-on: ubuntu-latest
88
steps:
99
- uses: actions/checkout@v2
10+
with:
11+
submodules: recursive
12+
1013
- name: Setup Python 3.7
1114
uses: actions/setup-python@v2
1215
with:
1316
python-version: 3.7
17+
1418
- name: Install pre-commit
1519
run: |
1620
pip install pre-commit
1721
pre-commit install
22+
1823
- name: Run pre-commit
1924
run: |
2025
pre-commit run --all-files

.github/workflows/pytest.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ jobs:
2828
steps:
2929

3030
- uses: actions/checkout@v2
31+
with:
32+
submodules: recursive
33+
3134
- name: Setup Python ${{ matrix.python-version }}
3235
uses: actions/setup-python@v2
3336
# A note on checkout: When checking out the repository that

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "autosklearn/automl_common"]
2+
path = autosklearn/automl_common
3+
url = https://github.com/automl/automl_common

CONTRIBUTING.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,24 @@ Following that we'll tell you about how you can test your changes locally and th
3030
It's important to work off the latest changes on the **development** branch.
3131
```bash
3232
# With https
33-
git clone https://github.com/your-username/auto-sklearn
33+
# Note the --recurse-submodules args, we use a submodule autosklearn/automl_common
34+
# so it needs to be downloaded too
35+
git clone --recurse-submodules https://github.com/your-username/auto-sklearn
3436

3537
# ... or with ssh
36-
git clone [email protected]:your-username/auto-sklearn.git
38+
git clone --recurse-submodules [email protected]:your-username/auto-sklearn.git
3739

3840
# Navigate into the cloned repo
3941
cd auto-sklearn
4042

4143
# Create a new branch based off the development one
4244
git checkout -b my_new_branch development
4345

46+
# If you missed the --recurse-submodules arg during clone or need to install the
47+
# submodule manually, then execute the following line:
48+
#
49+
# git submodule udate --init --recursive
50+
4451
# ... Alternatively, if you would prefer a more manual method
4552
# Show all the available branches with a * beside your current one
4653
git branch
@@ -50,6 +57,11 @@ Following that we'll tell you about how you can test your changes locally and th
5057

5158
# Create a new branch based on the currently active branch
5259
git checkout -b my_new_branch
60+
61+
# If you missed the --recurse-submodules arg during clone or need to install the
62+
# submodule manually, then execute the following line:
63+
#
64+
# git submodule udate --init --recursive
5365
```
5466

5567
The reason to create a new branch is two fold:
@@ -335,6 +347,9 @@ Lastly, if the feature really is a game changer or you're very proud of it, cons
335347
cd auto-sklearn
336348
git checkout -b my_new_branch development
337349
350+
# Initialize autosklearn/automl_common submodule
351+
git submodule update --init --recursive
352+
338353
# Create a virtual environment and activate it so there are no package
339354
# conflicts
340355
python -m venv my-virtual-env

MANIFEST.in

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
1-
recursive-include autosklearn/metalearning/files *.arff
2-
recursive-include autosklearn/metalearning/files *.csv
3-
recursive-include autosklearn/metalearning/files *.txt
4-
include autosklearn/util/logging.yaml
1+
include LICENSE.txt
52
include requirements.txt
3+
include autosklearn/util/logging.yaml
64
include autosklearn/requirements.txt
7-
recursive-include autosklearn/experimental/ *.json
8-
include autosklearn/experimental/askl2_training_data.json
9-
include LICENSE.txt
5+
6+
# Meta-data
7+
recursive-include autosklearn/metalearning/files *.arff *.csv *.txt
8+
recursive-include autosklearn/experimental *.json
9+
10+
# Remove tests from automl_common
11+
prune autosklearn/automl_common/test
12+
exclude autosklearn/automl_common/setup.py
13+
14+
# Include automl_common LICENSE and README
15+
include autosklearn/automl_common/LICENSE
16+
include autosklearn/automl_common/README.md
17+

autosklearn/automl.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
from sklearn.metrics._classification import type_of_target
3939
from sklearn.dummy import DummyClassifier, DummyRegressor
4040

41+
from autosklearn.automl_common.common.utils.backend import Backend, create
42+
4143
from autosklearn.metrics import Scorer, default_metric_for_task
4244
from autosklearn.data.xy_data_manager import XYDataManager
4345
from autosklearn.data.validation import (
@@ -50,7 +52,6 @@
5052
from autosklearn.evaluation.abstract_evaluator import _fit_and_suppress_warnings
5153
from autosklearn.evaluation.train_evaluator import TrainEvaluator, _fit_with_budget
5254
from autosklearn.metrics import calculate_metric
53-
from autosklearn.util.backend import Backend, create
5455
from autosklearn.util.stopwatch import StopWatch
5556
from autosklearn.util.logging_ import (
5657
setup_logger,
@@ -281,6 +282,8 @@ def __init__(self,
281282
def _create_backend(self) -> Backend:
282283
return create(
283284
temporary_directory=self._temporary_directory,
285+
output_directory=None,
286+
prefix="auto-sklearn",
284287
delete_tmp_folder_after_terminate=self._delete_tmp_folder_after_terminate,
285288
)
286289

autosklearn/automl_common

Submodule automl_common added at 4c8ab91

autosklearn/ensemble_builder.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,12 @@
2424
from smac.runhistory.runhistory import RunInfo, RunValue
2525
from smac.tae.base import StatusType
2626

27-
from autosklearn.util.backend import Backend
27+
from autosklearn.automl_common.common.utils.backend import Backend
28+
from autosklearn.automl_common.common.ensemble_building.abstract_ensemble import AbstractEnsemble
29+
2830
from autosklearn.constants import BINARY_CLASSIFICATION
2931
from autosklearn.metrics import calculate_score, calculate_loss, Scorer
3032
from autosklearn.ensembles.ensemble_selection import EnsembleSelection
31-
from autosklearn.ensembles.abstract_ensemble import AbstractEnsemble
3233
from autosklearn.util.logging_ import get_named_client_logger
3334
from autosklearn.util.parallel import preload_modules
3435

autosklearn/ensembles/singlebest_ensemble.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55

66
from smac.runhistory.runhistory import RunHistory
77

8+
from autosklearn.automl_common.common.utils.backend import Backend
89
from autosklearn.ensembles.abstract_ensemble import AbstractEnsemble
910
from autosklearn.metrics import Scorer
1011
from autosklearn.pipeline.base import BasePipeline
11-
from autosklearn.util.backend import Backend
1212

1313

1414
class SingleBest(AbstractEnsemble):

autosklearn/evaluation/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,15 @@
1919

2020
from sklearn.model_selection._split import _RepeatedSplits, BaseShuffleSplit,\
2121
BaseCrossValidator
22-
from autosklearn.metrics import Scorer
2322

23+
from autosklearn.automl_common.common.utils.backend import Backend
24+
25+
from autosklearn.metrics import Scorer
2426
import autosklearn.evaluation.train_evaluator
2527
import autosklearn.evaluation.test_evaluator
2628
import autosklearn.evaluation.util
2729
import autosklearn.pipeline.components
2830
from autosklearn.evaluation.train_evaluator import TYPE_ADDITIONAL_INFO
29-
from autosklearn.util.backend import Backend
3031
from autosklearn.util.logging_ import PickableLoggerAdapter, get_named_client_logger
3132
from autosklearn.util.parallel import preload_modules
3233

autosklearn/evaluation/abstract_evaluator.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
from threadpoolctl import threadpool_limits
1616

17+
from autosklearn.automl_common.common.utils.backend import Backend
18+
1719
import autosklearn.pipeline.classification
1820
import autosklearn.pipeline.regression
1921
from autosklearn.pipeline.components.base import ThirdPartyComponents, _addons
@@ -28,7 +30,6 @@
2830
convert_multioutput_multiclass_to_multilabel
2931
)
3032
from autosklearn.metrics import calculate_loss, Scorer
31-
from autosklearn.util.backend import Backend
3233
from autosklearn.util.logging_ import PicklableClientLogger, get_named_client_logger
3334

3435
from ConfigSpace import Configuration

autosklearn/evaluation/test_evaluator.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@
88

99
from smac.tae import StatusType
1010

11+
from autosklearn.automl_common.common.utils.backend import Backend
12+
1113
from autosklearn.evaluation.abstract_evaluator import (
1214
AbstractEvaluator,
1315
_fit_and_suppress_warnings,
1416
)
1517
from autosklearn.pipeline.components.base import ThirdPartyComponents
1618
from autosklearn.metrics import calculate_loss, Scorer
17-
from autosklearn.util.backend import Backend
1819

1920

2021
__all__ = [

autosklearn/evaluation/train_evaluator.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
StratifiedKFold, train_test_split, BaseCrossValidator, PredefinedSplit
1818
from sklearn.model_selection._split import _RepeatedSplits, BaseShuffleSplit
1919

20+
from autosklearn.automl_common.common.utils.backend import Backend
21+
2022
from autosklearn.evaluation.abstract_evaluator import (
2123
AbstractEvaluator,
2224
TYPE_ADDITIONAL_INFO,
@@ -37,7 +39,6 @@
3739
from autosklearn.pipeline.base import PIPELINE_DATA_DTYPE
3840
from autosklearn.pipeline.components.base import IterativeComponent, ThirdPartyComponents
3941
from autosklearn.metrics import Scorer
40-
from autosklearn.util.backend import Backend
4142
from autosklearn.util.logging_ import PicklableClientLogger
4243

4344

0 commit comments

Comments
 (0)