mne.utils.warn#

mne.utils.warn(message, category=<class 'RuntimeWarning'>, module='mne', ignore_namespaces=('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.

Parameters:
messagestr

Warning message.

categoryinstance of Warning

The warning class. Defaults to RuntimeWarning.

modulestr

The name of the module emitting the warning.

ignore_namespaceslist of str

Namespaces to ignore when traversing the stack.

New in version 0.24.