Skip to content

Commit

Permalink
fix eeglab export rawarray filenames (#10927)
Browse files Browse the repository at this point in the history
* fix eeglab export rawarray filenames

* fix flake8 doc style

* append changes to latest.inc names.inc

* fix typo latest.inc

* fix typo 2

* fix reference to public function

* remove try-except use condition

* empty line names.inc

Co-authored-by: RezaNasri <rezanasri@outlook.com>
  • Loading branch information
rznas and rznas authored Jul 15, 2022
1 parent e09482b commit b733f72
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions doc/changes/latest.inc
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ Enhancements

Bugs
~~~~
- Fix bug in :func:`mne.export.export_raw` to ignore None value in filenames attribute of :class:`mne.io.RawArray` (:gh:`10927` by :newcontrib:`Reza Nasri`)

- Fix bug in :func:`mne.io.read_raw_edf` to allow reading in all Hypnodyne ZMax EDFs to be read in without issues (:gh:`10754` by :newcontrib:`Frederik Weber`)

- Fix bug in :func:`mne.Epochs.drop_bad` where data was loaded although no rejection had to be performed (:gh:`10718` by :newcontrib:`Lukas Gemein`)
Expand Down
2 changes: 2 additions & 0 deletions doc/changes/names.inc
Original file line number Diff line number Diff line change
Expand Up @@ -459,3 +459,5 @@
.. _Frederik Weber: https://github.com/Frederik-D-Weber
.. _Mingjian He: https://github.com/mh105
.. _Reza Nasri: https://github.com/0reza
3 changes: 2 additions & 1 deletion mne/export/_eeglab.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ def _export_raw(fname, raw):

# remove extra epoc and STI channels
drop_chs = ['epoc']
if not (raw.filenames[0].endswith('.fif')):
# filenames attribute of RawArray is filled with None
if raw.filenames[0] and not (raw.filenames[0].endswith('.fif')):
drop_chs.append('STI 014')

ch_names = [ch for ch in raw.ch_names if ch not in drop_chs]
Expand Down

0 comments on commit b733f72

Please sign in to comment.