From a5b01802037df1c61eb41d0a9eb62ab3c0d31684 Mon Sep 17 00:00:00 2001 From: Nicolas Barascud <10333715+nbara@users.noreply.github.com> Date: Mon, 2 Sep 2019 10:13:00 +0200 Subject: [PATCH 01/13] test GitHub actions --- .github/workflows/pythonpackage.yml | 31 +++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/pythonpackage.yml diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml new file mode 100644 index 00000000..bb9d9775 --- /dev/null +++ b/.github/workflows/pythonpackage.yml @@ -0,0 +1,31 @@ +name: Python package + +on: [push] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + max-parallel: 4 + matrix: + python-version: [2.7, 3.5, 3.6, 3.7] + + steps: + - uses: actions/checkout@v1 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + - name: Lint with flake8 + run: | + pip install flake8 pytest pytest-cov codecov codespell pydocstyle + make pep + - name: Test with pytest + run: | + pip install pytest + pytest From 91b90d1bf179c62a8c9c6cde009af97142078b42 Mon Sep 17 00:00:00 2001 From: nbara <10333715+nbara@users.noreply.github.com> Date: Mon, 2 Sep 2019 10:18:06 +0200 Subject: [PATCH 02/13] add requirements --- .github/workflows/pythonpackage.yml | 5 ++--- requirements.txt | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 requirements.txt diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index bb9d9775..210eca1b 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -9,7 +9,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: [2.7, 3.5, 3.6, 3.7] + python-version: [3.5, 3.6, 3.7] steps: - uses: actions/checkout@v1 @@ -23,9 +23,8 @@ jobs: pip install -r requirements.txt - name: Lint with flake8 run: | - pip install flake8 pytest pytest-cov codecov codespell pydocstyle make pep - name: Test with pytest run: | pip install pytest - pytest + pytest --cov=meegkit tests/ diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000..9ffbbc83 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,14 @@ +numpy +scipy +matplotlib +scikit-learn +sphinx +joblib +numpydoc +flake8 +pytest +pytest-cov +codecov +codespell +pydocstyle +tqdm From a6e827a8835cba904209be5ef9def88f63ad92d4 Mon Sep 17 00:00:00 2001 From: nbara <10333715+nbara@users.noreply.github.com> Date: Mon, 2 Sep 2019 10:20:46 +0200 Subject: [PATCH 03/13] Update pythonpackage.yml --- .github/workflows/pythonpackage.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 210eca1b..b0518aea 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -21,6 +21,9 @@ jobs: run: | python -m pip install --upgrade pip pip install -r requirements.txt + - name: Install meegkit + run: | + pip install -e . - name: Lint with flake8 run: | make pep From ec997bcf4a34b2700c4f6e41450e893cef0efbd7 Mon Sep 17 00:00:00 2001 From: nbara <10333715+nbara@users.noreply.github.com> Date: Mon, 2 Sep 2019 10:33:32 +0200 Subject: [PATCH 04/13] Update pythonpackage.yml --- .github/workflows/pythonpackage.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index b0518aea..d863dbcc 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -31,3 +31,10 @@ jobs: run: | pip install pytest pytest --cov=meegkit tests/ + - name: Upload coverage to Codecov + uses: codecov/codecov-action + with: + token: ${{secrets.CODECOV_TOKEN}} + file: ./coverage.xml + flags: unittests + name: codecov-umbrella From c588ec35de7b8bdc2e05626c7581ceee7f04483a Mon Sep 17 00:00:00 2001 From: nbara <10333715+nbara@users.noreply.github.com> Date: Mon, 2 Sep 2019 10:33:59 +0200 Subject: [PATCH 05/13] remove coverage from travis --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index b712e266..59a7a0bc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,5 +33,5 @@ install: - python setup.py develop script: make pep script: pytest --cov=meegkit tests/ -after_success: - - bash <(curl -s https://codecov.io/bash) +# after_success: +# - bash <(curl -s https://codecov.io/bash) From b3a20b85675495e1b24c85e166a77735bbc8d700 Mon Sep 17 00:00:00 2001 From: nbara <10333715+nbara@users.noreply.github.com> Date: Mon, 2 Sep 2019 10:35:43 +0200 Subject: [PATCH 06/13] Update pythonpackage.yml --- .github/workflows/pythonpackage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index d863dbcc..d6a2c1c9 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -32,7 +32,7 @@ jobs: pip install pytest pytest --cov=meegkit tests/ - name: Upload coverage to Codecov - uses: codecov/codecov-action + uses: codecov/codecov-action@v1.0.2 with: token: ${{secrets.CODECOV_TOKEN}} file: ./coverage.xml From 5d27c731e0d5673abe957428dd7409eee7b4e0d1 Mon Sep 17 00:00:00 2001 From: nbara <10333715+nbara@users.noreply.github.com> Date: Mon, 2 Sep 2019 10:55:35 +0200 Subject: [PATCH 07/13] Update .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 59a7a0bc..4e683e4b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,6 +32,6 @@ install: - source activate meegkit - python setup.py develop script: make pep -script: pytest --cov=meegkit tests/ +script: pytest tests/ --cov=meegkit --cov-report=xml # after_success: # - bash <(curl -s https://codecov.io/bash) From 072333837b71eaf3159ec3e713adb4b09625c88e Mon Sep 17 00:00:00 2001 From: nbara <10333715+nbara@users.noreply.github.com> Date: Mon, 2 Sep 2019 10:56:35 +0200 Subject: [PATCH 08/13] Update pythonpackage.yml --- .github/workflows/pythonpackage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index d6a2c1c9..646bfa76 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -30,7 +30,7 @@ jobs: - name: Test with pytest run: | pip install pytest - pytest --cov=meegkit tests/ + pytest --cov=meegkit --cov-report=xml tests/ - name: Upload coverage to Codecov uses: codecov/codecov-action@v1.0.2 with: From 5d6b026ff7e702a7570ed9c54e96a8f4d5a1b3b6 Mon Sep 17 00:00:00 2001 From: nbara <10333715+nbara@users.noreply.github.com> Date: Mon, 2 Sep 2019 11:40:00 +0200 Subject: [PATCH 09/13] Update pythonpackage.yml --- .github/workflows/pythonpackage.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 646bfa76..ed422f42 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -29,12 +29,11 @@ jobs: make pep - name: Test with pytest run: | - pip install pytest pytest --cov=meegkit --cov-report=xml tests/ - name: Upload coverage to Codecov uses: codecov/codecov-action@v1.0.2 with: token: ${{secrets.CODECOV_TOKEN}} - file: ./coverage.xml - flags: unittests - name: codecov-umbrella + # file: ./coverage.xml + # flags: unittests + # name: codecov-umbrella From a6f34148c81a9e2987449eb2d76d8447fb430f0b Mon Sep 17 00:00:00 2001 From: nbara <10333715+nbara@users.noreply.github.com> Date: Mon, 2 Sep 2019 11:49:41 +0200 Subject: [PATCH 10/13] remove conda --- .github/workflows/pythonpackage.yml | 5 +---- .travis.yml | 22 ++-------------------- environment.yml | 21 --------------------- 3 files changed, 3 insertions(+), 45 deletions(-) delete mode 100644 environment.yml diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index ed422f42..af0874e2 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -31,9 +31,6 @@ jobs: run: | pytest --cov=meegkit --cov-report=xml tests/ - name: Upload coverage to Codecov - uses: codecov/codecov-action@v1.0.2 with: token: ${{secrets.CODECOV_TOKEN}} - # file: ./coverage.xml - # flags: unittests - # name: codecov-umbrella + run: bash <(curl -s https://codecov.io/bash) diff --git a/.travis.yml b/.travis.yml index 4e683e4b..7dfb33ea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,26 +11,8 @@ python: - "3.7" install: - sudo apt-get update - # We do this conditionally because it saves us some downloading if the - # version is the same. - - if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then - wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O miniconda.sh; - else - wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh; - fi - - bash miniconda.sh -b -p $HOME/miniconda - - export PATH="$HOME/miniconda/bin:$PATH" - - hash -r - - conda config --set always_yes yes --set changeps1 no - - conda update -q conda - - - export DISPLAY=:99.0 - - /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1400x900x24 -ac +extension GLX +render -noreset - # Useful for debugging any issues with conda - - conda info -a - - conda env create -f environment.yml - - source activate meegkit - - python setup.py develop + - pip install -r requirements.txt + - pip install -e . script: make pep script: pytest tests/ --cov=meegkit --cov-report=xml # after_success: diff --git a/environment.yml b/environment.yml deleted file mode 100644 index 3c48147d..00000000 --- a/environment.yml +++ /dev/null @@ -1,21 +0,0 @@ -# run: conda env create --file environment.yml -name: meegkit -dependencies: -- python>=3.5 -- pip -- numpy -- scipy -- matplotlib -- scikit-learn -- sphinx -- joblib -- numpydoc -- flake8 -- pip: - - pytest - - pytest-cov - - codecov - - codespell - - pydocstyle - - sphinx-gallery - - tqdm From 8b75ff53388dd6dcf64224397a36eb4d4c18e7bc Mon Sep 17 00:00:00 2001 From: nbara <10333715+nbara@users.noreply.github.com> Date: Mon, 2 Sep 2019 11:50:13 +0200 Subject: [PATCH 11/13] Update pythonpackage.yml --- .github/workflows/pythonpackage.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index af0874e2..038c20cd 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -31,6 +31,5 @@ jobs: run: | pytest --cov=meegkit --cov-report=xml tests/ - name: Upload coverage to Codecov - with: - token: ${{secrets.CODECOV_TOKEN}} + # token: ${{secrets.CODECOV_TOKEN}} run: bash <(curl -s https://codecov.io/bash) From 3f1d45264b0954125fc5d4f7261ebe0285dddb25 Mon Sep 17 00:00:00 2001 From: nbara <10333715+nbara@users.noreply.github.com> Date: Mon, 2 Sep 2019 12:00:15 +0200 Subject: [PATCH 12/13] Update sig.py --- meegkit/utils/sig.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/meegkit/utils/sig.py b/meegkit/utils/sig.py index 20cec6a8..26e197b3 100644 --- a/meegkit/utils/sig.py +++ b/meegkit/utils/sig.py @@ -1,4 +1,5 @@ """Signal processing tools.""" +# coding: utf-8 from __future__ import absolute_import, division, print_function import numpy as np @@ -53,10 +54,13 @@ def modulation_index(phase, amp, n_bins=18): time series can be constructed by cutting the amplitude time series at a random time point and reversing the order of both parts [2]_. The observed coupling value is standardized to the distribution of the shuffled coupling - values according to the following formula: MI_z = (MI_observed − - µ_MI_shuffled) / σ_MI_shuffled, where μ denotes the mean and σ the standard - deviation. Only when the observed phase-locking value is larger than 95 % - of shuffled values, it is defined as significant. See [2]_ for details. + values according to the following formula: + + MI_z = (MI_observed − µ_MI_shuffled) / σ_MI_shuffled + + where μ denotes the mean and σ the standard deviation. Only when the + observed phase-locking value is larger than 95 % of shuffled values, it is + defined as significant. See [2]_ for details. References ---------- From 60e1914f61ce91b0d53757daa6b23e6e44aa7136 Mon Sep 17 00:00:00 2001 From: nbara <10333715+nbara@users.noreply.github.com> Date: Mon, 2 Sep 2019 12:02:50 +0200 Subject: [PATCH 13/13] Update sig.py --- meegkit/utils/sig.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meegkit/utils/sig.py b/meegkit/utils/sig.py index 26e197b3..4182ee33 100644 --- a/meegkit/utils/sig.py +++ b/meegkit/utils/sig.py @@ -1,5 +1,5 @@ -"""Signal processing tools.""" # coding: utf-8 +"""Signal processing tools.""" from __future__ import absolute_import, division, print_function import numpy as np