Potential bug with complex128 being loaded as float64 in mne.read_epochs when preload=False

External Email - Use Caution

Dear MNE-developers

I may have found a bug 0.20.0 (only version I tested)

When epochs with complex128 data in it is saved, it gets correctly
loaded as complex when preload=True in mne.read_epochs, but when
subsequently loading it when preload=False, it wrongly is loaded as float64

See the attached reproduction script: (let me know if I should raise it
as an issue)

All the best

Lau

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200403/83afb11a/attachment-0001.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ampjadnjegjilfoi.png
Type: image/png
Size: 147090 bytes
Desc: not available
Url : http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200403/83afb11a/attachment-0001.png
-------------- next part --------------
A non-text attachment was scrubbed...
Name: preload_false_complex_issue.py
Type: text/x-python
Size: 1702 bytes
Desc: not available
Url : http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200403/83afb11a/attachment-0001.py

External Email - Use Caution

This indeed looks like a bug. Can you see if this PR fixes your issue?

Eric

        External Email - Use Caution

Dear MNE-developers

I may have found a bug 0.20.0 (only version I tested)

When epochs with complex128 data in it is saved, it gets correctly loaded
as complex when preload=True in mne.read_epochs, but when subsequently
loading it when preload=False, it wrongly is loaded as float64

See the attached reproduction script: (let me know if I should raise it as
an issue)

All the best

Lau

_______________________________________________
Mne_analysis mailing list
Mne_analysis at nmr.mgh.harvard.edu
Mne_analysis Info Page

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200403/901980c0/attachment-0001.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ampjadnjegjilfoi.png
Type: image/png
Size: 147090 bytes
Desc: not available
Url : http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200403/901980c0/attachment-0001.png

External Email - Use Caution

Thanks, Eric - it indeed solved my issue

All the best

Lau

???External Email - Use Caution

This indeed looks like a bug. Can you see if this PR fixes your issue?

MRG, FIX: Fix read_epochs w/complex data, preload=False by larsoner · Pull Request #7560 · mne-tools/mne-python · GitHub

Eric

    ???External Email - Use Caution

    Dear MNE-developers

    I may have found a bug 0.20.0 (only version I tested)

    When epochs with complex128 data in it is saved, it gets correctly
    loaded as complex when preload=True in mne.read_epochs, but when
    subsequently loading it when preload=False, it wrongly is loaded
    as float64

    See the attached reproduction script: (let me know if I should
    raise it as an issue)

    All the best

    Lau

    _______________________________________________
    Mne_analysis mailing list
    Mne_analysis at nmr.mgh.harvard.edu
    <mailto:Mne_analysis at nmr.mgh.harvard.edu>
    Mne_analysis Info Page

_______________________________________________
Mne_analysis mailing list
Mne_analysis at nmr.mgh.harvard.edu
Mne_analysis Info Page

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200406/f8a3a759/attachment-0001.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ampjadnjegjilfoi.png
Type: image/png
Size: 147090 bytes
Desc: not available
Url : http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200406/f8a3a759/attachment-0001.png