File: 1029251_ignore_rounding_error.patch

package info (click to toggle)
pandas 2.2.3%2Bdfsg-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 66,784 kB
  • sloc: python: 422,228; ansic: 9,190; sh: 270; xml: 102; makefile: 83
file content (39 lines) | stat: -rw-r--r-- 1,472 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
Description: Don't fail plot tests on rounding error

(upstream seem to have _disabled_ the affected tests
...see also test_series)

Author: Rebecca N. Palmer <rebecca_palmer@zoho.com>
Bug-Debian: https://bugs.debian.org/1029251
Forwarded: no

--- a/pandas/tests/plotting/frame/test_frame_subplots.py
+++ b/pandas/tests/plotting/frame/test_frame_subplots.py
@@ -3,6 +3,7 @@
 import string
 
 import numpy as np
+from numpy.testing import assert_array_almost_equal_nulp
 import pytest
 
 from pandas.compat import is_platform_linux
@@ -435,7 +436,7 @@ class TestDataFramePlotsSubplots:
         # no subplots
         df = DataFrame({"A": [3] * 5, "B": list(range(1, 6))}, index=range(5))
         ax = df.plot.bar(grid=True, log=True)
-        tm.assert_numpy_array_equal(ax.yaxis.get_ticklocs(), expected)
+        assert_array_almost_equal_nulp(ax.yaxis.get_ticklocs(), expected, 4)
 
     @pytest.mark.xfail(
         np_version_gte1p24 and is_platform_linux(),
@@ -449,8 +450,8 @@ class TestDataFramePlotsSubplots:
             log=True, subplots=True
         )
 
-        tm.assert_numpy_array_equal(ax[0].yaxis.get_ticklocs(), expected)
-        tm.assert_numpy_array_equal(ax[1].yaxis.get_ticklocs(), expected)
+        assert_array_almost_equal_nulp(ax[0].yaxis.get_ticklocs(), expected, 4)
+        assert_array_almost_equal_nulp(ax[1].yaxis.get_ticklocs(), expected, 4)
 
     def test_boxplot_subplots_return_type_default(self, hist_df):
         df = hist_df