home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 281897468

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
281897468 MDU6SXNzdWUyODE4OTc0Njg= 1778 ValueError on empty selection with dask based DataArrays 3169620 closed 0   3801867 2 2017-12-13T21:09:42Z 2019-07-12T13:41:08Z 2019-07-12T13:41:08Z CONTRIBUTOR      

Code Sample, a copy-pastable example if possible

```python import xarray as xr import numpy as np

da = xr.DataArray(np.random.rand(15), dims=['latitude'], coords={'latitude':np.linspace(90, -90, 15)})

This gives an empty latitude slice

print(da.sel(latitude=slice(20, 60)))

After converting the DataArray to dask...

da=da.chunk()

...this throws a ValueError due to 'conflicting sizes'

print(da.sel(latitude=slice(20, 60))) ```

Problem description

I would expect the dask based DataArray to return an empty slice just as the numpy one does.

Although arguably it would be nicer if both returned the latitude values between 20 and 60 - regardless of the direction of the coordinate. Perhaps the sel method could check whether the coordinate is increasing or decreasing?

Output of xr.show_versions()

# Paste the output here xr.show_versions() here xarray version: 0.9.6 numpy version: 1.13.3 dask version: 0.15.4
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/1778/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

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