home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 281075869

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/1140#issuecomment-281075869 https://api.github.com/repos/pydata/xarray/issues/1140 281075869 MDEyOklzc3VlQ29tbWVudDI4MTA3NTg2OQ== 3404817 2017-02-20T13:13:07Z 2017-02-20T13:13:07Z CONTRIBUTOR

@JamesSample excellent work confirming the limited scope.

I am quite sure that the issue is with this line: https://github.com/pydata/xarray/blob/v0.9.1/xarray/core/variable.py#L375-L376

dims = tuple(dim for k, dim in zip(key, self.dims) if not isinstance(k, (int, np.integer)))

When you run the test case I added in #1184, you will see that, inside __getitem__, key is a tuple with an empty array inside (key = (np.array(0, dtype=np.int64),)).

With that value, isinstance(key[0], (int, np.integer)) is False on 64 bit Windows and so dims=('time',), which has length 1.

But values = self._indexable_data[key] gives a zero-dimension array, such that values.ndim == 0...

I am unable to tell which of the two sides of the assertion expression is unexpected...

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