Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#562)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Eric Larson <[email protected]>
  • Loading branch information
pre-commit-ci[bot] and larsoner authored Jul 2, 2024
1 parent add2fb9 commit 9772d25
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
repos:
# Ruff mne
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.10
rev: v0.5.0
hooks:
- id: ruff
args: ["--fix"]
Expand Down
4 changes: 2 additions & 2 deletions mne_nirs/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import mne
import pytest
from mne.datasets import testing

# most of this adapted from MNE-Python

Expand Down Expand Up @@ -131,9 +130,10 @@ def options_3d():


@pytest.fixture
@testing.requires_testing_data
def requires_pyvista(options_3d):
"""Require pyvista."""
if not mne.datasets.has_dataset("testing"):
pytest.skip("Requires mne-testing-data")
pyvista = pytest.importorskip("pyvista")
pytest.importorskip("pyvistaqt")
pyvista.close_all()
Expand Down
8 changes: 6 additions & 2 deletions mne_nirs/simulation/tests/test_simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@


def test_simulate_NIRS_single_channel():
np.random.seed(0) # TODO: Add random_state and refactor
raw = simulate_nirs_raw(
sfreq=3.0,
amplitude=1.0,
Expand All @@ -20,8 +21,10 @@ def test_simulate_NIRS_single_channel():
)
assert "hbo" in raw
assert raw.info["sfreq"] == 3.0
assert raw.get_data().shape == (1, 900)
assert np.max(raw.get_data()) < 1.2 * 1.0e-6
data = raw.get_data()
assert data.shape == (1, 900)
max_val = np.max(data)
assert max_val < 1.4e-6
assert raw.annotations.description[0] == "A"
assert raw.annotations.duration[0] == 5
assert np.min(np.diff(raw.annotations.onset)) > 15.0 + 5.0
Expand All @@ -39,6 +42,7 @@ def test_simulate_NIRS_single_channel():


def test_simulate_NIRS_multi_channel():
np.random.seed(0) # TODO: Add random_state and refactor
raw = simulate_nirs_raw(
sfreq=3.0,
amplitude=[0.0, 2.0, 4.0],
Expand Down

0 comments on commit 9772d25

Please sign in to comment.