Skip to content

BUG: Spectrum should only warn on zero spectrum for non-bads #12075

@larsoner

Description

@larsoner

CircleCI just hit this:

/home/circleci/project/tutorials/preprocessing/50_artifact_correction_ssp.py failed leaving traceback:
Traceback (most recent call last):
  File "/home/circleci/project/tutorials/preprocessing/50_artifact_correction_ssp.py", line 109, in <module>
    spectrum = empty_room_raw.compute_psd()
  File "<decorator-gen-292>", line 12, in compute_psd
  File "/home/circleci/project/mne/io/base.py", line 2181, in compute_psd
    return Spectrum(
  File "/home/circleci/project/mne/time_frequency/spectrum.py", line 1172, in __init__
    self._check_values()
  File "/home/circleci/project/mne/time_frequency/spectrum.py", line 454, in _check_values
    warn(f'Zero value in spectrum for channel{s} {", ".join(chs)}', UserWarning)
  File "/home/circleci/project/mne/utils/_logging.py", line 414, in warn
    warnings.warn_explicit(
UserWarning: Zero value in spectrum for channel MEG 2443

I am pretty sure this channel is marked as bad in the data. It seems like spectrum should perhaps not warn about zero or nan/inf values if a channel is bad.

If we go this route we can undo two verbose="error"s introduced in #12074

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions