mne.utils.warn(message, category=<class 'RuntimeWarning'>, module='mne')[source]

Emit a warning with trace outside the mne namespace.

This function takes arguments like warnings.warn, and sends messages using both warnings.warn and logger.warn. Warnings can be generated deep within nested function calls. In order to provide a more helpful warning, this function traverses the stack until it reaches a frame outside the mne namespace that caused the error.


Warning message.

categoryinstance of Warning

The warning class. Defaults to RuntimeWarning.


The name of the module emitting the warning.

Examples using mne.utils.warn