home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 885213103

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions performed_via_github_app issue
https://github.com/pydata/xarray/pull/5571#issuecomment-885213103 https://api.github.com/repos/pydata/xarray/issues/5571 885213103 IC_kwDOAMm_X840w0ev 35968931 2021-07-22T20:31:35Z 2021-07-22T20:31:35Z MEMBER

Now there is one more mystery: why do some of the tests for padding fail with output that is 0.5 away from what's expected??:

``` ___ TestVariableWithDask.test_pad[xr_arg3-np_arg3-mean] ______ [gw3] linux -- Python 3.7.10 /usr/share/miniconda/envs/xarray-tests/bin/python

self = <xarray.tests.test_variable.TestVariableWithDask object at 0x7f10bd848990> mode = 'mean', xr_arg = {'x': (3, 1), 'z': (2, 0)} np_arg = ((3, 1), (0, 0), (2, 0))

@pytest.mark.parametrize(
    "mode",
    [
        "mean",
        pytest.param(
            "median",
            marks=pytest.mark.xfail(reason="median is not implemented by Dask"),
        ),
        pytest.param(
            "reflect", marks=pytest.mark.xfail(reason="dask.array.pad bug")
        ),
        "edge",
        pytest.param(
            "linear_ramp",
            marks=pytest.mark.xfail(
                reason="pint bug: https://github.com/hgrecco/pint/issues/1026"
            ),
        ),
        "maximum",
        "minimum",
        "symmetric",
        "wrap",
    ],
)
@pytest.mark.parametrize("xr_arg, np_arg", _PAD_XR_NP_ARGS)
@pytest.mark.filterwarnings(
    r"ignore:dask.array.pad.+? converts integers to floats."
)
def test_pad(self, mode, xr_arg, np_arg):
    data = np.arange(4 * 3 * 2).reshape(4, 3, 2)
    v = self.cls(["x", "y", "z"], data)

    actual = v.pad(mode=mode, **xr_arg)
    expected = np.pad(data, np_arg, mode=mode)
  assert_array_equal(actual, expected)

E AssertionError: E Arrays are not equal E
E Mismatched elements: 48 / 96 (50%) E Max absolute difference: 0.5 E Max relative difference: 0.25 E x: array([[[ 9.5, 9.5, 9. , 10. ], E [11.5, 11.5, 11. , 12. ], E [13.5, 13.5, 13. , 14. ]],... E y: array([[[10, 10, 9, 10], E [12, 12, 11, 12], E [14, 14, 13, 14]],... ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  936313924
Powered by Datasette · Queries took 0.518ms · About: xarray-datasette