Skip to content

Commit 975078e

Browse files
Fix bug issue #175
1 parent b3a481b commit 975078e

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

pylossless/bids.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def convert_recording_to_bids(
7878
write_kwargs["allow_preload"] = True
7979

8080
write_raw_bids(
81-
raw, bids_path=bids_path, events_data=events, event_id=event_id, **write_kwargs
81+
raw, bids_path=bids_path, events=events, event_id=event_id, **write_kwargs
8282
)
8383

8484
return bids_path

pylossless/tests/test_bids.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import pylossless as ll
2+
import mne
3+
import numpy as np
4+
import pytest
5+
6+
7+
@pytest.mark.filterwarnings("ignore:Converting data files to EDF format")
8+
def test_find_breaks():
9+
"""Make sure MNE's annotate_break function can run."""
10+
def edf_import_fct(path_in):
11+
# read in a file
12+
raw = mne.io.read_raw_edf(path_in, preload=True)
13+
print(raw.annotations)
14+
return raw, np.array([[0, 0, 0]]), {"test": 0, "T0": 1, "T1": 2, "T2": 3}
15+
16+
testing_path = mne.datasets.testing.data_path()
17+
fname = testing_path / "EDF" / "test_edf_overlapping_annotations.edf"
18+
import_args = [{"path_in": fname}]
19+
bids_path_args = [{'subject': '001', 'run': '01', 'session': '01',
20+
"task": "test"}]
21+
bids_paths = ll.bids.convert_dataset_to_bids(edf_import_fct, import_args,
22+
bids_path_args, overwrite=True)
23+
24+
print(bids_paths)
25+

0 commit comments

Comments
 (0)