Skip to content

Commit

Permalink
Update deps and doc cleaning (#315)
Browse files Browse the repository at this point in the history
* update poetry deps and start cleaning docs

* update example with new seaborn version

* rename page

* update code link button in doc

* update docs for datasets

* correct error with np type, add warning for the dataset

* reduce computation time for documentation

* fix plot issue

* update doc workflow

* fix download path location

* switch to pre-commit.ci

* correct spelling

* fix pre commit config

* switch to python 3.8 and latest ubuntu

* add coverage requirements

* correct typo

* update actions

* try xml report for codecov, add coveralls

* remove coveralls
  • Loading branch information
sylvchev committed Dec 31, 2022
1 parent 978ad05 commit 6b41ad1
Show file tree
Hide file tree
Showing 25 changed files with 636 additions and 1,302 deletions.
1 change: 0 additions & 1 deletion .coveragerc
@@ -1,7 +1,6 @@
[run]
branch = True
source = moabb
include = */moabb/*
omit =
*/docs/*
*/pipelines/*
Expand Down
26 changes: 13 additions & 13 deletions .github/workflows/docs.yml
Expand Up @@ -14,30 +14,30 @@ jobs:
strategy:
fail-fast: true
matrix:
os: [ubuntu-18.04]
os: [ubuntu-latest]
python-version: ["3.9"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Create local data folder
run: |
mkdir ~/mne_data
- name: Setup Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install Poetry
uses: snok/install-poetry@v1.1.6
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true

- name: Cache datasets and docs
id: cached-dataset-docs
uses: actions/cache@v2
uses: actions/cache@v3
with:
key: doc-${{ github.head_ref }}-${{ hashFiles('moabb/datasets/**') }}
path: |
Expand Down Expand Up @@ -68,26 +68,26 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-18.04]
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Create local data folder
run: |
mkdir ~/mne_data
- name: Cache datasets and docs
id: cached-dataset-docs
uses: actions/cache@v2
uses: actions/cache@v3
with:
key: doc-${{ github.head_ref }}-${{ hashFiles('moabb/datasets/**') }}
path: |
~/mne_data
docs/build
- name: Checkout moabb.github.io
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: "NeuroTechX/moabb.github.io"
path: moabb-ghio
Expand All @@ -111,26 +111,26 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-18.04]
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Create local data folder
run: |
mkdir ~/mne_data
- name: Cache datasets and docs
id: cached-dataset-docs
uses: actions/cache@v2
uses: actions/cache@v3
with:
key: doc-${{ github.head_ref }}-${{ hashFiles('moabb/datasets/**') }}
path: |
~/mne_data
docs/build
- name: Checkout gh pages
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: gh-pages
path: moabb-ghpages
Expand Down
34 changes: 9 additions & 25 deletions .github/workflows/test-devel.yml
Expand Up @@ -13,16 +13,16 @@ jobs:
strategy:
fail-fast: true
matrix:
os: [ubuntu-18.04, windows-latest, macOS-latest]
python-version: ["3.7"]
os: [ubuntu-latest, windows-latest, macOS-latest]
python-version: ["3.8"]
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

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

Expand All @@ -35,7 +35,7 @@ jobs:
- name: Load cached venv
if: runner.os != 'Windows'
id: cached-poetry-dependencies
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: .venv
key:
Expand All @@ -55,34 +55,18 @@ jobs:
run: |
source $VENV
poetry run coverage run -m unittest moabb.tests
poetry run coverage xml
- name: Run pipelines
run: |
source $VENV
poetry run python -m moabb.run --pipelines=./moabb/tests/test_pipelines/ --verbose
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v3
if: success()
with:
verbose: true
directory: /home/runner/work/moabb/moabb
files: ./.coverage

lint:
name: lint ${{ matrix.os }}, py-${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-18.04]
python-version: ["3.8"]
steps:
- uses: actions/checkout@v2

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

- uses: pre-commit/action@v3.0.0
files: ./.coverage,coverage.xml
env_vars: OS,PYTHON
18 changes: 10 additions & 8 deletions .github/workflows/test.yml
Expand Up @@ -13,16 +13,16 @@ jobs:
strategy:
fail-fast: true
matrix:
os: [ubuntu-18.04, windows-latest, macOS-latest]
python-version: ["3.7", "3.8", "3.9"]
os: [ubuntu-latest, windows-latest, macOS-latest]
python-version: ["3.8", "3.9"]
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

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

Expand All @@ -35,7 +35,7 @@ jobs:
- name: Load cached venv
if: runner.os != 'Windows'
id: cached-poetry-dependencies
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: .venv
key:
Expand All @@ -54,17 +54,19 @@ jobs:
- name: Run tests
run: |
source $VENV
poetry run python -m unittest moabb.tests
poetry run coverage run -m unittest moabb.tests
poetry run coverage xml
- name: Run pipelines
run: |
source $VENV
poetry run python -m moabb.run --pipelines=./moabb/tests/test_pipelines/ --verbose
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v3
if: success()
with:
verbose: true
directory: /home/runner/work/moabb/moabb
files: ./.coverage
files: ./.coverage,coverage.xml
env_vars: OS,PYTHON
13 changes: 12 additions & 1 deletion .pre-commit-config.yaml
@@ -1,5 +1,16 @@
default_language_version:
python: python3

ci:
autofix_commit_msg: |
[pre-commit.ci] auto fixes from pre-commit.com hooks
autofix_prs: true
autoupdate_branch: "develop"
autoupdate_commit_msg: "[pre-commit.ci] pre-commit autoupdate"
autoupdate_schedule: quarterly
skip: []
submodules: false

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
Expand All @@ -22,7 +33,7 @@ repos:
hooks:
- id: isort

- repo: https://gitlab.com/pycqa/flake8
- repo: https://github.com/pycqa/flake8
rev: 3.8.4
hooks:
- id: flake8
Expand Down
2 changes: 1 addition & 1 deletion docs/source/README.md
Expand Up @@ -5,7 +5,7 @@
![banner](images/M.png)

<p align=center>
n Build a comprehensive benchmark of popular Brain-Computer Interface (BCI) algorithms applied on an extensive list of freely available EEG datasets.
Build a comprehensive benchmark of popular Brain-Computer Interface (BCI) algorithms applied on an extensive list of freely available EEG datasets.
</p>

## Disclaimer
Expand Down
40 changes: 19 additions & 21 deletions docs/source/conf.py
Expand Up @@ -36,7 +36,7 @@
# -- Project information -----------------------------------------------------

project = "moabb"
copyright = "2018-2021, Alexandre Barachant, Sylvain Chevallier"
copyright = "2018-2023 MOABB contributors"
author = "Alexandre Barachant, Vinay Jayaram, Sylvain Chevallier"

# The short X.Y version
Expand Down Expand Up @@ -69,35 +69,40 @@
"sphinx.ext.napoleon",
"sphinx.ext.linkcode",
"sphinx.ext.mathjax",
"sphinx.ext.viewcode",
# "sphinx.ext.viewcode",
"sphinx_gallery.gen_gallery",
"gh_substitutions",
# "m2r2",
"m2r2",
"numpydoc",
]


def linkcode_resolve(domain, info): # noqa: C901
"""Determine the URL corresponding to a Python object.
Parameters
----------
domain : str
Only useful when 'py'.
info : dict
With keys "module" and "fullname".
Returns
-------
url : str
The code URL.
Notes
-----
This has been adapted to deal with our "verbose" decorator.
Adapted from SciPy (doc/source/conf.py).
"""
import mne
repo = "https://github.com/NeuroTechX/moabb"

if domain != "py":
return None
if not info["module"]:
return None

modname = info["module"]
fullname = info["fullname"]
Expand All @@ -112,9 +117,6 @@ def linkcode_resolve(domain, info): # noqa: C901
obj = getattr(obj, part)
except Exception:
return None
# deal with our decorators properly
while hasattr(obj, "__wrapped__"):
obj = obj.__wrapped__

try:
fn = inspect.getsourcefile(obj)
Expand All @@ -127,7 +129,7 @@ def linkcode_resolve(domain, info): # noqa: C901
fn = None
if not fn:
return None
fn = op.relpath(fn, start=op.dirname(mne.__file__))
fn = op.relpath(fn, start=op.dirname(moabb.__file__))
fn = "/".join(op.normpath(fn).split(os.sep)) # in case on Windows

try:
Expand All @@ -140,15 +142,11 @@ def linkcode_resolve(domain, info): # noqa: C901
else:
linespec = ""

if "dev" in moabb.__version__:
kind = "master"
else:
kind = "maint/%s" % (".".join(mne.__version__.split(".")[:2]))
return "http://github.com/NeuroTechX/moabb/blob/%s/moabb/%s%s" % ( # noqa
kind,
fn,
linespec,
)
# if "dev" in moabb.__version__:
# kind = "develop"
# else:
# kind = "master"
return f"{repo}/blob/develop/moabb/{fn}{linespec}"


napoleon_google_docstring = False
Expand Down Expand Up @@ -194,7 +192,7 @@ def linkcode_resolve(domain, info): # noqa: C901
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
language = "en"

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
Expand Down Expand Up @@ -222,9 +220,9 @@ def linkcode_resolve(domain, info): # noqa: C901
# theme further.
html_theme_options = {
# Navigation bar title. (Default: ``project`` value)
# 'navbar_title': "Demo",
"navbar_title": "MOABB",
# Tab name for entire site. (Default: "Site")
# 'navbar_site_name': "Site",
"navbar_site_name": "MOABB",
# A list of tuples containing pages or urls to link to.
# Valid tuples should be in the following forms:
# (name, page) # a link to a page
Expand Down Expand Up @@ -347,7 +345,7 @@ def linkcode_resolve(domain, info): # noqa: C901
"moabb Documentation",
author,
"moabb",
"One line description of project.",
"Mother of all BCI benchmarks.",
"Miscellaneous",
),
]
Expand Down
2 changes: 1 addition & 1 deletion docs/source/datasets.rst
Expand Up @@ -40,7 +40,7 @@ ERP Datasets
:toctree: generated/
:template: class.rst

bi2012a
bi2012
bi2013a
bi2014a
bi2014b
Expand Down

0 comments on commit 6b41ad1

Please sign in to comment.