Skip to content

Adding tuner #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 128 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
128 commits
Select commit Hold shift + click to select a range
01ba8e8
fixed package name to varname
psyrd1 Nov 18, 2020
8790fb7
removed instruction pylint: disable=C0303,C033
raphdem Nov 18, 2020
a0b4920
fixing default value
raphdem Dec 9, 2020
9a2e439
adding store_value
raphdem Dec 9, 2020
4d99381
Adding data type
sbacchio Dec 9, 2020
1b9d57c
Fixing initialization of Node
sbacchio Dec 9, 2020
7f212e7
Setting values also of variables
sbacchio Dec 9, 2020
912816e
Adding draft of tuner
sbacchio Dec 9, 2020
065321b
added optuna as an optional package
raphdem Dec 17, 2020
100c012
fixed typo
raphdem Dec 17, 2020
5210fc8
a sampler based on the optuna package
raphdem Dec 17, 2020
d683c48
tuner was changed to work with OptunaSampler
raphdem Dec 17, 2020
cbdd411
fixed package name
raphdem Dec 22, 2020
514b2f5
fixed JSON serializable error
raphdem Dec 22, 2020
4bc8238
new pytest file for the Tuner class
raphdem Dec 22, 2020
4a504f0
removing OptunaSampler
raphdem Dec 22, 2020
cbce515
using a list for variables
raphdem Jan 7, 2021
b329937
functions for merging nodes have been added
raphdem Feb 1, 2021
88408d7
changes were made to visualize groups within a graph
raphdem Feb 1, 2021
db50ddd
added documentation
raphdem Feb 1, 2021
c1cf27e
added documentation
raphdem Feb 1, 2021
b3371bf
tests for the optuna class
raphdem Feb 1, 2021
a83aa38
tests for the sampler class
raphdem Feb 1, 2021
1a35102
outline of a new subgraph class that enables the merging of nodes
raphdem Feb 1, 2021
7d75053
formatting changed
raphdem Feb 1, 2021
277e3fe
Removing test/__init__.py
sbacchio Feb 5, 2021
07e5d4a
Few changes
sbacchio Feb 5, 2021
398be09
new tests for merge functions added
raphdem Mar 9, 2021
323acf4
tests commented out after changes in code
raphdem Mar 9, 2021
707ecf1
var_name changed for variables created using alternatives
raphdem Mar 9, 2021
c683d0d
dependencies function was changed
raphdem Mar 9, 2021
ad6c75c
Merge branch 'user/raphdem' of github.com:Lyncs-API/tuneit into user/…
raphdem Mar 9, 2021
859488a
changed visualize function to enable different visualization of nodes…
raphdem Mar 22, 2021
d7c7d9b
1. updated get_attributes function to extract the information used fo…
raphdem Mar 22, 2021
ad50e2b
this file is not needed anymore
raphdem Mar 22, 2021
4f4a6a5
added a copy function for the Tuner class
raphdem Mar 22, 2021
c4d1c11
updated README file with example
raphdem Mar 22, 2021
35a5961
added a boolean precompute attribute to the class Object and now the …
raphdem Mar 22, 2021
86b366c
updated tests to work with the new changes made to the code
raphdem Mar 22, 2021
615f9d8
1. created get_key function and changed other functions (get_node(),_…
raphdem Mar 22, 2021
fcfc272
Adding workflows
sbacchio Mar 25, 2021
466a02b
Removing unwated MPI
sbacchio Mar 25, 2021
454b18b
Updating pylint score (from Github Action)
sbacchio Mar 25, 2021
1bef44d
added tests for the example in README
raphdem Mar 26, 2021
ebbc89a
Merge branch 'user/raphdem' of github.com:Lyncs-API/tuneit into user/…
raphdem Mar 26, 2021
af6c10e
1.added functionality that records the results in a panda dataframe, …
raphdem Apr 2, 2021
1e3be9f
reformatted
raphdem Apr 2, 2021
d20b0ee
added record argument
raphdem Apr 2, 2021
056c203
changed dot_attrs
raphdem Apr 2, 2021
a9a8fa4
changed dot_attrs
raphdem Apr 2, 2021
c266f40
changed crosscheck method to allow a delayed execution
raphdem Apr 2, 2021
b98f396
README: removed example that now exists in docs, conf: added an instr…
raphdem May 11, 2021
a1de802
reformatted
raphdem May 11, 2021
d5c41e3
new documentation pages about installation and some examples along wi…
raphdem May 11, 2021
7d61e47
add_deps now works for all types and a new function get_info was adde…
raphdem May 11, 2021
b0731bb
added an index to each node in the visualization of the graph and the…
raphdem May 11, 2021
6c74fc7
removed function get_attributes and used function get_info from final…
raphdem May 11, 2021
9a8f850
changed the headers of the dataframe
raphdem May 11, 2021
ee5847c
changed data attribute names to contain only one _
raphdem May 13, 2021
3733ecc
updated images to match changes in code
raphdem May 13, 2021
93f8658
updated alternatives to accept a name chosen by the user for the vari…
raphdem May 13, 2021
4203d8c
updated example doc
raphdem May 13, 2021
9918511
deleted files
raphdem May 13, 2021
37521aa
updated example
raphdem May 13, 2021
749b5ba
added pandas to the requirements
raphdem May 13, 2021
77c626c
updated plot
raphdem May 13, 2021
a1e6477
updated tests after get_attributes function was removed from optuna.py
raphdem May 13, 2021
09f0e0b
reformatted
raphdem May 13, 2021
ad3d99a
updated index file
raphdem May 18, 2021
9284700
added option in get_info() for short names
raphdem May 18, 2021
3ae6e6b
added data output node in the visualized graph
raphdem May 18, 2021
7ad7c4d
1. updated datarame headers after get_info() was changed, 2. added *a…
raphdem May 18, 2021
bf3fe80
changed how self.n_trials is assigned
raphdem May 18, 2021
a65f9ac
removed commented code
raphdem May 18, 2021
9c6f60b
reformatted
raphdem May 18, 2021
6955643
pandas are now imported inside record
raphdem May 18, 2021
1722fa8
updated index file
raphdem May 18, 2021
15bf4da
these tests are now only performed if optuna is installed
raphdem May 26, 2021
71efb0c
image used in index file (docs)
raphdem May 26, 2021
9abd1ba
added optuna to extras
raphdem May 26, 2021
a6135c1
changed definition of remove to include *nodes instead of nodes and c…
raphdem May 26, 2021
486c386
removed dependencies function from Object (not used anywhere)
raphdem May 26, 2021
7a151cf
updated index file with code block
raphdem May 26, 2021
25e1ab8
updated image to match code block
raphdem May 26, 2021
14b89a9
alternatives changed to allow the user to pass a name for the functio…
raphdem May 26, 2021
a5d4875
new images for index.rst
raphdem May 26, 2021
e491964
deleted unnecessary file
raphdem May 26, 2021
6e93846
visualize can now be called on a HighLevel object (obj.visualize())
raphdem May 26, 2021
34cd801
the functions benchmark, crosscheck and optimise can now be called on…
raphdem May 26, 2021
5eb61aa
updated index file with additional picture
raphdem May 26, 2021
6ad47a8
fixed alternatives because it was setting the name of the first optio…
raphdem May 26, 2021
48248dc
set HighLevel.optimise equal to optimise
raphdem May 26, 2021
7d11cda
changed how the name in alternatives is set
raphdem May 26, 2021
f48aa1b
updated README file
raphdem Jun 1, 2021
cc8d42b
updated images to match changes in the code
raphdem Jun 1, 2021
efc9d28
updated example.rst file
raphdem Jun 1, 2021
62c30f2
updated image to match changes in example.rst
raphdem Jun 1, 2021
2a72c19
updated picture
raphdem Jun 2, 2021
79ef8a6
removed pictures with wrong extension
raphdem Jun 2, 2021
4cf99fc
images with correct extensions
raphdem Jun 2, 2021
40c6e96
image with correct extension
raphdem Jun 2, 2021
24a7a33
fixed typo
raphdem Jun 2, 2021
696f1bf
updated README file
raphdem Jun 3, 2021
32876e7
fixed image placement
raphdem Jun 3, 2021
38240c5
Updating workflows
sbacchio Jun 3, 2021
85492b1
Updating pylint score (from Github Action)
sbacchio Jun 3, 2021
68debbc
Updating workflow
sbacchio Jun 3, 2021
b11939d
Incrementing version number
sbacchio Jun 3, 2021
5d644e7
Merge branch 'user/raphdem' of github.com:sbacchio/tunable into user/…
sbacchio Jun 3, 2021
d6b305b
Updating workflow
sbacchio Jun 3, 2021
aeacd2b
Updating __init__
sbacchio Jun 3, 2021
2d17504
Updating workflow
sbacchio Jun 3, 2021
dd63ceb
data object values are now passed correctly as kwargs
raphdem Jun 28, 2021
1439039
data object values are now included in sampler_kwargs
raphdem Jun 28, 2021
ee45f03
Merge branch 'user/raphdem' of github.com:Lyncs-API/tuneit into user/…
raphdem Jun 28, 2021
c60ed82
added tests that check if an object is able to be pickled
raphdem Jul 26, 2021
dfad749
changed dict_keys in alternatives to a tuple because they are not pic…
raphdem Jul 26, 2021
5c05746
added __reduce__ methods to classes in order to make them picklable
raphdem Jul 26, 2021
f3afaf5
1. added maximum number of failed trials before error is raise, 2. fi…
raphdem Jul 29, 2021
2f7c361
Updating pylint score (from Github Action)
sbacchio Jul 30, 2021
06f74da
updated setup file with testfixtures
raphdem Jul 30, 2021
e0327ec
Merge branch 'user/raphdem' of github.com:Lyncs-API/tuneit into user/…
raphdem Jul 30, 2021
a4fa61a
Applying black formatting (from Github Action)
sbacchio Jul 30, 2021
7516160
call to optimize updated to match changes about the handling of compu…
raphdem Aug 6, 2021
3ae9344
1. added logging using context managers, 2. added the __reduce__ meth…
raphdem Aug 6, 2021
b737470
formatted
raphdem Aug 6, 2021
990a449
Merge branch 'user/raphdem' of github.com:Lyncs-API/tuneit into user/…
raphdem Aug 6, 2021
d7e216f
Updating pylint score (from Github Action)
sbacchio Aug 6, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .github/workflows/black_n_pylint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# This workflow runs pylint and updates badge

name: linting

on:
pull_request:
branches:
- "*"

jobs:
black-n-pylint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}

- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: "3.x"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install black lyncs_setuptools[pylint]

- name: Applying black formatting
run: |
black --diff .
black .

- name: Pushing changes if any
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Applying black formatting (from Github Action)
commit_user_name: sbacchio
commit_user_email: [email protected]
commit_author: Simone Bacchio <[email protected]>

- name: Pylint output
run: |
badge=$(lyncs_pylint_badge --disable=import-error . | sed "s/\&/\\\&/g")
badge_line=$(awk '/!\[pylint\]/ {print FNR}' README.md)
sed -i "${badge_line}s#.*#${badge}#" README.md

- name: Pushing changes if any
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Updating pylint score (from Github Action)
commit_user_name: sbacchio
commit_user_email: [email protected]
commit_author: Simone Bacchio <[email protected]>

- name: Run lyncs_setuptools
run: |
lyncs_setuptools
177 changes: 113 additions & 64 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
@@ -1,81 +1,130 @@
# This workflow updates the packages on PyPI
# This workflow builds and tests PRs

name: build & test
name: PR build & test

on:
pull_request:
branches:
- "main"
- "master"
push:
branches:
- 'master'
paths-ignore:
- 'docs/**'
- "main"
- "master"

jobs:
build-n-publish:
runs-on: ubuntu-latest

build-n-publish:
runs-on: ${{ matrix.os }}
strategy:
matrix:
py-version:
- 3.x
os:
- ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.x'

