Skip to content

Commit

Permalink
build(deps): updated dependencies, bumped minimum Python version to 3…
Browse files Browse the repository at this point in the history
….7 (#242)

* build(deps): updated dependencies, bumped minimum Python version to 3.7

* ci: moved linting to seperate job

* build(deps): moved coverage back as a non-dev dep

* ci: fixed lint job (by setting up Python properly)

* ci: bumped Python version used to build docs to Python 3.9

* docs: finished goal of dropping Python 3.6 and supporting 3.7 to 3.9

* fix: fixed lint issues where exception chaining wasn't explicit

* fix: fixed failing test (due to update to sklearn 1.0)

* docs: note about dropping Python 3.6 support in whats_new
  • Loading branch information
ErikBjare authored Oct 11, 2021
1 parent aa4274f commit ab75186
Show file tree
Hide file tree
Showing 10 changed files with 319 additions and 321 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
fail-fast: true
matrix:
os: [ubuntu-18.04]
python-version: ["3.6"]
python-version: ["3.9"]

steps:
- uses: actions/checkout@v2
Expand Down
22 changes: 19 additions & 3 deletions .github/workflows/test-devel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
fail-fast: true
matrix:
os: [ubuntu-18.04, windows-latest, macOS-latest]
python-version: ["3.6"]
python-version: ["3.7"]
defaults:
run:
shell: bash
Expand All @@ -26,8 +26,6 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- uses: pre-commit/[email protected]

- name: Install Poetry
uses: snok/[email protected]
with:
Expand Down Expand Up @@ -70,3 +68,21 @@ jobs:
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.7"]
steps:
- uses: actions/checkout@v2

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

- uses: pre-commit/[email protected]
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
fail-fast: true
matrix:
os: [ubuntu-18.04, windows-latest, macOS-latest]
python-version: ["3.6", "3.7", "3.8", "3.9"]
python-version: ["3.7", "3.8", "3.9"]
defaults:
run:
shell: bash
Expand Down
1 change: 0 additions & 1 deletion ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ are reported in the

- Backend features for dev: pre-commit using black, isort and prettier, with an updating
CONTRIBUTING section.
- Droping requirement for Python 3.6, support for Python 3.7 and 3.8
- Including support for more datasets
- Add more classification pipelines

Expand Down
3 changes: 2 additions & 1 deletion docs/source/whats_new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ Bugs
API changes
~~~~~~~~~~~

- None
- Minimum supported Python version is now 3.7
- We now use scikit-learn >= 1.0


Version - 0.4.3 (Stable - PyPi)
Expand Down
2 changes: 1 addition & 1 deletion moabb/analysis/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def to_list(res):
f"Additional columns: {self.additional_columns} "
f"were specified in the evaluation, but results"
f" contain only these keys: {d.keys()}."
)
) from None
dset["data"][-1, :] = np.asarray(
[d["score"], d["time"], d["n_samples"], *add_cols]
)
Expand Down
2 changes: 1 addition & 1 deletion moabb/datasets/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def __init__(
try:
_ = iter(subjects)
except TypeError:
raise (ValueError("subjects must be a iterable, like a list"))
raise ValueError("subjects must be a iterable, like a list") from None

self.subject_list = subjects
self.n_sessions = sessions_per_subject
Expand Down
5 changes: 3 additions & 2 deletions moabb/evaluations/evaluations.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ def evaluate(self, dataset, pipelines):
cvclf.fit(X[train], y[train])
score = scorer(cvclf, X[test], y[test])
else:
score = _fit_and_score(
result = _fit_and_score(
clone(clf),
X,
y,
Expand All @@ -338,7 +338,8 @@ def evaluate(self, dataset, pipelines):
parameters=None,
fit_params=None,
error_score=self.error_score,
)[0]
)
score = result["test_scores"]
duration = time() - t_start
nchan = X.info["nchan"] if isinstance(X, BaseEpochs) else X.shape[1]
res = {
Expand Down
Loading

0 comments on commit ab75186

Please sign in to comment.