Skip to content

Commit

Permalink
minor: speed up test
Browse files Browse the repository at this point in the history
  • Loading branch information
sappelhoff committed Sep 2, 2024
1 parent 780bad2 commit ac688f5
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions mne_bids/tests/test_dig.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,20 +142,22 @@ 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()

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()
_montage = montage.copy()
pos = _montage.get_positions()
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"
)
Expand Down

0 comments on commit ac688f5

Please sign in to comment.