Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-seaborn for openSUSE:Factory checked in at 2023-09-20 13:25:23 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-seaborn (Old) and /work/SRC/openSUSE:Factory/.python-seaborn.new.16627 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-seaborn" Wed Sep 20 13:25:23 2023 rev:21 rq:1111747 version:0.12.2 Changes: -------- --- /work/SRC/openSUSE:Factory/python-seaborn/python-seaborn.changes 2023-08-14 22:36:06.484549030 +0200 +++ /work/SRC/openSUSE:Factory/.python-seaborn.new.16627/python-seaborn.changes 2023-09-20 13:27:02.634033147 +0200 @@ -1,0 +2,5 @@ +Thu Sep 14 12:40:47 UTC 2023 - Markéta Machová <[email protected]> + +- Add inf_as_na.patch to fix tests again, this time with pandas + +------------------------------------------------------------------- New: ---- inf_as_na.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-seaborn.spec ++++++ --- /var/tmp/diff_new_pack.lvBAzB/_old 2023-09-20 13:27:03.726072269 +0200 +++ /var/tmp/diff_new_pack.lvBAzB/_new 2023-09-20 13:27:03.726072269 +0200 @@ -28,22 +28,20 @@ Patch0: numpy-1.25.patch # PATCH-FIX-UPSTREAM statsmodels-0.14.patch gh#mwaskom/seaborn#3356 Patch1: statsmodels-0.14.patch +# PATCH-FIX-UPSTREAM inf_as_na.patch gh#mwaskom/seaborn#3424 +Patch2: inf_as_na.patch BuildRequires: %{python_module base >= 3.7} BuildRequires: %{python_module flit-core >= 3.2} BuildRequires: %{python_module matplotlib >= 3.1} BuildRequires: %{python_module numpy-devel >= 1.17} BuildRequires: %{python_module pandas >= 0.25} BuildRequires: %{python_module pip} -BuildRequires: %{python_module typing-extensions if %python-base < 3.8} BuildRequires: fdupes BuildRequires: python-rpm-macros BuildConflicts: python-buildservice-tweak Requires: python-matplotlib >= 3.1 Requires: python-numpy >= 1.17 Requires: python-pandas >= 0.25 -%if %{python_version_nodots} < 38 -Requires: python-typing-extensions -%endif Recommends: python-fastcluster Recommends: python-scipy >= 1.3 Recommends: python-statsmodels >= 0.10 ++++++ inf_as_na.patch ++++++ >From 23860365816440b050e9211e1c395a966de3c403 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <[email protected]> Date: Sat, 19 Aug 2023 03:41:57 -1000 Subject: [PATCH] Address inf_as_na pandas deprecation (#3424) * Address inf_as_na pandas deprecation * Add -np.inf, add import * flake8 * Make copy * Use mask instead of replace --- seaborn/_base.py | 14 +++++++------- seaborn/_core/plot.py | 34 +++++++++++++++++++--------------- 2 files changed, 26 insertions(+), 22 deletions(-) Index: seaborn-0.12.2/seaborn/_oldcore.py =================================================================== --- seaborn-0.12.2.orig/seaborn/_oldcore.py +++ seaborn-0.12.2/seaborn/_oldcore.py @@ -1116,13 +1116,13 @@ class VectorPlotter: parts = [] grouped = self.plot_data[var].groupby(self.converters[var], sort=False) for converter, orig in grouped: - with pd.option_context('mode.use_inf_as_na', True): - orig = orig.dropna() - if var in self.var_levels: - # TODO this should happen in some centralized location - # it is similar to GH2419, but more complicated because - # supporting `order` in categorical plots is tricky - orig = orig[orig.isin(self.var_levels[var])] + orig = orig.mask(orig.isin([np.inf, -np.inf]), np.nan) + orig = orig.dropna() + if var in self.var_levels: + # TODO this should happen in some centralized location + # it is similar to GH2419, but more complicated because + # supporting `order` in categorical plots is tricky + orig = orig[orig.isin(self.var_levels[var])] comp = pd.to_numeric(converter.convert_units(orig)) if converter.get_scale() == "log": comp = np.log10(comp) Index: seaborn-0.12.2/seaborn/_core/plot.py =================================================================== --- seaborn-0.12.2.orig/seaborn/_core/plot.py +++ seaborn-0.12.2/seaborn/_core/plot.py @@ -20,6 +20,7 @@ import matplotlib as mpl from matplotlib.axes import Axes from matplotlib.artist import Artist from matplotlib.figure import Figure +import numpy as np from seaborn._marks.base import Mark from seaborn._stats.base import Stat @@ -1488,21 +1489,24 @@ class Plotter: axes_df = self._filter_subplot_data(df, view) - with pd.option_context("mode.use_inf_as_na", True): - if keep_na: - # The simpler thing to do would be x.dropna().reindex(x.index). - # But that doesn't work with the way that the subset iteration - # is written below, which assumes data for grouping vars. - # Matplotlib (usually?) masks nan data, so this should "work". - # Downstream code can also drop these rows, at some speed cost. - present = axes_df.notna().all(axis=1) - nulled = {} - for axis in "xy": - if axis in axes_df: - nulled[axis] = axes_df[axis].where(present) - axes_df = axes_df.assign(**nulled) - else: - axes_df = axes_df.dropna() + axes_df_inf_as_nan = axes_df.copy() + axes_df_inf_as_nan = axes_df_inf_as_nan.mask( + axes_df_inf_as_nan.isin([np.inf, -np.inf]), np.nan + ) + if keep_na: + # The simpler thing to do would be x.dropna().reindex(x.index). + # But that doesn't work with the way that the subset iteration + # is written below, which assumes data for grouping vars. + # Matplotlib (usually?) masks nan data, so this should "work". + # Downstream code can also drop these rows, at some speed cost. + present = axes_df_inf_as_nan.notna().all(axis=1) + nulled = {} + for axis in "xy": + if axis in axes_df: + nulled[axis] = axes_df[axis].where(present) + axes_df = axes_df_inf_as_nan.assign(**nulled) + else: + axes_df = axes_df_inf_as_nan.dropna() subplot_keys = {} for dim in ["col", "row"]:
