home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 644465420

This data as json

id node_id number title user state locked assignee milestone comments created_at updated_at closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
644465420 MDU6SXNzdWU2NDQ0NjU0MjA= 4172 test_aggregation fails on aarch64/ppc64le/s390x 302469 closed 0     0 2020-06-24T09:31:14Z 2020-06-24T18:24:55Z 2020-06-24T18:24:55Z CONTRIBUTOR      

What happened: When building happens on any of the above architectures, the test_aggregation test fails. This appears to be due to some small precision errors: ``` ___ TestVariable.test_aggregation[float-method_std] ____ [gw4] linux -- Python 3.9.0 /usr/bin/python3 self = <xarray.tests.test_units.TestVariable object at 0xffff72adc850> func = method_std, dtype = <class 'float'> @pytest.mark.parametrize( "func", ( method("all"), method("any"), method("argmax"), method("argmin"), method("argsort"), method("cumprod"), method("cumsum"), method("max"), method("mean"), method("median"), method("min"), pytest.param( method("prod"), marks=pytest.mark.xfail(reason="not implemented by pint"), ), method("std"), method("sum"), method("var"), ), ids=repr, ) def test_aggregation(self, func, dtype): array = np.linspace(0, 1, 10).astype(dtype) * ( unit_registry.m if func.name != "cumprod" else unit_registry.dimensionless ) variable = xr.Variable("x", array)

    units = extract_units(func(array))
    expected = attach_units(func(strip_units(variable)), units)
    actual = func(variable)

    assert_units_equal(expected, actual)
  xr.testing.assert_identical(expected, actual)

E AssertionError: Left and right Variable objects are not identical E
E Differing values: E L E array(0.319142) E R E array(0.319142) ../../BUILDROOT/python-xarray-0.15.1-3.fc33.aarch64/usr/lib/python3.9/site-packages/xarray/tests/test_units.py:1451: AssertionError ___ TestVariable.test_aggregation[float-method_var] ____ [gw4] linux -- Python 3.9.0 /usr/bin/python3 self = <xarray.tests.test_units.TestVariable object at 0xffff72f66ac0> func = method_var, dtype = <class 'float'> @pytest.mark.parametrize( "func", ( method("all"), method("any"), method("argmax"), method("argmin"), method("argsort"), method("cumprod"), method("cumsum"), method("max"), method("mean"), method("median"), method("min"), pytest.param( method("prod"), marks=pytest.mark.xfail(reason="not implemented by pint"), ), method("std"), method("sum"), method("var"), ), ids=repr, ) def test_aggregation(self, func, dtype): array = np.linspace(0, 1, 10).astype(dtype) * ( unit_registry.m if func.name != "cumprod" else unit_registry.dimensionless ) variable = xr.Variable("x", array)

    units = extract_units(func(array))
    expected = attach_units(func(strip_units(variable)), units)
    actual = func(variable)

    assert_units_equal(expected, actual)
  xr.testing.assert_identical(expected, actual)

E AssertionError: Left and right Variable objects are not identical E
E Differing values: E L E array(0.101852) E R E array(0.101852) ../../BUILDROOT/python-xarray-0.15.1-3.fc33.aarch64/usr/lib/python3.9/site-packages/xarray/tests/test_units.py:1451: AssertionError __ TestDataset.test_aggregation[float-function_std] __ [gw0] linux -- Python 3.9.0 /usr/bin/python3 self = <xarray.tests.test_units.TestDataset object at 0xffff6524e340> func = function_std, dtype = <class 'float'> @pytest.mark.parametrize( "func", ( pytest.param( function("all"), marks=pytest.mark.xfail(reason="not implemented by pint"), ), pytest.param( function("any"), marks=pytest.mark.xfail(reason="not implemented by pint"), ), function("argmax"), function("argmin"), function("max"), function("min"), function("mean"), pytest.param( function("median"), marks=pytest.mark.xfail( reason="np.median does not work with dataset yet" ), ), function("sum"), pytest.param( function("prod"), marks=pytest.mark.xfail(reason="not implemented by pint"), ), function("std"), function("var"), function("cumsum"), pytest.param( function("cumprod"), marks=pytest.mark.xfail(reason="fails within xarray"), ), pytest.param( method("all"), marks=pytest.mark.xfail(reason="not implemented by pint") ), pytest.param( method("any"), marks=pytest.mark.xfail(reason="not implemented by pint") ), method("argmax"), method("argmin"), method("max"), method("min"), method("mean"), method("median"), method("sum"), pytest.param( method("prod"), marks=pytest.mark.xfail(reason="not implemented by pint"), ), method("std"), method("var"), method("cumsum"), pytest.param( method("cumprod"), marks=pytest.mark.xfail(reason="fails within xarray") ), ), ids=repr, ) def test_aggregation(self, func, dtype): unit_a = ( unit_registry.Pa if func.name != "cumprod" else unit_registry.dimensionless ) unit_b = ( unit_registry.kg / unit_registry.m ** 3 if func.name != "cumprod" else unit_registry.dimensionless ) a = xr.DataArray(data=np.linspace(0, 1, 10).astype(dtype) * unit_a, dims="x") b = xr.DataArray(data=np.linspace(-1, 0, 10).astype(dtype) * unit_b, dims="x") x = xr.DataArray(data=np.arange(10).astype(dtype) * unit_registry.m, dims="x") y = xr.DataArray( data=np.arange(10, 20).astype(dtype) * unit_registry.s, dims="x" )

    ds = xr.Dataset(data_vars={"a": a, "b": b}, coords={"x": x, "y": y})

    actual = func(ds)
    expected = attach_units(
        func(strip_units(ds)),
        {
            "a": extract_units(func(a)).get(None),
            "b": extract_units(func(b)).get(None),
        },
    )
  assert_equal_with_units(actual, expected)

E AssertionError: Left and right Dataset objects are not equal E
E
E Differing data variables: E L a float64 <Quantity(0.31914236925211265, 'pascal')> E R a float64 <Quantity(0.3191423692521127, 'pascal')> E L b float64 <Quantity(0.31914236925211265, 'kilogram / meter ** 3')> E R b float64 <Quantity(0.3191423692521127, 'kilogram / meter ** 3')> E assert False E + where False = <bound method Dataset.equals of \<xarray.Dataset>\nDimensions: ()\nData variables:\n a float64 0.3191\n b float64 0.3191>(<xarray.Dataset>\nDimensions: ()\nData variables:\n a float64 0.3191\n b float64 0.3191) E + where <bound method Dataset.equals of \<xarray.Dataset>\nDimensions: ()\nData variables:\n a float64 0.3191\n b float64 0.3191> = <xarray.Dataset>\nDimensions: ()\nData variables:\n a float64 0.3191\n b float64 0.3191.equals ../../BUILDROOT/python-xarray-0.15.1-3.fc33.aarch64/usr/lib/python3.9/site-packages/xarray/tests/test_units.py:3812: AssertionError __ TestDataset.test_aggregation[float-function_var] __ [gw0] linux -- Python 3.9.0 /usr/bin/python3 self = <xarray.tests.test_units.TestDataset object at 0xffff695c6520> func = function_var, dtype = <class 'float'> @pytest.mark.parametrize( "func", ( pytest.param( function("all"), marks=pytest.mark.xfail(reason="not implemented by pint"), ), pytest.param( function("any"), marks=pytest.mark.xfail(reason="not implemented by pint"), ), function("argmax"), function("argmin"), function("max"), function("min"), function("mean"), pytest.param( function("median"), marks=pytest.mark.xfail( reason="np.median does not work with dataset yet" ), ), function("sum"), pytest.param( function("prod"), marks=pytest.mark.xfail(reason="not implemented by pint"), ), function("std"), function("var"), function("cumsum"), pytest.param( function("cumprod"), marks=pytest.mark.xfail(reason="fails within xarray"), ), pytest.param( method("all"), marks=pytest.mark.xfail(reason="not implemented by pint") ), pytest.param( method("any"), marks=pytest.mark.xfail(reason="not implemented by pint") ), method("argmax"), method("argmin"), method("max"), method("min"), method("mean"), method("median"), method("sum"), pytest.param( method("prod"), marks=pytest.mark.xfail(reason="not implemented by pint"), ), method("std"), method("var"), method("cumsum"), pytest.param( method("cumprod"), marks=pytest.mark.xfail(reason="fails within xarray") ), ), ids=repr, ) def test_aggregation(self, func, dtype): unit_a = ( unit_registry.Pa if func.name != "cumprod" else unit_registry.dimensionless ) unit_b = ( unit_registry.kg / unit_registry.m ** 3 if func.name != "cumprod" else unit_registry.dimensionless ) a = xr.DataArray(data=np.linspace(0, 1, 10).astype(dtype) * unit_a, dims="x") b = xr.DataArray(data=np.linspace(-1, 0, 10).astype(dtype) * unit_b, dims="x") x = xr.DataArray(data=np.arange(10).astype(dtype) * unit_registry.m, dims="x") y = xr.DataArray( data=np.arange(10, 20).astype(dtype) * unit_registry.s, dims="x" )

    ds = xr.Dataset(data_vars={"a": a, "b": b}, coords={"x": x, "y": y})

    actual = func(ds)
    expected = attach_units(
        func(strip_units(ds)),
        {
            "a": extract_units(func(a)).get(None),
            "b": extract_units(func(b)).get(None),
        },
    )
  assert_equal_with_units(actual, expected)

E AssertionError: Left and right Dataset objects are not equal E
E
E Differing data variables: E L a float64 <Quantity(0.10185185185185183, 'pascal ** 2')> E R a float64 <Quantity(0.10185185185185186, 'pascal ** 2')> E L b float64 <Quantity(0.10185185185185183, 'kilogram ** 2 / meter ... E R b float64 <Quantity(0.10185185185185186, 'kilogram ** 2 / meter ... E assert False E + where False = <bound method Dataset.equals of \<xarray.Dataset>\nDimensions: ()\nData variables:\n a float64 0.1019\n b float64 0.1019>(<xarray.Dataset>\nDimensions: ()\nData variables:\n a float64 0.1019\n b float64 0.1019) E + where <bound method Dataset.equals of \<xarray.Dataset>\nDimensions: ()\nData variables:\n a float64 0.1019\n b float64 0.1019> = <xarray.Dataset>\nDimensions: ()\nData variables:\n a float64 0.1019\n b float64 0.1019.equals ../../BUILDROOT/python-xarray-0.15.1-3.fc33.aarch64/usr/lib/python3.9/site-packages/xarray/tests/test_units.py:3812: AssertionError __ TestDataset.test_aggregation[float-method_std] __ [gw0] linux -- Python 3.9.0 /usr/bin/python3 self = <xarray.tests.test_units.TestDataset object at 0xffff65305c10> func = method_std, dtype = <class 'float'> @pytest.mark.parametrize( "func", ( pytest.param( function("all"), marks=pytest.mark.xfail(reason="not implemented by pint"), ), pytest.param( function("any"), marks=pytest.mark.xfail(reason="not implemented by pint"), ), function("argmax"), function("argmin"), function("max"), function("min"), function("mean"), pytest.param( function("median"), marks=pytest.mark.xfail( reason="np.median does not work with dataset yet" ), ), function("sum"), pytest.param( function("prod"), marks=pytest.mark.xfail(reason="not implemented by pint"), ), function("std"), function("var"), function("cumsum"), pytest.param( function("cumprod"), marks=pytest.mark.xfail(reason="fails within xarray"), ), pytest.param( method("all"), marks=pytest.mark.xfail(reason="not implemented by pint") ), pytest.param( method("any"), marks=pytest.mark.xfail(reason="not implemented by pint") ), method("argmax"), method("argmin"), method("max"), method("min"), method("mean"), method("median"), method("sum"), pytest.param( method("prod"), marks=pytest.mark.xfail(reason="not implemented by pint"), ), method("std"), method("var"), method("cumsum"), pytest.param( method("cumprod"), marks=pytest.mark.xfail(reason="fails within xarray") ), ), ids=repr, ) def test_aggregation(self, func, dtype): unit_a = ( unit_registry.Pa if func.name != "cumprod" else unit_registry.dimensionless ) unit_b = ( unit_registry.kg / unit_registry.m ** 3 if func.name != "cumprod" else unit_registry.dimensionless ) a = xr.DataArray(data=np.linspace(0, 1, 10).astype(dtype) * unit_a, dims="x") b = xr.DataArray(data=np.linspace(-1, 0, 10).astype(dtype) * unit_b, dims="x") x = xr.DataArray(data=np.arange(10).astype(dtype) * unit_registry.m, dims="x") y = xr.DataArray( data=np.arange(10, 20).astype(dtype) * unit_registry.s, dims="x" )

    ds = xr.Dataset(data_vars={"a": a, "b": b}, coords={"x": x, "y": y})

    actual = func(ds)
    expected = attach_units(
        func(strip_units(ds)),
        {
            "a": extract_units(func(a)).get(None),
            "b": extract_units(func(b)).get(None),
        },
    )
  assert_equal_with_units(actual, expected)

E AssertionError: Left and right Dataset objects are not equal E
E
E Differing data variables: E L a float64 <Quantity(0.31914236925211265, 'pascal')> E R a float64 <Quantity(0.3191423692521127, 'pascal')> E L b float64 <Quantity(0.31914236925211265, 'kilogram / meter ** 3')> E R b float64 <Quantity(0.3191423692521127, 'kilogram / meter ** 3')> E assert False E + where False = <bound method Dataset.equals of \<xarray.Dataset>\nDimensions: ()\nData variables:\n a float64 0.3191\n b float64 0.3191>(<xarray.Dataset>\nDimensions: ()\nData variables:\n a float64 0.3191\n b float64 0.3191) E + where <bound method Dataset.equals of \<xarray.Dataset>\nDimensions: ()\nData variables:\n a float64 0.3191\n b float64 0.3191> = <xarray.Dataset>\nDimensions: ()\nData variables:\n a float64 0.3191\n b float64 0.3191.equals ../../BUILDROOT/python-xarray-0.15.1-3.fc33.aarch64/usr/lib/python3.9/site-packages/xarray/tests/test_units.py:3812: AssertionError __ TestDataset.test_aggregation[float-method_var] __ [gw0] linux -- Python 3.9.0 /usr/bin/python3 self = <xarray.tests.test_units.TestDataset object at 0xffff6a1c2b80> func = method_var, dtype = <class 'float'> @pytest.mark.parametrize( "func", ( pytest.param( function("all"), marks=pytest.mark.xfail(reason="not implemented by pint"), ), pytest.param( function("any"), marks=pytest.mark.xfail(reason="not implemented by pint"), ), function("argmax"), function("argmin"), function("max"), function("min"), function("mean"), pytest.param( function("median"), marks=pytest.mark.xfail( reason="np.median does not work with dataset yet" ), ), function("sum"), pytest.param( function("prod"), marks=pytest.mark.xfail(reason="not implemented by pint"), ), function("std"), function("var"), function("cumsum"), pytest.param( function("cumprod"), marks=pytest.mark.xfail(reason="fails within xarray"), ), pytest.param( method("all"), marks=pytest.mark.xfail(reason="not implemented by pint") ), pytest.param( method("any"), marks=pytest.mark.xfail(reason="not implemented by pint") ), method("argmax"), method("argmin"), method("max"), method("min"), method("mean"), method("median"), method("sum"), pytest.param( method("prod"), marks=pytest.mark.xfail(reason="not implemented by pint"), ), method("std"), method("var"), method("cumsum"), pytest.param( method("cumprod"), marks=pytest.mark.xfail(reason="fails within xarray") ), ), ids=repr, ) def test_aggregation(self, func, dtype): unit_a = ( unit_registry.Pa if func.name != "cumprod" else unit_registry.dimensionless ) unit_b = ( unit_registry.kg / unit_registry.m ** 3 if func.name != "cumprod" else unit_registry.dimensionless ) a = xr.DataArray(data=np.linspace(0, 1, 10).astype(dtype) * unit_a, dims="x") b = xr.DataArray(data=np.linspace(-1, 0, 10).astype(dtype) * unit_b, dims="x") x = xr.DataArray(data=np.arange(10).astype(dtype) * unit_registry.m, dims="x") y = xr.DataArray( data=np.arange(10, 20).astype(dtype) * unit_registry.s, dims="x" )

    ds = xr.Dataset(data_vars={"a": a, "b": b}, coords={"x": x, "y": y})

    actual = func(ds)
    expected = attach_units(
        func(strip_units(ds)),
        {
            "a": extract_units(func(a)).get(None),
            "b": extract_units(func(b)).get(None),
        },
    )
  assert_equal_with_units(actual, expected)

E AssertionError: Left and right Dataset objects are not equal E
E
E Differing data variables: E L a float64 <Quantity(0.10185185185185183, 'pascal ** 2')> E R a float64 <Quantity(0.10185185185185186, 'pascal ** 2')> E L b float64 <Quantity(0.10185185185185183, 'kilogram ** 2 / meter ... E R b float64 <Quantity(0.10185185185185186, 'kilogram ** 2 / meter ... E assert False E + where False = <bound method Dataset.equals of \<xarray.Dataset>\nDimensions: ()\nData variables:\n a float64 0.1019\n b float64 0.1019>(<xarray.Dataset>\nDimensions: ()\nData variables:\n a float64 0.1019\n b float64 0.1019) E + where <bound method Dataset.equals of \<xarray.Dataset>\nDimensions: ()\nData variables:\n a float64 0.1019\n b float64 0.1019> = <xarray.Dataset>\nDimensions: ()\nData variables:\n a float64 0.1019\n b float64 0.1019.equals ../../BUILDROOT/python-xarray-0.15.1-3.fc33.aarch64/usr/lib/python3.9/site-packages/xarray/tests/test_units.py:3812: AssertionError ```

What you expected to happen: Tests pass, no matter the architecture.

Minimal Complete Verifiable Example: pytest -ra -n auto -m 'not network' --pyargs xarray

Environment: All builds are run here; you can look at the individual architectures to see actual failures in build.log (though they're the same as above.) Note, other architectures not listed here fail only because this package is supposed to be noarch, but I disabled that here to test all arches.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/4172/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed 13221727 issue

Links from other tables

  • 0 rows from issues_id in issues_labels
  • 0 rows from issue in issue_comments
Powered by Datasette · Queries took 0.666ms · About: xarray-datasette