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

bugfixes in Stieger2021 #651

Merged
merged 3 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/source/whats_new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ Enhancements
Bugs
~~~~

- Fix Stieger2021 dataset bugs (:gh:`651` by `Martin Wimpff`_)

API changes
~~~~~~~~~~~

Expand Down
13 changes: 9 additions & 4 deletions moabb/datasets/stieger2021.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,9 @@ def _get_single_subject_data(self, subject):
and (container.TrialData[i].triallength + 2) > self.interval[1]
):
# this should be the cue time-point
if container.time[i][2 * srate] == 0:
raise ValueError("This should be the cue time-point,")
assert (
container.time[i][2 * srate] == 0
), "This should be the cue time-point"
stim[2 * srate] = y
X_flat.append(x)
stim_flat.append(stim[None, :])
Expand Down Expand Up @@ -263,7 +264,11 @@ def _get_single_subject_data(self, subject):
badchanidxs = []

for idx in badchanidxs:
used_channels = ch_names if self.channels is None else self.channels
used_channels = (
ch_names
if (not hasattr(self, "channels") or self.channels is None)
else self.channels
)
if eeg_ch_names[idx - 1] in used_channels:
raw.info["bads"].append(eeg_ch_names[idx - 1])

Expand All @@ -276,5 +281,5 @@ def _get_single_subject_data(self, subject):
bad_info=raw.info["bads"],
)

subject_data[session] = {"run_0": raw}
subject_data[str(session)] = {"0": raw}
return subject_data
Loading