From 2f6b1deb4492133a69d6b560cea8e615697ff398 Mon Sep 17 00:00:00 2001 From: cvanelteren Date: Thu, 5 Feb 2026 19:38:21 +1000 Subject: [PATCH 1/5] Surpress warnings on docs --- docs/conf.py | 22 ++++++++++++++++++++++ ultraplot/config.py | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) diff --git a/docs/conf.py b/docs/conf.py index 1a465806e..6adbb6c4b 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -87,9 +87,31 @@ def __getattr__(self, name): message=r"The rc setting 'colorbar.rasterize' was deprecated.*", category=UltraPlotWarning, ) + warnings.filterwarnings( + "ignore", + message=r"Failed to compute UltraLayout:.*Falling back to default grid layout\.", + category=UltraPlotWarning, + ) + warnings.filterwarnings( + "ignore", + message=r"Tick label sharing not implemented for .* subplots\.", + category=UltraPlotWarning, + ) + warnings.filterwarnings( + "ignore", + message=r"Tick label sharing not implemented for mixed subplot types\.", + category=UltraPlotWarning, + ) except Exception: pass +# Suppress font glyph warnings from matplotlib during docs builds. +warnings.filterwarnings( + "ignore", + message=r"Glyph \d+ \(\\N\{PRIME\}\) missing from font\(s\).*", + category=UserWarning, +) + # Print available system fonts from matplotlib.font_manager import fontManager from sphinx_gallery.sorting import ExplicitOrder, FileNameSortKey diff --git a/ultraplot/config.py b/ultraplot/config.py index 4ac429af7..e6d665561 100644 --- a/ultraplot/config.py +++ b/ultraplot/config.py @@ -15,6 +15,7 @@ import os import re import sys +import warnings as pywarnings from collections import namedtuple from collections.abc import MutableMapping from numbers import Real @@ -45,6 +46,37 @@ # when when substituting dummy unavailable glyph due to fallback disabled. logging.getLogger("matplotlib.mathtext").setLevel(logging.ERROR) +# Suppress noisy warnings that regularly surface in interactive contexts. +pywarnings.filterwarnings( + "ignore", + category=warnings.UltraPlotWarning, +) +pywarnings.filterwarnings( + "ignore", + message=r"Tick label sharing not implemented for .* subplots\.", + category=warnings.UltraPlotWarning, +) +pywarnings.filterwarnings( + "ignore", + message=r"Tick label sharing not implemented for mixed subplot types\.", + category=warnings.UltraPlotWarning, +) +pywarnings.filterwarnings( + "ignore", + message=r"Failed to compute UltraLayout:.*Falling back to default grid layout\.", + category=warnings.UltraPlotWarning, +) +pywarnings.filterwarnings( + "ignore", + message=r"Glyph \d+ \(\\N\{PRIME\}\) missing from font\(s\).*", + category=UserWarning, +) +pywarnings.filterwarnings( + "ignore", + message=r"backend='basemap' will be deprecated in next major release.*", + category=warnings.UltraPlotWarning, +) + __all__ = [ "Configurator", "rc", From a0b8287fdfc040cbd827629c7b41fb5a07d6b302 Mon Sep 17 00:00:00 2001 From: cvanelteren Date: Thu, 5 Feb 2026 19:42:30 +1000 Subject: [PATCH 2/5] Remove debug --- ultraplot/config.py | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/ultraplot/config.py b/ultraplot/config.py index e6d665561..0bf76df87 100644 --- a/ultraplot/config.py +++ b/ultraplot/config.py @@ -15,7 +15,6 @@ import os import re import sys -import warnings as pywarnings from collections import namedtuple from collections.abc import MutableMapping from numbers import Real @@ -46,36 +45,6 @@ # when when substituting dummy unavailable glyph due to fallback disabled. logging.getLogger("matplotlib.mathtext").setLevel(logging.ERROR) -# Suppress noisy warnings that regularly surface in interactive contexts. -pywarnings.filterwarnings( - "ignore", - category=warnings.UltraPlotWarning, -) -pywarnings.filterwarnings( - "ignore", - message=r"Tick label sharing not implemented for .* subplots\.", - category=warnings.UltraPlotWarning, -) -pywarnings.filterwarnings( - "ignore", - message=r"Tick label sharing not implemented for mixed subplot types\.", - category=warnings.UltraPlotWarning, -) -pywarnings.filterwarnings( - "ignore", - message=r"Failed to compute UltraLayout:.*Falling back to default grid layout\.", - category=warnings.UltraPlotWarning, -) -pywarnings.filterwarnings( - "ignore", - message=r"Glyph \d+ \(\\N\{PRIME\}\) missing from font\(s\).*", - category=UserWarning, -) -pywarnings.filterwarnings( - "ignore", - message=r"backend='basemap' will be deprecated in next major release.*", - category=warnings.UltraPlotWarning, -) __all__ = [ "Configurator", From c754b9dd58aebef7a7e590689e1dfea3eb2aaa94 Mon Sep 17 00:00:00 2001 From: cvanelteren Date: Fri, 6 Feb 2026 03:59:03 +1000 Subject: [PATCH 3/5] Suppress warnings in docs builds --- docs/conf.py | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 6adbb6c4b..5eda1e8af 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -84,22 +84,6 @@ def __getattr__(self, name): warnings.filterwarnings( "ignore", - message=r"The rc setting 'colorbar.rasterize' was deprecated.*", - category=UltraPlotWarning, - ) - warnings.filterwarnings( - "ignore", - message=r"Failed to compute UltraLayout:.*Falling back to default grid layout\.", - category=UltraPlotWarning, - ) - warnings.filterwarnings( - "ignore", - message=r"Tick label sharing not implemented for .* subplots\.", - category=UltraPlotWarning, - ) - warnings.filterwarnings( - "ignore", - message=r"Tick label sharing not implemented for mixed subplot types\.", category=UltraPlotWarning, ) except Exception: @@ -125,6 +109,17 @@ def _reset_ultraplot(gallery_conf, fname): import ultraplot as uplt except Exception: return + try: + from ultraplot.internals.warnings import UltraPlotWarning + + warnings.filterwarnings("ignore", category=UltraPlotWarning) + except Exception: + pass + warnings.filterwarnings( + "ignore", + message=r"Glyph 8242 .* missing from font\(s\)\.", + category=UserWarning, + ) uplt.rc.reset() @@ -371,6 +366,9 @@ def _reset_ultraplot(gallery_conf, fname): nbsphinx_execute = "auto" +# Suppress warnings in nbsphinx kernels without injecting visible cells. +os.environ.setdefault("PYTHONWARNINGS", "ignore::UserWarning") + # Sphinx gallery configuration sphinx_gallery_conf = { "doc_module": ("ultraplot",), From de5e66e5dd2e3706cae1679570149254f41218f0 Mon Sep 17 00:00:00 2001 From: cvanelteren Date: Fri, 6 Feb 2026 04:19:38 +1000 Subject: [PATCH 4/5] Clean up handling --- docs/conf.py | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 5eda1e8af..52f603568 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -89,12 +89,6 @@ def __getattr__(self, name): except Exception: pass -# Suppress font glyph warnings from matplotlib during docs builds. -warnings.filterwarnings( - "ignore", - message=r"Glyph \d+ \(\\N\{PRIME\}\) missing from font\(s\).*", - category=UserWarning, -) # Print available system fonts from matplotlib.font_manager import fontManager @@ -109,17 +103,6 @@ def _reset_ultraplot(gallery_conf, fname): import ultraplot as uplt except Exception: return - try: - from ultraplot.internals.warnings import UltraPlotWarning - - warnings.filterwarnings("ignore", category=UltraPlotWarning) - except Exception: - pass - warnings.filterwarnings( - "ignore", - message=r"Glyph 8242 .* missing from font\(s\)\.", - category=UserWarning, - ) uplt.rc.reset() From b8eee81afc07f43b60559f5da21a4024576da492 Mon Sep 17 00:00:00 2001 From: cvanelteren Date: Fri, 6 Feb 2026 04:26:14 +1000 Subject: [PATCH 5/5] Clean up handling --- ultraplot/config.py | 1 - 1 file changed, 1 deletion(-) diff --git a/ultraplot/config.py b/ultraplot/config.py index 0bf76df87..4ac429af7 100644 --- a/ultraplot/config.py +++ b/ultraplot/config.py @@ -45,7 +45,6 @@ # when when substituting dummy unavailable glyph due to fallback disabled. logging.getLogger("matplotlib.mathtext").setLevel(logging.ERROR) - __all__ = [ "Configurator", "rc",