Skip to content

Commit

Permalink
Catch deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jnothman committed Dec 28, 2023
1 parent e373f39 commit 83f268d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions upsetplot/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from matplotlib import pyplot as plt
from matplotlib import colors
from matplotlib import patches
import warnings

from .reformat import query, _get_subset_mask
from . import util
Expand Down Expand Up @@ -655,13 +656,15 @@ def make_grid(self, fig=None):
)
window_extent_args = {}
if RENDERER_IMPORTED:
window_extent_args["renderer"] = get_renderer(fig)
with warnings.catch_warnings(DeprecationWarning):
window_extent_args["renderer"] = get_renderer(fig)
textw = t.get_window_extent(**window_extent_args).width
t.remove()

window_extent_args = {}
if RENDERER_IMPORTED:
window_extent_args["renderer"] = get_renderer(fig)
with warnings.catch_warnings(DeprecationWarning):
window_extent_args["renderer"] = get_renderer(fig)
figw = self._reorient(fig.get_window_extent(**window_extent_args)).width

sizes = np.asarray([p["elements"] for p in self._subset_plots])
Expand Down

0 comments on commit 83f268d

Please sign in to comment.