From 8f347b7b07cc0404e0f1ef87e54d2293b619f504 Mon Sep 17 00:00:00 2001 From: Gordon Shotwell Date: Wed, 12 Jul 2023 16:30:45 -0300 Subject: [PATCH 1/2] Silence figure layout warning on matplotlib 3.7.2 --- examples/penguins/app.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/examples/penguins/app.py b/examples/penguins/app.py index e019a50cc..91aecd276 100644 --- a/examples/penguins/app.py +++ b/examples/penguins/app.py @@ -1,9 +1,11 @@ # TODO-future: Add filter of X varaible to reduce the data? (Here we would show "Gentoo" has count 0, rather than remove if no data exists) # TODO-future: Add brushing to zoom into the plot. The counts should represent the data in the zoomed area. (Single click would zoom out) +import warnings from pathlib import Path from typing import List +import matplotlib import pandas as pd import seaborn as sns import shinyswatch @@ -12,6 +14,13 @@ import shiny.experimental as x from shiny import App, Inputs, Outputs, Session, reactive, render, req, ui +# There is a matplotlib bug which causes pyright failures +# see https://github.com/rstudio/py-shiny/issues/611#issuecomment-1632866419 +if matplotlib.__version__ == "3.7.2": + warnings.filterwarnings( + "ignore", category=UserWarning, message="The figure layout has changed to tight" + ) + sns.set_theme() www_dir = Path(__file__).parent.resolve() / "www" From fafff4bccf954d9113770457270125e8569d2715 Mon Sep 17 00:00:00 2001 From: Gordon Shotwell Date: Thu, 13 Jul 2023 09:05:05 -0300 Subject: [PATCH 2/2] Make comment more correct --- examples/penguins/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/penguins/app.py b/examples/penguins/app.py index 91aecd276..863aee746 100644 --- a/examples/penguins/app.py +++ b/examples/penguins/app.py @@ -14,7 +14,7 @@ import shiny.experimental as x from shiny import App, Inputs, Outputs, Session, reactive, render, req, ui -# There is a matplotlib bug which causes pyright failures +# There is a matplotlib bug which causes CI failures # see https://github.com/rstudio/py-shiny/issues/611#issuecomment-1632866419 if matplotlib.__version__ == "3.7.2": warnings.filterwarnings(