From 2bd0e899f21f307718bc1e186903addfdb9494fd Mon Sep 17 00:00:00 2001 From: Stefan Appelhoff Date: Mon, 2 Sep 2024 22:15:31 +0200 Subject: [PATCH 1/5] minor: speed up test --- mne_bids/tests/test_dig.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/mne_bids/tests/test_dig.py b/mne_bids/tests/test_dig.py index f5b7168eb..adea8e29e 100644 --- a/mne_bids/tests/test_dig.py +++ b/mne_bids/tests/test_dig.py @@ -142,26 +142,30 @@ def test_dig_template(tmp_path): for datatype in ("eeg", "ieeg"): (bids_root / "sub-01" / "ses-01" / datatype).mkdir(parents=True) + raw = _load_raw() + raw.pick(["eeg"]) + montage = raw.get_montage() + pos = montage.get_positions() + for datatype in ("eeg", "ieeg"): bids_path = _bids_path.copy().update(root=bids_root, datatype=datatype) for coord_frame in BIDS_STANDARD_TEMPLATE_COORDINATE_SYSTEMS: - raw = _load_raw() - raw.pick(["eeg"]) bids_path.update(space=coord_frame) - montage = raw.get_montage() - pos = montage.get_positions() + raw.set_montage(None) + _montage = montage.copy() mne_coord_frame = BIDS_TO_MNE_FRAMES.get(coord_frame, None) if mne_coord_frame is None: - montage.apply_trans(mne.transforms.Transform("head", "unknown")) + _montage.apply_trans(mne.transforms.Transform("head", "unknown")) else: - montage.apply_trans(mne.transforms.Transform("head", mne_coord_frame)) - _write_dig_bids(bids_path, raw, montage, acpc_aligned=True) + _montage.apply_trans(mne.transforms.Transform("head", mne_coord_frame)) + _write_dig_bids(bids_path, raw, _montage, acpc_aligned=True) electrodes_path = bids_path.copy().update( task=None, run=None, suffix="electrodes", extension=".tsv" ) coordsystem_path = bids_path.copy().update( task=None, run=None, suffix="coordsystem", extension=".json" ) + # _read_dig_bids updates raw inplace if mne_coord_frame is None: with pytest.warns( RuntimeWarning, match="not an MNE-Python coordinate frame" @@ -172,8 +176,7 @@ def test_dig_template(tmp_path): electrodes_path.update(space="fsaverage") coordsystem_path.update(space="fsaverage") _read_dig_bids(electrodes_path, coordsystem_path, datatype, raw) - montage2 = raw.get_montage() - pos2 = montage2.get_positions() + pos2 = raw.get_montage().get_positions() np.testing.assert_array_almost_equal( np.array(list(pos["ch_pos"].values())), np.array(list(pos2["ch_pos"].values())), From 05bb95fa3073f8297554ba2618f1b991bdf89fce Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 2 Sep 2024 22:33:47 +0000 Subject: [PATCH 2/5] [pre-commit.ci] pre-commit autoupdate (#1304) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.6.2 → v0.6.3](https://github.com/astral-sh/ruff-pre-commit/compare/v0.6.2...v0.6.3) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 208ef8277..5a6e8fcad 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.6.2 + rev: v0.6.3 hooks: - id: ruff name: ruff mne_bids/ From 3c08d3136c211c905d0a952c22c1e4f45fffeedc Mon Sep 17 00:00:00 2001 From: Stefan Appelhoff Date: Thu, 19 Sep 2024 11:27:34 +0200 Subject: [PATCH 3/5] CI: add codecov token --- .github/workflows/unit_tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 14bd909db..e3bf55b19 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -278,6 +278,8 @@ jobs: uses: codecov/codecov-action@v4 with: files: ./coverage.xml + token: ${{ secrets.CODECOV_TOKEN }} + verbose: true build_docs: runs-on: ubuntu-latest From 184df3f073137e37fcfa72c696faebc67baaca85 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 20 Sep 2024 09:17:41 +0200 Subject: [PATCH 4/5] [pre-commit.ci] pre-commit autoupdate (#1305) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.6.3 → v0.6.5](https://github.com/astral-sh/ruff-pre-commit/compare/v0.6.3...v0.6.5) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5a6e8fcad..579b039da 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.6.3 + rev: v0.6.5 hooks: - id: ruff name: ruff mne_bids/ From 1cbcfddf3d97f9a6d21bda52ecbdb15394e34775 Mon Sep 17 00:00:00 2001 From: Stefan Appelhoff Date: Fri, 20 Sep 2024 13:00:05 +0200 Subject: [PATCH 5/5] pin bids-validator --- .github/workflows/unit_tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index e3bf55b19..d20c4f9cd 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -206,8 +206,9 @@ jobs: - name: Install BIDS validator (stable) if: matrix.bids-validator-version == 'validator-stable' + # XXX: Remove pin once this is solved: https://github.com/bids-standard/bids-validator/issues/2124 run: | - npm install -g bids-validator + npm install -g bids-validator@1.14.10 - name: Download BIDS validator (main) if: matrix.bids-validator-version == 'validator-main'