summaryrefslogtreecommitdiff
path: root/gnu/packages/patches/python-seaborn-kde-test.patch
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/patches/python-seaborn-kde-test.patch')
-rw-r--r--gnu/packages/patches/python-seaborn-kde-test.patch36
1 files changed, 36 insertions, 0 deletions
diff --git a/gnu/packages/patches/python-seaborn-kde-test.patch b/gnu/packages/patches/python-seaborn-kde-test.patch
new file mode 100644
index 00000000000..f300dffc6ff
--- /dev/null
+++ b/gnu/packages/patches/python-seaborn-kde-test.patch
@@ -0,0 +1,36 @@
1This patch is an excerpt of this upstream commit:
2
3 commit 0a24478a550132f1882e5be5f5dbc0fc446a8a6c
4 Author: Michael Waskom <mwaskom@users.noreply.github.com>
5 Date: Mon Dec 21 18:44:58 2020 -0500
6
7 Raise minimal supported Python to 3.7 and bump requirements (#2396)
8
9It fixes the failure of 'test_weights'.
10
11--- a/seaborn/tests/test_distributions.py
12+++ b/seaborn/tests/test_distributions.py
13@@ -709,21 +708,17 @@ class TestKDEPlotUnivariate:
14 integral = integrate.trapz(ydata, np.log10(xdata))
15 assert integral == pytest.approx(1)
16
17- @pytest.mark.skipif(
18- LooseVersion(scipy.__version__) < "1.2.0",
19- reason="Weights require scipy >= 1.2.0"
20- )
21 def test_weights(self):
22
23 x = [1, 2]
24 weights = [2, 1]
25
26- ax = kdeplot(x=x, weights=weights)
27+ ax = kdeplot(x=x, weights=weights, bw_method=.1)
28
29 xdata, ydata = ax.lines[0].get_xydata().T
30
31- y1 = ydata[np.argwhere(np.abs(xdata - 1).min())]
32- y2 = ydata[np.argwhere(np.abs(xdata - 2).min())]
33+ y1 = ydata[np.abs(xdata - 1).argmin()]
34+ y2 = ydata[np.abs(xdata - 2).argmin()]
35
36 assert y1 == pytest.approx(2 * y2)