Skip to content

Commit

Permalink
Develop (#50)
Browse files Browse the repository at this point in the history
* add example for hyperparam optimizer use case and debugg allow_multi_dim_metrics

* test json serialization

* Fixed issue with photon registry when multiple registry objects are issued with and without custom elements folder

* Fixed registry test

* dont write json transformer file if save_output = False

* Fixed save_optimum_pipe function

* Added tests for save_optimum_pipe

* fixed save_optimum_pipe loading error

* Fixed save_optimum_pipe bugfix

* Added multiprocessing switch for parallel computing (#53)

* Added multiprocessing switch for parallel computing

* Debugging failing tests: Updated ubuntu and python

* Fixed default multithreading behaviour

* Changed versioning to pbr, resolved circular input errors, moved base… (#52)

* Changed versioning to pbr, resolved circular input errors, moved base elements to __init__

* fixed import

* Added missing pbr dependency

* Fixed relative import

* Removed circular import

* Removed short description

* Added pbr requirement

* Updated GH-Actions

* Fixed inferred versioning from metadata

* Added description file content type

* enabled build on pr and removed generation of version number

* Changed keywords, updated gh actions

* pypi publish action update

* deactivated test pypi build for non master pushes.

* Create dependabot.yml (#54)

* Feature/new imports (#55)

* Added new imports / modified examples

* Added missing __init__ files

* Added self hosted fonts for docs

* gh action for documentation auto-update

* fixed mkdocs path

* removed graph stuff

* Updated readme

* add json serialization for non-native result objects, add warning for imbalanced classes with accuracy

* debug imbalanced data transform unit test

* debug unit tests

* switched to processes for parallelBranch and PermutationTest

* debug

* Adapted gh action to new main branch

* Adapted gh action for new main branch

* refactor photonai output

* removed ugly test results

* added missing import

* [skip ci] Added summary

* Switched to diabetes dataset for sklearn compatibility

* switched python tests from boston_housing to diabetes dataset

* Fixed scikit-learn version due to currently missing support

* Fixed scikit-learn version due to currently missing support

* Fixed np bool

---------

Co-authored-by: Jan Ernsting <[email protected]>
  • Loading branch information
RLeenings and jernsting authored Feb 16, 2023
1 parent fa57aab commit 5135a0c
Show file tree
Hide file tree
Showing 94 changed files with 1,060 additions and 309 deletions.
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "github-actions" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "daily"
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "daily"
56 changes: 56 additions & 0 deletions .github/workflows/documentation_build_and_update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Update documentation
on: push

jobs:
build:
name: Build docs
runs-on: ubuntu-latest
if: ${{ github.ref != 'refs/heads/main' }}
steps:
- name: Checkout main
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Install mkdocs requirements
run: pip install mkdocs mkdocs-material pymdown-extensions mkdocstrings-python mkdocs-jupyter jupyter mkdocs-macros-plugin

- name: Install photonai requirements
run: pip install -r requirements.txt

- name: Install photonai
run: pip install .

- name: Build docs
run: mkdocs build
deploy:
name: Deploy docs
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/main' }}
steps:
- name: Checkout main
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Install mkdocs requirements
run: pip install mkdocs mkdocs-material pymdown-extensions mkdocstrings-python mkdocs-jupyter jupyter mkdocs-macros-plugin

- name: Install photonai requirements
run: pip install -r requirements.txt

- name: Install photonai
run: pip install .

- name: Deploy docs
run: mkdocs gh-deploy --force
16 changes: 9 additions & 7 deletions .github/workflows/python-deploy_to_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,19 @@ on:
jobs:
deploy:
name: Build and publish to PyPI
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7.6
uses: actions/setup-python@v2
- uses: actions/checkout@v3
with:
python-version: 3.7.6
fetch-depth: 0
- name: Set up Python 3.10.8
uses: actions/setup-python@v4
with:
python-version: 3.10.8
- name: Install pypa/build
run: pip install build
run: pip install build pbr wheel
- name: Build a binary wheel and a source tarball
run: python -m build --sdist --wheel --outdir dist/ .
run: python -m build -n --sdist --wheel --outdir dist/ .
- name: Publish distribution to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand Down
42 changes: 20 additions & 22 deletions .github/workflows/python-test_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ name: PHOTONAI test and test deploy

on:
push:
branches: [ master, develop ]
branches: [ main, develop ]
pull_request:
branches: [ master, develop ]
branches: [ main, develop ]

jobs:
pytest:
name: Run PHOTONAI tests and publish test coverage
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04

services:
mongodb:
Expand All @@ -21,49 +21,47 @@ jobs:
- 27017:27017

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7.6
uses: actions/setup-python@v2
- uses: actions/checkout@v3
- name: Set up Python 3.10.8
uses: actions/setup-python@v4
with:
python-version: 3.7.6
python-version: 3.10.8
# - name: Install os dependencies
# run: |
# sudo apt-get update
# sudo apt-get -y install gfortran swig
- name: Install dependencies
run: |
pip install wheel flake8
pip install wheel flake8 pbr
python setup.py egg_info
pip install tensorflow pytest pytest-cov coveralls -r photonai.egg-info/requires.txt -r photonai/optimization/smac/requirements.txt -r photonai/optimization/nevergrad/requirements.txt
- name: Test with pytest
run: |
PYTHONPATH=./ pytest ./test --cov=./photonai --tb=long
PYTHONPATH=./ pytest ./test --cov=./photonai --full-trace
- name: Coveralls
run: coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
deploy:
name: Build and publish to TestPyPI
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
needs: pytest
if: github.ref == 'refs/heads/master'
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7.6
uses: actions/setup-python@v2
- uses: actions/checkout@v3
with:
python-version: 3.7.6
- name: Replace version number with commit hash
run: |
dt=$(date '+%Y.%m.%d.%H.%M.%S')
sed -i "s/^__version__.*/__version__ = '$dt'/g" setup.py
fetch-depth: 0
- name: Set up Python 3.10.8
uses: actions/setup-python@v4
with:
python-version: 3.10.8
- name: Install pypa/build
run: pip install build
run: pip install build pbr wheel
- name: Build a binary wheel and a source tarball
run: python -m build --sdist --wheel --outdir dist/ .
run: python -m build -n --sdist --wheel --outdir dist/ .
- name: Publish distribution to Test PyPI
uses: pypa/gh-action-pypi-publish@master
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -181,3 +181,6 @@ tmtagsHistory
.bundle
/hyperpipe_results.csv
/config_history.csv

AUTHORS
ChangeLog
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ You can setup a full stack machine learning pipeline in a few lines of code:
from sklearn.datasets import load_breast_cancer
from sklearn.model_selection import KFold

from photonai.base import Hyperpipe, PipelineElement
from photonai.optimization import FloatRange, Categorical, IntegerRange
from photonai import Hyperpipe, PipelineElement, FloatRange, Categorical, IntegerRange

# DESIGN YOUR PIPELINE
my_pipe = Hyperpipe('basic_svm_pipe', # the name of your pipeline
Expand Down
2 changes: 1 addition & 1 deletion documentation/docs/algorithms/algorithms_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ PHOTONAI offers [Grid-Search](../../api/optimization/grid_search), [Random Searc

## PCA
```python
from photonai.base import PipelineElement
from photonai import PipelineElement
PipelineElement('PCA',
hyperparameters={'n_components': IntegerRange(5, 20)},
test_disabled=True)
Expand Down
Loading

0 comments on commit 5135a0c

Please sign in to comment.