home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

2 rows where issue = 124915222 and user = 10050469 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: created_at (date), updated_at (date)

user 1

  • fmaussion · 2 ✖

issue 1

  • Subclassing Dataset and DataArray · 2 ✖

author_association 1

  • MEMBER 2
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
192190921 https://github.com/pydata/xarray/issues/706#issuecomment-192190921 https://api.github.com/repos/pydata/xarray/issues/706 MDEyOklzc3VlQ29tbWVudDE5MjE5MDkyMQ== fmaussion 10050469 2016-03-04T08:57:02Z 2016-03-04T08:57:02Z MEMBER

Thanks, this looks very good. Any timeline for the xarray.register_accessor() functionality? ;)

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Subclassing Dataset and DataArray 124915222
191697006 https://github.com/pydata/xarray/issues/706#issuecomment-191697006 https://api.github.com/repos/pydata/xarray/issues/706 MDEyOklzc3VlQ29tbWVudDE5MTY5NzAwNg== fmaussion 10050469 2016-03-03T10:29:08Z 2016-03-03T10:29:08Z MEMBER

I find @shoyer 's suggestion about custom accessor attributes very interesting!

the simplest of my use cases would be quite easy to implement:

``` python

MyLib

class MyLibGis(object): def init(self, xray_obj): self.obj = xray_obj self.georef = read_georef(xray_obj)

def subset(self, shapefile=None, roi=None):
    """Return a subset of DataSet (or DataArray)"""
    # compute regions of interests
    slicex, slicey = self.georef(stuff...)
    # return a sel of DataSet
    return self.obj.sel(x=slicex, y=slicey)

xray.register_accessor('gis', MyLibGis)

user code

import mylib import xray ds = xray.DataArray(...) ds = ds.gis.subset(shapefile='/path/to/shape') ```

This would already be quite cool! But would the mechanism allow to pass arguments to the MyLibGis class at construction time? This might also be wordy, maybe something like

ds = xray.DataArray(data, gis={'arg1':42})?

I guess that with these two mechanisms, I would be able to do almost everything I want to do with my netcdf files.

However, one other very important use case for me would be to add lazy "diagnostic" variables to a netcdf dataset. For example, if an atmospheric model output file contains the variables P andPB, then the dataset automatically proposes a new variable TP, which is the sum of P andPB. From the user perspective, this variable is no different than a variable on file. Of course, the data should be computed only on demand. It doesn't seem possible to do this without subclassing, but maybe I missed something?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Subclassing Dataset and DataArray 124915222

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

CREATE TABLE [issue_comments] (
   [html_url] TEXT,
   [issue_url] TEXT,
   [id] INTEGER PRIMARY KEY,
   [node_id] TEXT,
   [user] INTEGER REFERENCES [users]([id]),
   [created_at] TEXT,
   [updated_at] TEXT,
   [author_association] TEXT,
   [body] TEXT,
   [reactions] TEXT,
   [performed_via_github_app] TEXT,
   [issue] INTEGER REFERENCES [issues]([id])
);
CREATE INDEX [idx_issue_comments_issue]
    ON [issue_comments] ([issue]);
CREATE INDEX [idx_issue_comments_user]
    ON [issue_comments] ([user]);
Powered by Datasette · Queries took 39.134ms · About: xarray-datasette