python-xarray: autopkgtest regression on several architectures

Bug #1937253 reported by Graham Inggs
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-xarray (Debian)
Fix Released
Unknown
python-xarray (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

From https://bugs.debian.org/983758

Source: python-xarray
Version: 0.17.0-1
Severity: serious

https://ci.debian.net/data/autopkgtest/testing/arm64/p/python-xarray/10765498/log.gz
https://ci.debian.net/data/autopkgtest/testing/arm64/p/python-xarray/10765498/log.gz

...
=================================== FAILURES ===================================
_______________________ TestDataArray.test_pad_constant ________________________

self = <xarray.tests.test_dataarray.TestDataArray object at 0xeeed3e98>

    def test_pad_constant(self):
        ar = DataArray(np.arange(3 * 4 * 5).reshape(3, 4, 5))
        actual = ar.pad(dim_0=(1, 3))
        expected = DataArray(
            np.pad(
                np.arange(3 * 4 * 5).reshape(3, 4, 5).astype(np.float32),
                mode="constant",
                pad_width=((1, 3), (0, 0), (0, 0)),
                constant_values=np.nan,
            )
        )
        assert actual.shape == (7, 4, 5)
        assert_identical(actual, expected)

        ar = xr.DataArray([9], dims="x")

        actual = ar.pad(x=1)
        expected = xr.DataArray([np.NaN, 9, np.NaN], dims="x")
        assert_identical(actual, expected)

        actual = ar.pad(x=1, constant_values=1.23456)
        expected = xr.DataArray([1, 9, 1], dims="x")
        assert_identical(actual, expected)

        if LooseVersion(np.__version__) >= "1.20":
            with pytest.raises(ValueError, match="cannot convert float NaN to integer"):
                ar.pad(x=1, constant_values=np.NaN)
        else:
            actual = ar.pad(x=1, constant_values=np.NaN)
            expected = xr.DataArray(
                [-9223372036854775808, 9, -9223372036854775808], dims="x"
            )
> assert_identical(actual, expected)
E AssertionError: Left and right DataArray objects are not identical
E
E Differing values:
E L
E array([0, 9, 0])
E R
E array([-9223372036854775808, 9, -9223372036854775808],
E dtype=int64)

/usr/lib/python3/dist-packages/xarray/tests/test_dataarray.py:4523: AssertionError
=============================== warnings summary ===============================
...

https://ci.debian.net/data/autopkgtest/testing/i386/p/python-xarray/10765494/log.gz

...
=================================== FAILURES ===================================
_______________________ TestDataArray.test_pad_constant ________________________

self = <xarray.tests.test_dataarray.TestDataArray object at 0xedd27b20>

    def test_pad_constant(self):
        ar = DataArray(np.arange(3 * 4 * 5).reshape(3, 4, 5))
        actual = ar.pad(dim_0=(1, 3))
        expected = DataArray(
            np.pad(
                np.arange(3 * 4 * 5).reshape(3, 4, 5).astype(np.float32),
                mode="constant",
                pad_width=((1, 3), (0, 0), (0, 0)),
                constant_values=np.nan,
            )
        )
        assert actual.shape == (7, 4, 5)
        assert_identical(actual, expected)

        ar = xr.DataArray([9], dims="x")

        actual = ar.pad(x=1)
        expected = xr.DataArray([np.NaN, 9, np.NaN], dims="x")
        assert_identical(actual, expected)

        actual = ar.pad(x=1, constant_values=1.23456)
        expected = xr.DataArray([1, 9, 1], dims="x")
        assert_identical(actual, expected)

        if LooseVersion(np.__version__) >= "1.20":
            with pytest.raises(ValueError, match="cannot convert float NaN to integer"):
                ar.pad(x=1, constant_values=np.NaN)
        else:
            actual = ar.pad(x=1, constant_values=np.NaN)
            expected = xr.DataArray(
                [-9223372036854775808, 9, -9223372036854775808], dims="x"
            )
> assert_identical(actual, expected)
E AssertionError: Left and right DataArray objects are not identical
E
E Differing values:
E L
E array([-2147483648, 9, -2147483648])
E R
E array([-9223372036854775808, 9, -9223372036854775808],
E dtype=int64)

/usr/lib/python3/dist-packages/xarray/tests/test_dataarray.py:4523: AssertionError
=============================== warnings summary ===============================
...

Changed in python-xarray (Debian):
status: Unknown → New
Graham Inggs (ginggs)
Changed in python-xarray (Ubuntu):
status: New → Fix Released
Changed in python-xarray (Debian):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.