diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 94aa9235c..ad3728979 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -16,7 +16,7 @@ jobs: python-version: ["3.9"] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Create local data folder run: | @@ -44,10 +44,10 @@ jobs: - name: Install dependencies if: steps.cached-dataset-docs.outputs.cache-hit != 'true' - run: poetry install --no-interaction --no-root --with docs,deeplearning + run: poetry install --no-interaction --no-root --with docs --extras deeplearning - name: Install library - run: poetry install --no-interaction --with docs,deeplearning + run: poetry install --no-interaction --with docs --extras deeplearning - name: Build docs run: | @@ -69,7 +69,7 @@ jobs: os: [ubuntu-latest] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Create local data folder run: | @@ -85,23 +85,12 @@ jobs: docs/build - name: Checkout moabb.github.io - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: "NeuroTechX/moabb.github.io" path: moabb-ghio token: ${{ secrets.MOABB_GHIO }} - - name: Deploy on moabb.neurotechx.com - run: | - git config --global user.email "ci@neurotechx.com" - git config --global user.name "Github Actions" - cd ~/work/moabb/moabb/moabb-ghio - rm -Rf docs - cp -a ~/work/moabb/moabb/docs/build/html ./docs - git add -A - git commit -m "GH Actions update of docs ($GITHUB_RUN_ID - $GITHUB_RUN_NUMBER)" - git push origin master - deploy_gh_pages: if: ${{ github.ref == 'refs/heads/develop' }} needs: build_docs @@ -112,7 +101,7 @@ jobs: os: [ubuntu-latest] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Create local data folder run: | @@ -128,11 +117,21 @@ jobs: docs/build - name: Checkout gh pages - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: gh-pages path: moabb-ghpages + - name: Deploy Neurotechx Subpage + uses: peaceiris/actions-gh-pages@v3 + with: + deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} + external_repository: NeuroTechX/moabb.github.io + destination_dir: docs/ + publish_branch: master + publish_dir: ./docs/build/html + cname: moabb.neurotechx.com/ + - name: Deploy on gh-pages run: | git config --global user.email "ci@neurotechx.com" @@ -143,60 +142,3 @@ jobs: git add -A git commit -m "GH Actions update of GH pages ($GITHUB_RUN_ID - $GITHUB_RUN_NUMBER)" git push origin gh-pages - - - name: Deploy to moabb.neurotechx.com/ - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/develop'}} - uses: peaceiris/actions-gh-pages@v3 - with: - deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} - external_repository: NeuroTechX/moabb.github.io - destination_dir: docs/ - publish_branch: master - publish_dir: ./docs/build/html - cname: moabb.neurotechx.com/ - - # Previous test with moabb GH pages, official docs point to moabb.github.io - ########################################################################### - # Since we want the URL to be neurotechx.github.io/docs/ the html output needs to be put in a ./docs subfolder of the publish_dir - # - name: Move docs into site folder - # run: | - # mkdir site - # mv docs/build/html site/docs - - # - name: Deploy on moabb gh-pages - # uses: peaceiris/actions-gh-pages@v3 - # if: github.ref == 'refs/heads/master' - # with: - # github_token: ${{ secrets.GITHUB_TOKEN }} - # publish_dir: site - - # Using checkout and push actions, not working - ############################################## - # - name: Install SSH key - # uses: shimataro/ssh-key-action@v2 - # with: - # key: ${{ secrets.MOABB_DOCS_SSH }} - # known_hosts: ${{ secrets.KNOWN_HOST_GH }} - - # - name: Checkout moabb.github.io - # uses: actions/checkout@v2 - # with: - # repository: "NeuroTechX/moabb.github.io" - # path: moabb-ghio - # fetch-depth: 0 - # persist-credentials: false - - # - name: Add html files - # run: | - # cd ~/work/moabb/moabb/moabb-ghio - # rm -Rf docs - # cp -a ~/work/moabb/moabb/docs/build/html ./docs - # git config --global user.email "ci@neurotechx.com" - # git config --global user.name "Github Actions" - # git commit -m "GH Actions update of docs ($GITHUB_RUN_ID - $GITHUB_RUN_NUMBER)" -a - - # - name: Push - # uses: ad-m/github-push-action@master - # with: - # github_token: ${{ secrets.MOABB_GHIO }} - # repository: "NeuroTechX/moabb.github.io" diff --git a/.github/workflows/test-braindecode.yml b/.github/workflows/test-braindecode.yml new file mode 100644 index 000000000..6660ce6fe --- /dev/null +++ b/.github/workflows/test-braindecode.yml @@ -0,0 +1,76 @@ +name: Test-braindecode + +on: + push: + branches: [develop] + pull_request: + branches: [develop] + +jobs: + test: + name: dev ${{ matrix.os }}, py-${{ matrix.python-version }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: true + matrix: + os: [ubuntu-latest] + python-version: ["3.8"] + defaults: + run: + shell: bash + steps: + - name: Checkout MOABB + uses: actions/checkout@v4 + + - name: Checkout Braindecode + uses: actions/checkout@v4 + with: + repository: braindecode/braindecode + path: braindecode + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Install Poetry + uses: snok/install-poetry@v1 + with: + virtualenvs-create: true + virtualenvs-in-project: true + + - name: Create/Restore MNE Data Cache + id: cache-mne_data + uses: actions/cache@v3 + with: + path: ~/mne_data + key: ${{ runner.os }}-mne + + - name: Load cached venv + if: runner.os != 'Windows' + id: cached-poetry-dependencies + uses: actions/cache@v3 + with: + path: .venv + key: + testvenv-${{ matrix.os }}-py${{matrix.python-version}}-${{ + hashFiles('**/poetry.lock') }} + + - name: Install dependencies + if: | + (runner.os != 'Windows') && + (steps.cached-poetry-dependencies.outputs.cache-hit != 'true') + run: poetry install --no-interaction --no-root + + - name: Install library + run: poetry install --no-interaction + + - name: Install and test braindecode + run: | + source $VENV + poetry run pip install torch + cd braindecode + poetry run pip install -e .[tests] + poetry run pytest test/ + + # poetry run pip install -U https://api.github.com/repos/braindecode/braindecode/zipball/master diff --git a/.github/workflows/test-devel.yml b/.github/workflows/test-devel.yml index ec55c1af8..45a2b7530 100644 --- a/.github/workflows/test-devel.yml +++ b/.github/workflows/test-devel.yml @@ -19,7 +19,7 @@ jobs: run: shell: bash steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup Python uses: actions/setup-python@v4 @@ -46,11 +46,11 @@ jobs: if: | (runner.os != 'Windows') && (steps.cached-poetry-dependencies.outputs.cache-hit != 'true') - run: poetry install --no-interaction --no-root --with deeplearning + run: poetry install --no-interaction --no-root --extras deeplearning - name: Install library (Linux/OSX) if: ${{ runner.os != 'Windows' }} - run: poetry install --no-interaction --with deeplearning + run: poetry install --no-interaction --extras deeplearning - name: Install library (Windows) if: ${{ runner.os == 'Windows' }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 37caa2843..fb9ebb4ae 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,7 +19,7 @@ jobs: run: shell: bash steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup Python uses: actions/setup-python@v4 @@ -46,11 +46,11 @@ jobs: if: | (runner.os != 'Windows') && (steps.cached-poetry-dependencies.outputs.cache-hit != 'true') - run: poetry install --no-interaction --no-root --with deeplearning + run: poetry install --no-interaction --no-root --extras deeplearning - name: Install library (Linux/OSX) if: ${{ runner.os != 'Windows' }} - run: poetry install --no-interaction --with deeplearning + run: poetry install --no-interaction --extras deeplearning - name: Install library (Windows) if: ${{ runner.os == 'Windows' }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e058c12e4..eeffc2f95 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,39 +8,90 @@ ci: autoupdate_branch: "develop" autoupdate_commit_msg: "[pre-commit.ci] pre-commit autoupdate" autoupdate_schedule: quarterly - skip: [] + skip: [ ] submodules: false +exclude: ".*svg" + repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.4.0 hooks: - id: check-yaml - id: check-json + - id: check-executables-have-shebangs + - id: check-toml + - id: check-docstring-first - id: check-added-large-files - id: end-of-file-fixer - id: trailing-whitespace - id: check-case-conflict - id: mixed-line-ending + - id: end-of-file-fixer + - id: check-case-conflict + - id: forbid-new-submodules + - id: pretty-format-json + args: [ "--autofix", "--no-sort-keys", "--indent=4" ] + - repo: https://github.com/psf/black - rev: 23.3.0 + rev: 23.9.1 hooks: - id: black + language_version: python3.8 + args: [ --line-length=90, --target-version=py38 ] + + - repo: https://github.com/asottile/blacken-docs + rev: 1.16.0 + hooks: + - id: blacken-docs + additional_dependencies: [black==23.3.0] + exclude: ^.github/ - repo: https://github.com/PyCQA/isort rev: 5.12.0 hooks: - id: isort - - repo: https://github.com/pycqa/flake8 - rev: 6.0.0 + - repo: https://github.com/PyCQA/flake8 + rev: 6.1.0 hooks: - id: flake8 - additional_dependencies: [flake8-bugbear] + additional_dependencies: [ + 'flake8-blind-except', + 'flake8-docstrings', + 'flake8-bugbear', + 'flake8-comprehensions', + 'flake8-docstrings', + 'flake8-implicit-str-concat', + 'pydocstyle>=5.0.0', + ] + exclude: ^docs/ | ^setup\.py$ | - - repo: https://github.com/pre-commit/mirrors-prettier - rev: v3.0.0-alpha.6 + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.0.292 hooks: - - id: prettier - args: [--print-width=90, --prose-wrap=always] + - id: ruff + args: [ --fix, --exit-non-zero-on-fix, --ignore, E501 ] + + - repo: https://github.com/codespell-project/codespell + rev: v2.2.6 + hooks: + - id: codespell + args: + - --ignore-words-list=additionals,alle,alot,bund,currenty,datas,farenheit,falsy,fo,haa,hass,iif,incomfort,ines,ist,nam,nd,pres,pullrequests,resset,rime,ser,serie,te,technik,ue,unsecure,withing,zar + - --skip="./.*,*.csv,*.json,*.ambr" + - --quiet-level=2 + exclude_types: [ csv, json, svg ] + exclude: ^tests/|generated/ + + - repo: https://github.com/adrienverge/yamllint.git + rev: v1.32.0 + hooks: + - id: yamllint + exclude: > + (?x)^( + .pre-commit-config.yaml*| + .github/workflows/.*| + + )$ diff --git a/CITATION.cff b/CITATION.cff new file mode 100644 index 000000000..a7ab5a153 --- /dev/null +++ b/CITATION.cff @@ -0,0 +1,73 @@ +cff-version: 1.2.0 +message: "If you use this software, please cite it as below." +authors: +- family-names: "Aristimunha" + given-names: "Bruno" + orcid: "https://orcid.org/0000-0001-5258-2995" +- family-names: "Carrara" + given-names: "Igor" + orcid: "https://orcid.org/0000-0002-2580-094X" +- family-names: "Guetschel" + given-names: "Pierre" + orcid: "https://orcid.org/0000-0002-8933-7640" +- family-names: "Sedlar" + given-names: "Sara" + orcid: "https://orcid.org/0000-0002-1492-0014" +- family-names: "Rodrigues" + given-names: "Pedro" + orcid: "https://orcid.org/0000-0003-3534-317X" +- family-names: "Sosulski" + given-names: "Jan" + orcid: "https://orcid.org/0000-0002-8105-3395" +- family-names: "Narayanan" + given-names: "Divyesh" +- family-names: "Bjareholt" + given-names: "Erik" + orcid: "https://orcid.org/0000-0003-1350-9677" +- family-names: "Quentin" + given-names: "Barthelemy" + orcid: "https://orcid.org/0000-0002-7059-6028" +- family-names: "Schirrmeister" + given-names: "Robin Tibor" + orcid: "https://orcid.org/0000-0002-5518-7445" +- family-names: "Kalunga" + given-names: "Emmanuel" + orcid: "https://orcid.org/0000-0001-7522-5253" +- family-names: "Darmet" + given-names: "Ludovic" + orcid: "https://orcid.org/0000-0001-5445-9763" +- family-names: "Gregoire" + given-names: "Cattan" + orcid: "https://orcid.org/0000-0002-7515-0690" +- family-names: "Abdul Hussain" + given-names: "Ali" + orcid: "https://orcid.org/0000-0002-9814-9107" +- family-names: "Gatti" + given-names: "Ramiro" + orcid: "https://orcid.org/0000-0001-7367-0791" +- family-names: "Goncharenko" + given-names: "Vladislav" + orcid: "https://orcid.org/0000-0002-9243-6914" +- family-names: "Thielen" + given-names: "Jordy" + orcid: "https://orcid.org/0000-0002-6264-0367" +- family-names: "Moreau" + given-names: "Thomas" + orcid: "https://orcid.org/0000-0002-1523-3419" +- family-names: "Roy" + given-names: "Yannick" + orcid: "https://orcid.org/0000-0003-4408-5221" +- family-names: "Jayaram" + given-names: "Vinay" + orcid: "https://orcid.org/0000-0002-8581-4921" +- family-names: "Barachant" + given-names: "Alexandre" + orcid: "https://orcid.org/0000-0001-8202-6287" +- family-names: "Chevallier" + given-names: "Sylvain" + orcid: "https://orcid.org/0000-0003-3027-8241" +title: "Mother of all BCI Benchmarks" +version: 1.0.0 +doi: 10.5281/zenodo.XXXXX +date-released: 2023-10-12 +url: "https://github.com/NeuroTechX/moabb" diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md old mode 100755 new mode 100644 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md old mode 100755 new mode 100644 index 4a4a00f41..85bf674cc --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -80,6 +80,27 @@ disable `poetry` environment creation. Also in this case be careful with version in your environment - it has to satisfy requirements stated in `pyproject.toml`. In case you disable `poetry` you are in charge of this. +_Note 3 (deep learning):_\ +In case you want to install the optional deep learning dependencies (i.e. `poetry install --with deeplearning`), +you will need to do the following additional steps if you want `tensorflow` to detect your +GPU: + +```bash +# Instructions for tensorflow==2.12 +conda install -c conda-forge cudatoolkit=11.8.0 +mkdir -p $CONDA_PREFIX/etc/conda/activate.d +echo 'CUDNN_PATH=$(dirname $(python -c "import nvidia.cudnn;print(nvidia.cudnn.__file__)"))' >> $CONDA_PREFIX/etc/conda/activate.d/env_vars.sh +echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CONDA_PREFIX/lib/:$CUDNN_PATH/lib' >> $CONDA_PREFIX/etc/conda/activate.d/env_vars.sh +source $CONDA_PREFIX/etc/conda/activate.d/env_vars.sh +# Verify install: +python3 -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))" +``` + +Then, at every use, re-run the command +`source $CONDA_PREFIX/etc/conda/activate.d/env_vars.sh` (you can simply add this line to +your `.bashrc`). For more details, please refer to +[the official documentation](https://www.tensorflow.org/install/pip). + ### Tools used MOABB uses [`poetry`](https://python-poetry.org/) for dependency management. This tool diff --git a/README.md b/README.md index 60f653b59..46b61873c 100644 --- a/README.md +++ b/README.md @@ -191,7 +191,7 @@ the wiki: https://github.com/NeuroTechX/moabb/wiki/Datasets-Support you can submit a new dataset by mentioning it to this [issue](https://github.com/NeuroTechX/moabb/issues/1). The datasets currently on our radar -can be seen [here] (https://github.com/NeuroTechX/moabb/wiki/Datasets-Support) +can be seen [here](https://github.com/NeuroTechX/moabb/wiki/Datasets-Support). ## Who are we? diff --git a/ROADMAP.md b/ROADMAP.md old mode 100755 new mode 100644 diff --git a/bash/meta_requirements.txt b/bash/meta_requirements.txt index c7fc75b44..5d3a5fb69 100644 --- a/bash/meta_requirements.txt +++ b/bash/meta_requirements.txt @@ -1,5 +1,5 @@ mne -#if you want used a specific branch instead of branch devolop +#if you want used a specific branch instead of branch develop #changing the branch name git+REPOSITORY_LINK@BRANCH#egg=MOABB git+https://github.com/NeuroTechX/moabb#egg=moabb gdown diff --git a/codecov.yml b/codecov.yml index 3ab9544d7..37ea93afd 100644 --- a/codecov.yml +++ b/codecov.yml @@ -7,6 +7,10 @@ coverage: patch: default: enabled: no + project: + default: + threshold: 3% + if_ci_failed: error codecov: notify: diff --git a/docs/source/CONTRIBUTING.md b/docs/source/CONTRIBUTING.md old mode 100755 new mode 100644 diff --git a/docs/source/README.md b/docs/source/README.md index b90af6b20..cd91d58c1 100644 --- a/docs/source/README.md +++ b/docs/source/README.md @@ -85,14 +85,18 @@ The project is currently maintained by: