Skip to content

Commit

Permalink
Maint fixes (#164)
Browse files Browse the repository at this point in the history
* FIX: workaround for torch FutureWarning

- MNE-ICALabel causes triggers a warning by Pytorch
- I submitted a fix to icalabel, but...
- in the meantime let's filter the warning in our tests. Which can be removed once mne-icalabe v0.7 is released

* FIX: catch warning that is rightfully thrown by pipeline

- since we are downsampling our test file that has a non-integer sfreq, a warning is thrown and that's okay. If it isn't thrown in the future this test will fail to notify us

* FIX: don't manually install packages in CI's. rely on requirements files

* FIX: Skip failing test_TopoViz for now.

- We have marked this test for failure for a while now, and the failing test causes our CI's to hang for a long time (over ten minutes sometimes). I am makring for skip so that our CI's aren't dramatically slowed down, until we fix it.

* FIX: flake

* FIX: more torch warning fixes

* FIX: try another variation of glob in FutureWarning

* FIX: try again...

* MAINT: update GHA

* FIX: try to ignore the warning globally
  • Loading branch information
scott-huberty authored Jul 25, 2024
1 parent 46c7afb commit 34ad17b
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 9 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/test_pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ jobs:
test:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: Install Pylossless & Deps
Expand All @@ -23,10 +23,6 @@ jobs:
run: pip install -r requirements_testing.txt
- name: Install QC depedencies
run: pip install -r requirements_qc.txt
- name: install openneuro
run: pip install openneuro-py
- name: install pytorch
run: pip install torch
- name: Test Pipeline
run: |
coverage run -m pytest
Expand Down
3 changes: 3 additions & 0 deletions pylossless/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
import pytest


# XXX: This is a temporary fix to suppress a warning from MNE-ICAlabel
# This can be removed once MNE-ICAlabel 0.7 is released
@pytest.mark.filterwarnings("ignore::FutureWarning")
@pytest.fixture(scope="session")
def pipeline_fixture():
"""Return a namedTuple containing MNE eyetracking raw data and events."""
Expand Down
2 changes: 1 addition & 1 deletion pylossless/dash/tests/test_topo_viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def test_GridTopoPlot():

# chromedriver: https://chromedriver.storage.googleapis.com/
# index.html?path=114.0.5735.90/
@pytest.mark.xfail(reason="an issue with chromedriver causes failure. Need to debug.")
@pytest.mark.skip(reason="an issue with chromedriver causes failure. Need to debug.")
def test_TopoViz(dash_duo):
"""Test TopoViz."""
raw, ica = get_raw_ica()
Expand Down
2 changes: 2 additions & 0 deletions pylossless/tests/test_rejection.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import pylossless as ll


# XXX: This filter can be removed once MNE-ICAlabel 0.7 is released
@pytest.mark.filterwarnings("ignore::FutureWarning")
@pytest.mark.parametrize("clean_ch_mode", [None, "drop", "interpolate"])
def test_rejection_policy(clean_ch_mode, pipeline_fixture):
"""Test the rejection policy."""
Expand Down
3 changes: 2 additions & 1 deletion pylossless/tests/test_simulated.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
@pytest.mark.parametrize("pipeline", [(pipeline)])
def test_simulated_raw(pipeline):
"""Test pipeline on simulated EEG."""
pipeline._check_sfreq()
with pytest.warns(RuntimeWarning, match="sampling frequency"):
pipeline._check_sfreq()
# This file should have been downsampled
assert pipeline.raw.info["sfreq"] == 600
# FIND NOISY EPOCHS
Expand Down
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,6 @@ filterwarnings = ["error",
# deprecation in dash-testing that needs to be reported
"ignore::DeprecationWarning",
# TODO MNE deprecation that wont effect us. remove if we ever bump to mne 1.7
"ignore:The current default of copy=False will change to copy=True in 1.7.",]
"ignore:The current default of copy=False will change to copy=True in 1.7.",
"ignore:You are using",
]

0 comments on commit 34ad17b

Please sign in to comment.