]
-# be strict about warnings in our examples, we should write clean code
-# (exceptions permitted for pedagogical purposes below)
-warnings.resetwarnings()
-warnings.filterwarnings('error')
-# allow these and show them
-warnings.filterwarnings('default', module='sphinx') # internal warnings
-# global weird ones that can be safely ignored
-for key in (
- r"'U' mode is deprecated", # sphinx io
- r"OpenSSL\.rand is deprecated", # OpenSSL package in linkcheck
- r"Using or importing the ABCs from", # 3.5 importlib._bootstrap
- r"'contextfunction' is renamed to 'pass_context'", # Jinja
- ):
- warnings.filterwarnings( # deal with other modules having bad imports
- 'ignore', message=".*" + key, category=DeprecationWarning)
-warnings.filterwarnings( # matplotlib<->pyparsing issue
- 'ignore', message="Exception creating Regex for oneOf.*",
- category=SyntaxWarning)
-# warnings in examples (mostly) that we allow
-# TODO: eventually these should be eliminated!
-for key in (
- 'invalid escape sequence', # numpydoc 0.8 has some bad escape chars
- 'The integral is probably divergent', # stats.mielke example
- 'underflow encountered in square', # signal.filtfilt underflow
- 'underflow encountered in multiply', # scipy.spatial.HalfspaceIntersection
- 'underflow encountered in nextafter', # tuterial/interpolate.rst
- # stats.skewnorm, stats.norminvgauss, stats.gaussian_kde,
- # tutorial/stats.rst (twice):
- 'underflow encountered in exp',
- ):
- warnings.filterwarnings(
- 'once', message='.*' + key)
-
# -----------------------------------------------------------------------------
# HTML output
# -----------------------------------------------------------------------------