Closed
Description
In Debian we are seeing a test failure with PlotPy 2.4.0 on aarch64: https://bugs.debian.org/1075814
____________________ ContourTest.test_contour_level_diag_0 _____________________
self = <plotpy.tests.unit.test_contour.ContourTest testMethod=test_contour_level_diag_0>
def test_contour_level_diag_0(self):
"""Test that contour() returns opened lines (diagonal) when level is 0.0"""
lines = compute_contours(self.Z, 0.0, self.X, self.Y)
> assert len(lines) == 1
E assert 4 == 1
E + where 4 = len([<plotpy.items.contour.ContourLine object at 0xffffa7c0e4d0>, <plotpy.items.contour.ContourLine object at 0xffffa7c0cb...lotpy.items.contour.ContourLine object at 0xffffa7c0c0d0>, <plotpy.items.contour.ContourLine object at 0xffffa7c0d0d0>])
plotpy/tests/unit/test_contour.py:42: AssertionError
So lines
is supposed to have only one element, but on aarch64 it has 4. I have inspected the contents of lines[0]
and lines[1]
hoping this could help find out what is going on. These are all the contents of lines[0]
:
[[ 2.9 -1.9 ]
[ 2.9125 -1.9125]
[ 2.925 -1.925 ]
[ 2.925 -1.925 ]
[ 2.9375 -1.9375]
[ 2.95 -1.95 ]
[ 2.95 -1.95 ]
[ 2.9625 -1.9625]
[ 2.975 -1.975 ]
[ 2.9625 -1.9625]]
And the first few elements of lines[1]
look like this:
[[-6.25000000e-02 1.06250000e+00]
[-5.00000000e-02 1.05000000e+00]
[-5.00000000e-02 1.05000000e+00]
[-3.75000000e-02 1.03750000e+00]
[-2.50000000e-02 1.02500000e+00]
[-2.50000000e-02 1.02500000e+00]
[...]
For reference, on a x86_64 system the first few elements of lines[0]
are:
[[-9.75000000e-01 1.97500000e+00]
[-9.62500000e-01 1.96250000e+00]
[-9.50000000e-01 1.95000000e+00]
[-9.50000000e-01 1.95000000e+00]
[-9.37500000e-01 1.93750000e+00]
[-9.25000000e-01 1.92500000e+00]
[-9.25000000e-01 1.92500000e+00]
[...]
The test failure can be reproduced reliably in the build tree as follows:
$ cd .pybuild/cpython3_3.12_plotpy/build
$ python3.12 -m pytest plotpy/tests/unit/test_contour.py