home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 904403621

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/5731#issuecomment-904403621 https://api.github.com/repos/pydata/xarray/issues/5731 904403621 IC_kwDOAMm_X8416Bql 9466648 2021-08-24T07:43:28Z 2021-08-31T14:41:01Z CONTRIBUTOR

I included the proposed changes, thanks for the help.

However the new test I implemented does not go through and I fail to understand why. Would you be able to check ? The idea of the test is to ensure that lazy computations give the same results than normal ones. I tracked down the problem to line 1377 of computation.py: python demeaned_da_a = da_a - da_a.mean(dim=dim) # <-- this one returns nan upon computation (.compute()) demeaned_da_b = da_b - da_b.mean(dim=dim) # <-- this one returns the correct value although the input is masked with nans in the same way

The values before the mean call are: da_a.compute() = <xarray.DataArray <this-array> (x: 2, time: 2)> array([[ 1., 2.], [ 2., nan]]) da_b.compute() = <xarray.DataArray <this-array> (x: 2, time: 2)> array([[ 1., 2.], [ 1., nan]])

And for the means (dim is None): da_a.mean(dim=dim).compute()=<xarray.DataArray <this-array> ()> array(nan) da_b.mean(dim=dim).compute()=<xarray.DataArray <this-array> ()> array(1.33333333)

For non lazy computations everything seems fine.

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