Warning module of the psyplot python module.

This module controls the warning behaviour of the module via the python builtin warnings module and introduces three new warning classes:

..autosummay:

PsPylotRuntimeWarning
PsyPlotWarning
PsyPlotCritical

Exceptions:

PsyPlotCritical

Critical UserWarning for psyplot module

PsyPlotRuntimeWarning

Runtime warning that appears only ones

PsyPlotWarning

Normal UserWarning for psyplot module

Functions:

critical(message[, category, logger])

wrapper around the warnings.warn function for critical warnings.

customwarn(message, category, filename, ...)

Use the psyplot.warning logger for categories being out of PsyPlotWarning and PsyPlotCritical and the default warnings.showwarning function for all the others.

disable_warnings([critical])

Function that disables all warnings and all critical warnings (if critical evaluates to True) related to the psyplot Module.

warn(message[, category, logger])

wrapper around the warnings.warn function for non-critical warnings.

exception psyplot.warning.PsyPlotCritical[source]

Bases: UserWarning

Critical UserWarning for psyplot module

exception psyplot.warning.PsyPlotRuntimeWarning[source]

Bases: RuntimeWarning

Runtime warning that appears only ones

exception psyplot.warning.PsyPlotWarning[source]

Bases: UserWarning

Normal UserWarning for psyplot module

psyplot.warning.critical(message, category=<class 'psyplot.warning.PsyPlotCritical'>, logger=None)[source]

wrapper around the warnings.warn function for critical warnings. logger may be a logging.Logger instance

psyplot.warning.customwarn(message, category, filename, lineno, *args, **kwargs)[source]

Use the psyplot.warning logger for categories being out of PsyPlotWarning and PsyPlotCritical and the default warnings.showwarning function for all the others.

psyplot.warning.disable_warnings(critical=False)[source]

Function that disables all warnings and all critical warnings (if critical evaluates to True) related to the psyplot Module. Please note that you can also configure the warnings via the psyplot.warning logger (logging.getLogger(psyplot.warning)).

psyplot.warning.warn(message, category=<class 'psyplot.warning.PsyPlotWarning'>, logger=None)[source]

wrapper around the warnings.warn function for non-critical warnings. logger may be a logging.Logger instance