home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

4 rows where issue = 1445486904 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 2

  • mangecoeur 2
  • keewis 2

author_association 2

  • CONTRIBUTOR 2
  • MEMBER 2

issue 1

  • Support for Scipy Sparse Arrays · 4 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
1311930838 https://github.com/pydata/xarray/issues/7280#issuecomment-1311930838 https://api.github.com/repos/pydata/xarray/issues/7280 IC_kwDOAMm_X85OMnnW keewis 14808389 2022-11-11T16:39:52Z 2022-11-11T16:39:52Z MEMBER

changing the assignment to: python s.__class__.__array_namespace__ = ... should fix this, but indeed it is better to just wait on scipy.sparse to implement the array API (NEP47)

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Support for Scipy Sparse Arrays 1445486904
1311919228 https://github.com/pydata/xarray/issues/7280#issuecomment-1311919228 https://api.github.com/repos/pydata/xarray/issues/7280 IC_kwDOAMm_X85OMkx8 mangecoeur 743508 2022-11-11T16:27:57Z 2022-11-11T16:27:57Z CONTRIBUTOR

@keewis using your solution things seem to more or less work, except that every operation of course 'loses' the __array_namespace__ attr so anything like slicing only half works, plus a lot of indexing operations are not implemented on scipy sparse arrays.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Support for Scipy Sparse Arrays 1445486904
1311902588 https://github.com/pydata/xarray/issues/7280#issuecomment-1311902588 https://api.github.com/repos/pydata/xarray/issues/7280 IC_kwDOAMm_X85OMgt8 mangecoeur 743508 2022-11-11T16:14:12Z 2022-11-11T16:14:12Z CONTRIBUTOR

Ok I had assumed that scipy would have directly implemented the array interface, I will see if there is already an issue open there. Then we can slowly see what else does/doesn't work.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Support for Scipy Sparse Arrays 1445486904
1311899371 https://github.com/pydata/xarray/issues/7280#issuecomment-1311899371 https://api.github.com/repos/pydata/xarray/issues/7280 IC_kwDOAMm_X85OMf7r keewis 14808389 2022-11-11T16:11:12Z 2022-11-11T16:11:12Z MEMBER

the reason that's failing is that scipy.sparse.coo_array does not implement __array_function__ or __array_namespace__. As soon as that's the case I'd expect it to work.

In fact, setting s.__array_namespace__ = lambda x: x will result in xr.DataArray(s) printing as <xarray.DataArray (dim_0: 4, dim_1: 4)> <4x4 sparse array of type '<class 'numpy.float64'>' with 4 stored elements in COOrdinate format> Dimensions without coordinates: dim_0, dim_1 which I think is what you were after? Though of course that does not mean that we can actually use it...

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Support for Scipy Sparse Arrays 1445486904

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