home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 655817246

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/issues/4208#issuecomment-655817246 https://api.github.com/repos/pydata/xarray/issues/4208 655817246 MDEyOklzc3VlQ29tbWVudDY1NTgxNzI0Ng== 3460034 2020-07-08T23:57:36Z 2020-07-08T23:59:28Z CONTRIBUTOR

Maybe something like this would work?

def is_duck_dask_array(x): return getattr(x, 'chunks', None) is not None

xarray.DataArray would pass this test (chunks is either None for non-dask arrays or a tuple for dask arrays), so this would be consistent with what we already do.

That would be a straightforward solution to both problems! A Pint Quantity containing a Dask Array passes along the chunks attribute from the Dask Array, and a Pint Quantity containing something else will raise an AttributeError. Unless there are other objections, I'll see what it will take to swap out the existing Dask checks for this in the xarray internals and hopefully get around to a PR (after I get some MetPy stuff done first).

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