home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

8 rows where issue = 484240082 and user = 2448579 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 1

  • dcherian · 8 ✖

issue 1

  • sparse and other duck array issues · 8 ✖

author_association 1

  • MEMBER 8
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
780833545 https://github.com/pydata/xarray/issues/3245#issuecomment-780833545 https://api.github.com/repos/pydata/xarray/issues/3245 MDEyOklzc3VlQ29tbWVudDc4MDgzMzU0NQ== dcherian 2448579 2021-02-17T20:30:04Z 2021-02-17T23:22:19Z MEMBER

My impression was that the as_* methods would return xarray objects. So we could have DataArray methods

``` python def as_numpy(self): # needs cupy special handling data = self.data if isinstance(data, cupy_array_type): raise NotImplementedError else: return self.copy(data=np.array(data))

def to_numpy(self): """Coerces to and returns a numpy.ndarray""" return self.as_numpy().data ```

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  sparse and other duck array issues 484240082
662778974 https://github.com/pydata/xarray/issues/3245#issuecomment-662778974 https://api.github.com/repos/pydata/xarray/issues/3245 MDEyOklzc3VlQ29tbWVudDY2Mjc3ODk3NA== dcherian 2448579 2020-07-23T01:35:08Z 2020-07-23T01:35:08Z MEMBER

IMO a good first pass for as_numpy would be to use np.asarray with a special case for cupy where it would use .get.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  sparse and other duck array issues 484240082
662547659 https://github.com/pydata/xarray/issues/3245#issuecomment-662547659 https://api.github.com/repos/pydata/xarray/issues/3245 MDEyOklzc3VlQ29tbWVudDY2MjU0NzY1OQ== dcherian 2448579 2020-07-22T16:17:02Z 2020-07-22T16:17:02Z MEMBER

It seems like general consensus was (please correct me if any of this is wrong):

  1. .values will return np.asarray(obj.data) and respect the underlying library's choices: this will raise an error with cupy and that's OK.
  2. .plot() is a special case and should always coerce to numpy before passing data to matplotlib. plot currently uses .values so we should add a new function that always returns xarray objects with numpy arrays (with cupy as special case) and use that in plot.
  3. for now we are OK with special as_sparse, as_cupy, as_pint methods in xarray as long as all that logic is contained in one place: as_duck_array.py?
{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  sparse and other duck array issues 484240082
660209415 https://github.com/pydata/xarray/issues/3245#issuecomment-660209415 https://api.github.com/repos/pydata/xarray/issues/3245 MDEyOklzc3VlQ29tbWVudDY2MDIwOTQxNQ== dcherian 2448579 2020-07-17T16:34:30Z 2020-07-17T16:34:30Z MEMBER

I am unsure about automatic coercion for .values. I think we've trained users to expect numpy arrays from .values so cupy raising an error is a little unfriendly. OTOH it'd be nice to have something that is equivalent to np.asarray(da.data) but maybe we can expect users who want that to just type it out.

But I think we should automatically coerce for .plot using da.as_numpy().data or something similar. We call .compute() on dask arrays anyway so it's consistent with that behaviour.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  sparse and other duck array issues 484240082
555589399 https://github.com/pydata/xarray/issues/3245#issuecomment-555589399 https://api.github.com/repos/pydata/xarray/issues/3245 MDEyOklzc3VlQ29tbWVudDU1NTU4OTM5OQ== dcherian 2448579 2019-11-19T16:27:26Z 2019-11-19T16:27:26Z MEMBER

it makes clear that the objects are still xarray objects

This is a good point. I'm in favour of as_sparse, as_dense.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  sparse and other duck array issues 484240082
555559603 https://github.com/pydata/xarray/issues/3245#issuecomment-555559603 https://api.github.com/repos/pydata/xarray/issues/3245 MDEyOklzc3VlQ29tbWVudDU1NTU1OTYwMw== dcherian 2448579 2019-11-19T15:28:53Z 2019-11-19T15:28:53Z MEMBER

I weakly prefer following the upstream API: as_sparse and todense.

though to_sparse,to_dense and to_numpy_data would be more consistent?

Also isn't the function astype not as_type?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  sparse and other duck array issues 484240082
524408760 https://github.com/pydata/xarray/issues/3245#issuecomment-524408760 https://api.github.com/repos/pydata/xarray/issues/3245 MDEyOklzc3VlQ29tbWVudDUyNDQwODc2MA== dcherian 2448579 2019-08-23T18:03:17Z 2019-08-23T18:03:17Z MEMBER

:+1: I think to_numpy() would be good.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  sparse and other duck array issues 484240082
524388072 https://github.com/pydata/xarray/issues/3245#issuecomment-524388072 https://api.github.com/repos/pydata/xarray/issues/3245 MDEyOklzc3VlQ29tbWVudDUyNDM4ODA3Mg== dcherian 2448579 2019-08-23T16:57:10Z 2019-08-23T16:57:10Z MEMBER

The better way to phrase this is:

  1. Should we formalize the convention that .values always return a numpy array i.e. it will call todense() implicitly and that .data will always return the underlying container: sparse/dask etc.?
  2. Should we call todense() automatically in plot() the same way we do compute()?
{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  sparse and other duck array issues 484240082

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 729.955ms · About: xarray-datasette