From 85735d752ee69ff7b7197685cb76cd0ca2370164 Mon Sep 17 00:00:00 2001 From: mcepl <> Date: Feb 18 2024 19:32:08 +0000 Subject: Update python-seaborn to version 0.13.2 / rev 22 via SR 1147191 https://build.opensuse.org/request/show/1147191 by user mcepl + anag+factory --- diff --git a/.files b/.files index 6ece1fc..2e3a6cb 100644 Binary files a/.files and b/.files differ diff --git a/.rev b/.rev index 016a49b..2c5f61b 100644 --- a/.rev +++ b/.rev @@ -201,4 +201,12 @@ 1111747 + + 06d3d3d302b5838c92790a2a198ec399 + 0.13.2 + + anag+factory + + 1147191 + diff --git a/inf_as_na.patch b/inf_as_na.patch deleted file mode 100644 index d488baa..0000000 --- a/inf_as_na.patch +++ /dev/null @@ -1,96 +0,0 @@ -From 23860365816440b050e9211e1c395a966de3c403 Mon Sep 17 00:00:00 2001 -From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> -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"]: diff --git a/numpy-1.25.patch b/numpy-1.25.patch deleted file mode 100644 index 02a759a..0000000 --- a/numpy-1.25.patch +++ /dev/null @@ -1,69 +0,0 @@ -Index: seaborn-0.12.2/seaborn/_core/rules.py -=================================================================== ---- seaborn-0.12.2.orig/seaborn/_core/rules.py -+++ seaborn-0.12.2/seaborn/_core/rules.py -@@ -96,7 +96,7 @@ def variable_type( - boolean_dtypes = ["bool", "boolean"] - boolean_vector = vector.dtype in boolean_dtypes - else: -- boolean_vector = bool(np.isin(vector, [0, 1, np.nan]).all()) -+ boolean_vector = bool(np.isin(vector.dropna(), [0, 1]).all()) - if boolean_vector: - return VarType(boolean_type) - -Index: seaborn-0.12.2/seaborn/_oldcore.py -=================================================================== ---- seaborn-0.12.2.orig/seaborn/_oldcore.py -+++ seaborn-0.12.2/seaborn/_oldcore.py -@@ -1493,9 +1493,10 @@ def variable_type(vector, boolean_type=" - var_type : 'numeric', 'categorical', or 'datetime' - Name identifying the type of data in the vector. - """ -+ vector = pd.Series(vector) - - # If a categorical dtype is set, infer categorical -- if pd.api.types.is_categorical_dtype(vector): -+ if isinstance(vector.dtype, pd.CategoricalDtype): - return VariableType("categorical") - - # Special-case all-na data, which is always "numeric" -@@ -1514,7 +1515,7 @@ def variable_type(vector, boolean_type=" - warnings.simplefilter( - action='ignore', category=(FutureWarning, DeprecationWarning) - ) -- if np.isin(vector, [0, 1, np.nan]).all(): -+ if np.isin(vector.dropna(), [0, 1]).all(): - return VariableType(boolean_type) - - # Defer to positive pandas tests -Index: seaborn-0.12.2/tests/_core/test_rules.py -=================================================================== ---- seaborn-0.12.2.orig/tests/_core/test_rules.py -+++ seaborn-0.12.2/tests/_core/test_rules.py -@@ -29,8 +29,6 @@ def test_variable_type(): - assert variable_type(s) == "numeric" - assert variable_type(s.astype(int)) == "numeric" - assert variable_type(s.astype(object)) == "numeric" -- assert variable_type(s.to_numpy()) == "numeric" -- assert variable_type(s.to_list()) == "numeric" - - s = pd.Series([1, 2, 3, np.nan], dtype=object) - assert variable_type(s) == "numeric" -@@ -44,8 +42,6 @@ def test_variable_type(): - - s = pd.Series(["1", "2", "3"]) - assert variable_type(s) == "categorical" -- assert variable_type(s.to_numpy()) == "categorical" -- assert variable_type(s.to_list()) == "categorical" - - s = pd.Series([True, False, False]) - assert variable_type(s) == "numeric" -@@ -64,8 +60,6 @@ def test_variable_type(): - s = pd.Series([pd.Timestamp(1), pd.Timestamp(2)]) - assert variable_type(s) == "datetime" - assert variable_type(s.astype(object)) == "datetime" -- assert variable_type(s.to_numpy()) == "datetime" -- assert variable_type(s.to_list()) == "datetime" - - - def test_categorical_order(): diff --git a/python-seaborn.changes b/python-seaborn.changes index 5bf01f1..1856c4d 100644 --- a/python-seaborn.changes +++ b/python-seaborn.changes @@ -1,4 +1,50 @@ ------------------------------------------------------------------- +Fri Feb 16 19:45:28 UTC 2024 - Ben Greiner + +- Update to 0.13.2 + * This is a minor release containing internal changes that adapt + to upcoming deprecations in pandas. +- Release 0.13.1 + * This is a minor release with some bug fixes and a couple new + features. + * Added support for weighted mean estimation (with boostrap CIs) + in lineplot, barplot, pointplot, and objects.Est (#3580, + #3586). + * Added the extent option in objects.Plot.layout (#3552). + * Fixed a regression in v0.13.0 that triggered an exception when + working with non-numpy data types (#3516). + * Fixed a bug in objects.Plot so that tick labels are shown for + wrapped axes that aren't in the bottom-most row (#3600). + * Fixed a bug in catplot where a blank legend would be added when + hue was redundantly assigned (#3540). + * Fixed a bug in catplot where the edgecolor parameter was + ignored with kind="bar" (#3547). + * Fixed a bug in boxplot where an exception was raised when using + the matplotlib bootstrap option (#3562). + * Fixed a bug in lineplot where an exception was raised when hue + was assigned with an empty dataframe (#3569). + * Fixed a bug in multiple categorical plots that raised with + hue=None and dodge=True; this is now has no effect (#3605). +- Release 0.13.0 + * This is a major release with a number of important new features + and changes. The highlight is a major overhaul to seaborn's + categorical plotting functions, providing them with many new + capabilities and better aligning their API with the rest of the + library. There is also provisional support for alternate + dataframe libraries like polars, a new theme and display + configuration system for objects.Plot, and many smaller + bugfixes and enhancements. + * Major enhancements to categorical plots + * Support for alternate dataframe libraries + * Improved configuration for the objects interface + * For a complete description see + https://seaborn.pydata.org/whatsnew/v0.13.0.html +- Drop obsolete patches + * inf_as_na.patch + * numpy-1.25.patch + * statsmodels-0.14.patch + +------------------------------------------------------------------- Thu Sep 14 12:40:47 UTC 2023 - Markéta Machová - Add inf_as_na.patch to fix tests again, this time with pandas diff --git a/python-seaborn.spec b/python-seaborn.spec index a75dd52..bab9d24 100644 --- a/python-seaborn.spec +++ b/python-seaborn.spec @@ -1,7 +1,7 @@ # # spec file for package python-seaborn # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,40 +17,34 @@ Name: python-seaborn -Version: 0.12.2 +Version: 0.13.2 Release: 0 Summary: Statistical data visualization for python License: BSD-2-Clause AND BSD-3-Clause AND MIT Group: Development/Languages/Python URL: https://github.com/mwaskom/seaborn Source: https://files.pythonhosted.org/packages/source/s/seaborn/seaborn-%{version}.tar.gz -# PATCH-FIX-UPSTREAM numpy-1.25.patch gh#mwaskom/seaborn#3391 -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 base >= 3.8} 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 matplotlib >= 3.6.2} +BuildRequires: %{python_module numpy-devel >= 1.20} +BuildRequires: %{python_module pandas >= 1.2} BuildRequires: %{python_module pip} 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 +Requires: python-matplotlib >= 3.6.2 +Requires: python-numpy >= 1.20 +Requires: python-pandas >= 1.2 Recommends: python-fastcluster -Recommends: python-scipy >= 1.3 -Recommends: python-statsmodels >= 0.10 +Recommends: python-scipy >= 1.7 +Recommends: python-statsmodels >= 0.12 # SECTION tests with extras BuildRequires: %{python_module fastcluster} BuildRequires: %{python_module pytest-xdist} BuildRequires: %{python_module pytest} -BuildRequires: %{python_module scipy >= 1.3} -BuildRequires: %{python_module statsmodels >= 0.10} +BuildRequires: %{python_module scipy >= 1.7} +BuildRequires: %{python_module statsmodels >= 0.12} # /SECTION BuildArch: noarch %python_subpackages @@ -91,14 +85,17 @@ sed -i '1{/env python/d}' seaborn/external/appdirs.py %python_expand %fdupes %{buildroot}%{$python_sitelib} %check +donttest="testeverythingexcept" # This fails in i586 because of int size -donttest="test_index_alignment_between_series" +if [ $(getconf LONG_BIT) -eq 32 ]; then + donttest="$donttest or test_index_alignment_between_series" +fi %pytest -n auto -rfEs -k "not ($donttest)" %files %{python_files} %license LICENSE.md licences/* %doc README.md %{python_sitelib}/seaborn -%{python_sitelib}/seaborn-%{version}*-info +%{python_sitelib}/seaborn-%{version}.dist-info %changelog diff --git a/seaborn-0.12.2.tar.gz b/seaborn-0.12.2.tar.gz deleted file mode 120000 index e2473bd..0000000 --- a/seaborn-0.12.2.tar.gz +++ /dev/null @@ -1 +0,0 @@ -/ipfs/bafybeicg3rk2t4jwyqcnnnpfwss5ncwvqpyydaorytklxrlkqxzki7e5nu \ No newline at end of file diff --git a/seaborn-0.13.2.tar.gz b/seaborn-0.13.2.tar.gz new file mode 120000 index 0000000..4ed613b --- /dev/null +++ b/seaborn-0.13.2.tar.gz @@ -0,0 +1 @@ +/ipfs/bafybeifpscnrndj3gegpsvwxfkdubgktibkzpatpozujsskxnnxzoogom4 \ No newline at end of file diff --git a/statsmodels-0.14.patch b/statsmodels-0.14.patch deleted file mode 100644 index 3daf821..0000000 --- a/statsmodels-0.14.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff --git a/seaborn/regression.py b/seaborn/regression.py -index 1c7d804e26..f012b8dc61 100644 ---- a/seaborn/regression.py -+++ b/seaborn/regression.py -@@ -264,14 +264,20 @@ def reg_func(_x, _y): - - def fit_statsmodels(self, grid, model, **kwargs): - """More general regression function using statsmodels objects.""" -- import statsmodels.genmod.generalized_linear_model as glm -+ import statsmodels.tools.sm_exceptions as sme - X, y = np.c_[np.ones(len(self.x)), self.x], self.y - grid = np.c_[np.ones(len(grid)), grid] - - def reg_func(_x, _y): -+ err_classes = (sme.PerfectSeparationError,) - try: -- yhat = model(_y, _x, **kwargs).fit().predict(grid) -- except glm.PerfectSeparationError: -+ with warnings.catch_warnings(): -+ if hasattr(sme, "PerfectSeparationWarning"): -+ # statsmodels>=0.14.0 -+ warnings.simplefilter("error", sme.PerfectSeparationWarning) -+ err_classes = (*err_classes, sme.PerfectSeparationWarning) -+ yhat = model(_y, _x, **kwargs).fit().predict(grid) -+ except err_classes: - yhat = np.empty(len(grid)) - yhat.fill(np.nan) - return yhat