home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 345026224

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/1528#issuecomment-345026224 https://api.github.com/repos/pydata/xarray/issues/1528 345026224 MDEyOklzc3VlQ29tbWVudDM0NTAyNjIyNA== 2443309 2017-11-16T18:53:42Z 2017-11-16T18:53:42Z MEMBER

@rabernat - FYI: I'm playing with your branch a bit today.

@shoyer and @rabernat, can we brainstorm what a ZarrArrayWraper would need to be compatible with the new indexing API? I'm happy to implement it but could use a few pointers to get started.

```Python class ZarrArrayWraper(BackendArray): def init(self, variable_name, datastore): self.datastore = datastore self.variable_name = variable_name array = self.get_array() self.shape = array.shape self.dtype = np.dtype(array.dtype.kind + str(array.dtype.itemsize))

def get_array(self):
    self.datastore.assert_open()
    return self.datastore.ds[self.variable_name]  # returns a zarr-array

def __getitem__(self, key):
    with self.datastore.ensure_open(autoclose=True):
        data = IndexingAdapter(self.get_array())[key]  # which indexing adapter? 
        return np.array(data, dtype=self.dtype, copy=copy)

```

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