Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] Fix pytest warnings being raised on CI #169

Merged
merged 11 commits into from
Feb 5, 2024
2 changes: 1 addition & 1 deletion mne_icalabel/datasets/icalabel/icalabel.py
Original file line number Diff line number Diff line change
@@ -42,7 +42,7 @@ def data_path(
download : bool
If False and the dataset has not been downloaded yet,
it will not be downloaded and the path will be returned
as ‘’ (empty string). This is mostly used for debugging purposes
as ``‘’`` (empty string). This is mostly used for debugging purposes
and can be safely ignored by most users.
%(verbose)s

2 changes: 1 addition & 1 deletion mne_icalabel/datasets/icalabel/icalabel.pyi
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@ def data_path(
download : bool
If False and the dataset has not been downloaded yet,
it will not be downloaded and the path will be returned
as ‘’ (empty string). This is mostly used for debugging purposes
as ``‘’`` (empty string). This is mostly used for debugging purposes
and can be safely ignored by most users.

verbose : bool | str | int | None
8 changes: 4 additions & 4 deletions mne_icalabel/iclabel/tests/test_label_components.py
Original file line number Diff line number Diff line change
@@ -124,14 +124,14 @@ def test_warnings():
random_state=101,
)
ica.fit(raw)
with pytest.warns(RuntimeWarning, match="common average reference"):
with pytest.warns(RuntimeWarning, match="common average reference"), pytest.warns(
RuntimeWarning, match="not filtered between 1 and 100 Hz"
):
iclabel_label_components(raw, ica)
with pytest.warns(RuntimeWarning, match="not filtered between 1 and 100 Hz"):
iclabel_label_components(raw, ica)

with raw.info._unlock():
raw.info["lowpass"] = 100.0
raw.set_eeg_reference("average")

# infomax
ica = ICA(
n_components=3,
12 changes: 7 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -118,8 +118,8 @@ test = [
'pandas',
'pymatreader',
'PyQt6',
'pytest',
'pytest-cov',
'pytest>=8.0.0',
]
torch = [
'torch',
@@ -185,22 +185,24 @@ match-dir = '^mne_icalabel.*'
[tool.pytest.ini_options]
addopts = '--durations 20 --junit-xml=junit-results.xml -v --color=yes'
junit_family = 'xunit2'
minversion = '6.0'
minversion = '8.0'

[tool.ruff]
extend-exclude = [
'doc',
'setup.py',
]
ignore = []
line-length = 88
select = ["E", "F", "UP", "W"]
target-version = 'py39'

[tool.ruff.format]
docstring-code-format = true

[tool.ruff.per-file-ignores]
[tool.ruff.lint]
ignore = []
select = ["E", "F", "UP", "W"]

[tool.ruff.lint.per-file-ignores]
'*' = [
"UP007", # 'Use `X | Y` for type annotations', requires python 3.10
]
4 changes: 2 additions & 2 deletions tools/stubgen.py
Original file line number Diff line number Diff line change
@@ -63,5 +63,5 @@
isort.file(stub, config=config_isort)

# run ruff to improve stub style
exec = subprocess.run(["ruff", "format", str(directory), "--config", config])
sys.exit(exec.returncode)
execution = subprocess.run(["ruff", "format", str(directory), "--config", config])
sys.exit(execution.returncode)