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-08-14 22:35:53 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-seaborn (Old) and /work/SRC/openSUSE:Factory/.python-seaborn.new.11712 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-seaborn" Mon Aug 14 22:35:53 2023 rev:20 rq:1103842 version:0.12.2 Changes: -------- --- /work/SRC/openSUSE:Factory/python-seaborn/python-seaborn.changes 2023-01-12 22:45:00.677106787 +0100 +++ /work/SRC/openSUSE:Factory/.python-seaborn.new.11712/python-seaborn.changes 2023-08-14 22:36:06.484549030 +0200 @@ -1,0 +2,11 @@ +Tue Aug 8 10:53:03 UTC 2023 - Daniel Garcia <[email protected]> + +- Skip broken tests in i586 + +------------------------------------------------------------------- +Tue Aug 8 10:32:06 UTC 2023 - Daniel Garcia <[email protected]> + +- Add numpy-1.25.patch gh#mwaskom/seaborn#3391 +- Add statsmodels-0.14.patch gh#mwaskom/seaborn#3356 + +------------------------------------------------------------------- New: ---- numpy-1.25.patch statsmodels-0.14.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-seaborn.spec ++++++ --- /var/tmp/diff_new_pack.RqdIZZ/_old 2023-08-14 22:36:07.192553533 +0200 +++ /var/tmp/diff_new_pack.RqdIZZ/_new 2023-08-14 22:36:07.200553583 +0200 @@ -24,6 +24,10 @@ 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 BuildRequires: %{python_module base >= 3.7} BuildRequires: %{python_module flit-core >= 3.2} BuildRequires: %{python_module matplotlib >= 3.1} @@ -89,7 +93,9 @@ %python_expand %fdupes %{buildroot}%{$python_sitelib} %check -%pytest -n auto -rfEs +# This fails in i586 because of int size +donttest="test_index_alignment_between_series" +%pytest -n auto -rfEs -k "not ($donttest)" %files %{python_files} %license LICENSE.md licences/* ++++++ numpy-1.25.patch ++++++ 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(): ++++++ statsmodels-0.14.patch ++++++ 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
