From 546ae23dfe6c2936bf27a2abd9f80f017d30bb0a Mon Sep 17 00:00:00 2001 From: Nicolas Barascud <10333715+nbara@users.noreply.github.com> Date: Tue, 9 May 2023 18:01:34 +0200 Subject: [PATCH 01/13] [MAINT] Use Github Actions for docs --- .github/workflows/deploy_ghpages.yml | 27 +++++++++++++++++++ .../{pythonpackage.yml => testing.yml} | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/deploy_ghpages.yml rename .github/workflows/{pythonpackage.yml => testing.yml} (95%) diff --git a/.github/workflows/deploy_ghpages.yml b/.github/workflows/deploy_ghpages.yml new file mode 100644 index 00000000..069fec9e --- /dev/null +++ b/.github/workflows/deploy_ghpages.yml @@ -0,0 +1,27 @@ +name: Deploy GitHub pages + +on: + push: + branches: + - master + pull_request: + branches: + - master +jobs: + build_doc: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Generate HTML docs + uses: ammaraskar/sphinx-action@master + with: + docs-folder: "doc/" + pre-build-command: | + apt-get update + pip install -r requirements.txt + pip install -e ".[docs]" + - name: Upload generated HTML as artifact + uses: actions/upload-artifact@v2 + with: + name: DocHTML + path: doc/_build/html/ diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/testing.yml similarity index 95% rename from .github/workflows/pythonpackage.yml rename to .github/workflows/testing.yml index 8e4c8ff0..ed0e9390 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/testing.yml @@ -14,7 +14,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: [3.7, 3.8, 3.9] + python-version: [3.9, 3.10, 3.11] steps: - uses: actions/checkout@v1 From 365f7f4f759be8574284e12da12b243af8eb1927 Mon Sep 17 00:00:00 2001 From: Nicolas Barascud <10333715+nbara@users.noreply.github.com> Date: Tue, 9 May 2023 18:06:24 +0200 Subject: [PATCH 02/13] Update testing.yml --- .github/workflows/testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index ed0e9390..fe493ffe 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -14,7 +14,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: [3.9, 3.10, 3.11] + python-version: ["3.9", "3.10", "3.11"] steps: - uses: actions/checkout@v1 From 0701444d037a8465f409a498237485c5293283e7 Mon Sep 17 00:00:00 2001 From: Nicolas Barascud <10333715+nbara@users.noreply.github.com> Date: Tue, 9 May 2023 18:33:15 +0200 Subject: [PATCH 03/13] test --- .../{deploy_ghpages.yml => documentation.yml} | 0 .travis.yml | 32 ------------------- doc/requirements.txt | 9 ------ setup.cfg | 1 - setup.py | 2 +- 5 files changed, 1 insertion(+), 43 deletions(-) rename .github/workflows/{deploy_ghpages.yml => documentation.yml} (100%) delete mode 100644 .travis.yml delete mode 100644 doc/requirements.txt diff --git a/.github/workflows/deploy_ghpages.yml b/.github/workflows/documentation.yml similarity index 100% rename from .github/workflows/deploy_ghpages.yml rename to .github/workflows/documentation.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 220363e3..00000000 --- a/.travis.yml +++ /dev/null @@ -1,32 +0,0 @@ -branches: - only: - - master -notifications: - email: false -language: python -os: linux -dist: xenial -python: - # We don't actually use the Travis Python, but this keeps it organized. - - "3.8" -install: - - sudo apt-get update - - pip install -r requirements.txt - - pip install -e ".[docs]" -script: - - mkdir docs - - cd doc - - pip install -r requirements.txt - # - sphinx-autogen *.rst - - make html - - touch _build/html/.nojekyll -deploy: - provider: pages - token: $GITHUB_TOKEN - edge: true # opt in to dpl v2 - cleanup: false - keep_history: false - local_dir: _build/html - target_branch: gh-pages - on: - branch: master diff --git a/doc/requirements.txt b/doc/requirements.txt deleted file mode 100644 index 6c33dbdb..00000000 --- a/doc/requirements.txt +++ /dev/null @@ -1,9 +0,0 @@ -sphinx -sphinx-copybutton -sphinxemoji -pydata-sphinx-theme -numpydoc -matplotlib -pillow -sphinx-gallery -jupyter-sphinx diff --git a/setup.cfg b/setup.cfg index ea9b3246..366affdc 100644 --- a/setup.cfg +++ b/setup.cfg @@ -22,4 +22,3 @@ upload-dir = doc/_build/html extra = pymanopt docs = sphinx;sphinx-gallery;sphinx-bootstrap_theme;sphinx-copybutton;sphinxemoji;numpydoc;pydata-sphinx-theme;pillow;jupyter-sphinx;meegkit[extra] tests = pytest;pytest-cov;codecov;codespell;flake8;pydocstyle;meegkit[extra] - diff --git a/setup.py b/setup.py index d6e32cbe..66737f48 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ "Tracker": "https://github.com/nbara/python-meegkit/issues/", }, platforms="any", - python_requires=">=3.7", + python_requires=">=3.8", install_requires=["numpy", "scipy", "scikit-learn", "joblib", "pandas", "matplotlib", "tqdm", "pyriemann", "statsmodels"], zip_safe=False) From baa87a80aafa8c3f7f81a5a13bc3cba436214a6a Mon Sep 17 00:00:00 2001 From: Nicolas Barascud <10333715+nbara@users.noreply.github.com> Date: Tue, 9 May 2023 18:56:08 +0200 Subject: [PATCH 04/13] change --- .github/workflows/documentation.yml | 37 ++++++++++++++++------------- README.md | 2 +- citation.cff | 2 +- 3 files changed, 22 insertions(+), 19 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 069fec9e..e032e6ef 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -1,27 +1,30 @@ -name: Deploy GitHub pages +name: documentation on: push: branches: - master - pull_request: - branches: - - master + +# workflow_dispatch: # Uncomment line to be able to trigger action manually + jobs: - build_doc: + sphinx_docs_to_gh-pages: runs-on: ubuntu-latest + name: Sphinx docs to gh-pages steps: - - uses: actions/checkout@v2 - - name: Generate HTML docs - uses: ammaraskar/sphinx-action@master + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v1 with: - docs-folder: "doc/" - pre-build-command: | - apt-get update - pip install -r requirements.txt - pip install -e ".[docs]" - - name: Upload generated HTML as artifact - uses: actions/upload-artifact@v2 + python-version: 3.10 + - name: Install meegkit and dependencies + run: | + pip install -r requirements.txt + pip install -e .[docs] + - name: Running the Sphinx to gh-pages Action + uses: uibcdf/action-sphinx-docs-to-gh-pages@v1.1.0 with: - name: DocHTML - path: doc/_build/html/ + branch: main + dir_docs: doc diff --git a/README.md b/README.md index 4c29f2f7..ee9cfa9f 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ [![unit-tests](https://github.com/nbara/python-meegkit/workflows/unit-tests/badge.svg?style=flat)](https://github.com/nbara/python-meegkit/actions?workflow=unit-tests) -[![documentation](https://img.shields.io/travis/nbara/python-meegkit.svg?label=documentation&logo=travis)](https://www.travis-ci.com/github/nbara/python-meegkit) +[![docs](https://github.com/nbara/python-meegkit/workflows/documentation/badge.svg?style=flat)](https://github.com/nbara/python-meegkit/actions?workflow=documentation) [![codecov](https://codecov.io/gh/nbara/python-meegkit/branch/master/graph/badge.svg)](https://codecov.io/gh/nbara/python-meegkit) [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/nbara/python-meegkit/master) [![DOI](https://zenodo.org/badge/117451752.svg)](https://zenodo.org/badge/latestdoi/117451752) diff --git a/citation.cff b/citation.cff index 3106a231..c2dec4cb 100644 --- a/citation.cff +++ b/citation.cff @@ -5,7 +5,7 @@ authors: given-names: "Nicolas" orcid: "https://orcid.org/0000-0003-1495-561X" title: "MEEGkit" -version: 0.1.1 +version: 0.1.3 doi: 10.5281/zenodo.5643659 date-released: 2021-10-15 url: "https://github.com/nbara/python-meegkit" From 232f7b1b97474565d7f9b9406fad924e6c5364b7 Mon Sep 17 00:00:00 2001 From: Nicolas Barascud <10333715+nbara@users.noreply.github.com> Date: Tue, 9 May 2023 18:58:19 +0200 Subject: [PATCH 05/13] Update documentation.yml --- .github/workflows/documentation.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index e032e6ef..18d75dee 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -4,6 +4,9 @@ on: push: branches: - master + pull_request: + branches: + - master # workflow_dispatch: # Uncomment line to be able to trigger action manually From 834ca23d5ba6f1f36c855511cfc52c7c6e292291 Mon Sep 17 00:00:00 2001 From: Nicolas Barascud <10333715+nbara@users.noreply.github.com> Date: Tue, 9 May 2023 18:59:21 +0200 Subject: [PATCH 06/13] Update documentation.yml --- .github/workflows/documentation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 18d75dee..0b135f72 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -21,7 +21,7 @@ jobs: - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v1 with: - python-version: 3.10 + python-version: "3.10" - name: Install meegkit and dependencies run: | pip install -r requirements.txt From 876cbca073f7239de9d000638d3ee3e0b62c0824 Mon Sep 17 00:00:00 2001 From: Nicolas Barascud <10333715+nbara@users.noreply.github.com> Date: Tue, 9 May 2023 19:03:05 +0200 Subject: [PATCH 07/13] Update documentation.yml --- .github/workflows/documentation.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 0b135f72..56e4b903 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -16,9 +16,7 @@ jobs: name: Sphinx docs to gh-pages steps: - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set up Python ${{ matrix.python-version }} + - name: Set up Python 3.10 uses: actions/setup-python@v1 with: python-version: "3.10" @@ -29,5 +27,5 @@ jobs: - name: Running the Sphinx to gh-pages Action uses: uibcdf/action-sphinx-docs-to-gh-pages@v1.1.0 with: - branch: main + branch: master dir_docs: doc From 48ac95a3d335667ef250f0a49b0085cf09808e53 Mon Sep 17 00:00:00 2001 From: Nicolas Barascud <10333715+nbara@users.noreply.github.com> Date: Tue, 9 May 2023 20:45:07 +0200 Subject: [PATCH 08/13] Update documentation.yml --- .github/workflows/documentation.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 56e4b903..00c8b580 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -17,11 +17,13 @@ jobs: steps: - uses: actions/checkout@v3 - name: Set up Python 3.10 - uses: actions/setup-python@v1 + uses: actions/setup-python@v4 with: python-version: "3.10" + cache: "pip" - name: Install meegkit and dependencies run: | + python -m pip install --upgrade pip pip install -r requirements.txt pip install -e .[docs] - name: Running the Sphinx to gh-pages Action From 03d75d09c9641f6b72ee57048f838f2f93eee6d6 Mon Sep 17 00:00:00 2001 From: Nicolas Barascud <10333715+nbara@users.noreply.github.com> Date: Tue, 9 May 2023 20:48:15 +0200 Subject: [PATCH 09/13] try something else --- .github/workflows/documentation.yml | 12 +++++++----- setup.cfg | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 00c8b580..543c57f0 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -26,8 +26,10 @@ jobs: python -m pip install --upgrade pip pip install -r requirements.txt pip install -e .[docs] - - name: Running the Sphinx to gh-pages Action - uses: uibcdf/action-sphinx-docs-to-gh-pages@v1.1.0 - with: - branch: master - dir_docs: doc + - name: Build HTML + run: | + cd doc/ + make html + - name: Run ghp-import + run: | + ghp-import -n -p -f doc/_build/html diff --git a/setup.cfg b/setup.cfg index 366affdc..748a351d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -20,5 +20,5 @@ upload-dir = doc/_build/html [options.extras_require] extra = pymanopt -docs = sphinx;sphinx-gallery;sphinx-bootstrap_theme;sphinx-copybutton;sphinxemoji;numpydoc;pydata-sphinx-theme;pillow;jupyter-sphinx;meegkit[extra] +docs = sphinx;sphinx-gallery;sphinx-bootstrap_theme;sphinx-copybutton;sphinxemoji;numpydoc;pydata-sphinx-theme;pillow;jupyter-sphinx;ghp-import;meegkit[extra] tests = pytest;pytest-cov;codecov;codespell;flake8;pydocstyle;meegkit[extra] From 3fa7cafeb35fa32a7537d84d2fe31932d0326396 Mon Sep 17 00:00:00 2001 From: Nicolas Barascud <10333715+nbara@users.noreply.github.com> Date: Tue, 9 May 2023 21:27:29 +0200 Subject: [PATCH 10/13] Update test_asr.py --- tests/test_asr.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_asr.py b/tests/test_asr.py index 326e99cb..d698cad6 100644 --- a/tests/test_asr.py +++ b/tests/test_asr.py @@ -243,8 +243,8 @@ def test_asr_class(method, reref, show=False): plt.show() # TODO: the transform() process is stochastic, so Y and Y2 are not going to - # be entirely idetntical but close enough - assert np.all(np.abs(Y - Y2) < 5), np.max(np.abs(Y - Y2)) # < 5uV diff + # be entirely identical but close enough + assert np.all(np.abs(Y - Y2) < 6), np.max(np.abs(Y - Y2)) # < 6uV diff assert np.all(np.isreal(Y)), "output should be real-valued" assert np.all(np.isreal(Y2)), "output should be real-valued" @@ -261,5 +261,5 @@ def test_asr_class(method, reref, show=False): pytest.main([__file__]) # test_yulewalk(250, True) # test_asr_functions(True) - # test_asr_class(method='riemann', reref=False, show=True) + # test_asr_class(method='riemann', reref=True, show=False) # test_yulewalk_filter(16, True) From 0e71287ccb818c036f4ee2abd393e71a9f83540e Mon Sep 17 00:00:00 2001 From: Nicolas Barascud <10333715+nbara@users.noreply.github.com> Date: Tue, 9 May 2023 21:33:19 +0200 Subject: [PATCH 11/13] tidy up --- .github/workflows/documentation.yml | 2 +- .github/workflows/testing.yml | 2 +- README.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 543c57f0..e06e831b 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -1,4 +1,4 @@ -name: documentation +name: docs on: push: diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index fe493ffe..6ce5194a 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -1,4 +1,4 @@ -name: unit-tests +name: tests on: push: diff --git a/README.md b/README.md index ee9cfa9f..d88c5bc7 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![unit-tests](https://github.com/nbara/python-meegkit/workflows/unit-tests/badge.svg?style=flat)](https://github.com/nbara/python-meegkit/actions?workflow=unit-tests) +[![tests](https://github.com/nbara/python-meegkit/workflows/unit-tests/badge.svg?style=flat)](https://github.com/nbara/python-meegkit/actions?workflow=unit-tests) [![docs](https://github.com/nbara/python-meegkit/workflows/documentation/badge.svg?style=flat)](https://github.com/nbara/python-meegkit/actions?workflow=documentation) [![codecov](https://codecov.io/gh/nbara/python-meegkit/branch/master/graph/badge.svg)](https://codecov.io/gh/nbara/python-meegkit) [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/nbara/python-meegkit/master) From 3ffb02e7364a960e8468912b250695d0f6bbaed5 Mon Sep 17 00:00:00 2001 From: Nicolas Barascud <10333715+nbara@users.noreply.github.com> Date: Tue, 9 May 2023 21:34:37 +0200 Subject: [PATCH 12/13] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d88c5bc7..d5dc75bd 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -[![tests](https://github.com/nbara/python-meegkit/workflows/unit-tests/badge.svg?style=flat)](https://github.com/nbara/python-meegkit/actions?workflow=unit-tests) -[![docs](https://github.com/nbara/python-meegkit/workflows/documentation/badge.svg?style=flat)](https://github.com/nbara/python-meegkit/actions?workflow=documentation) +[![tests](https://github.com/nbara/python-meegkit/workflows/tests/badge.svg?style=flat)](https://github.com/nbara/python-meegkit/actions?workflow=tests) +[![docs](https://github.com/nbara/python-meegkit/workflows/docs/badge.svg?style=flat)](https://github.com/nbara/python-meegkit/actions?workflow=docs) [![codecov](https://codecov.io/gh/nbara/python-meegkit/branch/master/graph/badge.svg)](https://codecov.io/gh/nbara/python-meegkit) [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/nbara/python-meegkit/master) [![DOI](https://zenodo.org/badge/117451752.svg)](https://zenodo.org/badge/latestdoi/117451752) From 7552693b1324d53d55071a3305b23b548e8b4616 Mon Sep 17 00:00:00 2001 From: Nicolas Barascud <10333715+nbara@users.noreply.github.com> Date: Tue, 9 May 2023 21:39:03 +0200 Subject: [PATCH 13/13] Update documentation.yml --- .github/workflows/documentation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index e06e831b..06dd8d47 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -13,7 +13,7 @@ on: jobs: sphinx_docs_to_gh-pages: runs-on: ubuntu-latest - name: Sphinx docs to gh-pages + name: deploy to gh-pages steps: - uses: actions/checkout@v3 - name: Set up Python 3.10