- name: Install dependencies
run: |
python -m pip install --upgrade pip

- name: Install from source
run: |
pip install -e .[all]

- name: Run tests
run: |
pytest -v --cov-report=xml
export CODECOV_TOKEN="${{ secrets.CODECOV_TOKEN }}"
bash <(curl -s https://codecov.io/bash) -f ./coverage.xml -n tuneit

- name: Upload if not up to date
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.pypi_password }}
run: |
pip uninstall -y tuneit
pip install tuneit==$(lyncs_setuptools version) || (
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.py-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.py-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install lyncs_setuptools

- name: Check github ref
id: check-ref
env:
TEST_PASSWORD: ${{ secrets.test_pypi_password }}
PYPI_PASSWORD: ${{ secrets.pypi_password }}
run: |
if [[ $GITHUB_REF == 'refs/heads/main' || $GITHUB_REF == 'refs/heads/master' ]]; then
echo '::set-output name=main::true'
echo '::set-output name=extra::'
echo '::set-output name=url::'
echo "::set-output name=token::$PYPI_PASSWORD"
else
echo '::set-output name=main::false'
echo '::set-output name=extra::--extra-index-url https://test.pypi.org/simple/'
echo '::set-output name=url::--repository-url https://test.pypi.org/legacy/'
echo "::set-output name=token::$TEST_PASSWORD"
fi

- name: Trying to install from pip
id: check-version
continue-on-error: true
env:
EXTRA: ${{ steps.check-ref.outputs.extra }}
run: |
pip install $EXTRA $(lyncs_setuptools name)[all]==$(lyncs_setuptools version)

- name: Install from source
if: ${{ steps.check-version.outcome == 'failure' }}
run: |
pip install -e .[all]

- name: Run tests
run: |
pytest -v

- name: Upload if not up to date
if: ${{ steps.check-version.outcome == 'failure' }}
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ steps.check-ref.outputs.token }}
URL: ${{ steps.check-ref.outputs.url }}
run: |
pip install twine
python setup.py sdist
twine upload dist/*
count=0
while ! pip install tuneit==$(lyncs_setuptools version) && [ $count -lt 20 ]; do
sleep 1
count=$((count+1))
done
)
twine upload $URL dist/*

clean-run:

needs: build-n-publish
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
py-version:
- 3.6
- 3.7
- 3.8
os:
- ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip

- name: Install via pip
run: |
pip install tuneit[all]

- name: Run tests
run: |
pytest -v --import-mode=importlib
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.py-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.py-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install lyncs_setuptools

- name: Check github ref
id: check-ref
run: |
if [[ $GITHUB_REF == 'refs/heads/main' || $GITHUB_REF == 'refs/heads/master' ]]; then
echo '::set-output name=extra::'
else
echo '::set-output name=extra::--extra-index-url https://test.pypi.org/simple/'
fi

- name: Install via pip
env:
EXTRA: ${{ steps.check-ref.outputs.extra }}
run: |
# Keeps trying installing until succeeds (needs to wait for PyPi to update the index)
for i in $(seq 5); do
[ $i -gt 1 ] && sleep 20
pip install $EXTRA $(lyncs_setuptools name)[all]==$(lyncs_setuptools version) && s=0 && break || s=$?
done
(exit $s)

- name: Run tests
run: |
pytest -v --import-mode=importlib
114 changes: 0 additions & 114 deletions .github/workflows/ci_cd_test.yml

This file was deleted.

Loading