home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

7 rows where author_association = "MEMBER" and issue = 603930174 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 2

  • keewis 4
  • shoyer 3

issue 1

  • built-in accessor documentation · 7 ✖

author_association 1

  • MEMBER · 7 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
643448026 https://github.com/pydata/xarray/pull/3988#issuecomment-643448026 https://api.github.com/repos/pydata/xarray/issues/3988 MDEyOklzc3VlQ29tbWVudDY0MzQ0ODAyNg== keewis 14808389 2020-06-12T19:30:03Z 2020-06-12T19:30:03Z MEMBER

I think this is ready for merging; the fix of the DataArray.plot summary is going to be a new PR. So unless there are any objections I'm going to merge tomorrow.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  built-in accessor documentation 603930174
625550162 https://github.com/pydata/xarray/pull/3988#issuecomment-625550162 https://api.github.com/repos/pydata/xarray/issues/3988 MDEyOklzc3VlQ29tbWVudDYyNTU1MDE2Mg== keewis 14808389 2020-05-07T23:38:28Z 2020-05-14T15:30:59Z MEMBER

I added the accessor templates from pandas (we should eventually outsource these to a separate package used by both pandas and xarray) and modified the API page to display the accessor version of the plotting functions.

I think we should add a accessor section to each of the main objects (Dataset and DataArray), where we either copy what pandas does – listing every method / attribute of the accessor as a subsection of the class documentation – or we could show them as attributes (just like what we do for the injected numpy functions) and generate separate pages for the accessors.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  built-in accessor documentation 603930174
618357855 https://github.com/pydata/xarray/pull/3988#issuecomment-618357855 https://api.github.com/repos/pydata/xarray/issues/3988 MDEyOklzc3VlQ29tbWVudDYxODM1Nzg1NQ== keewis 14808389 2020-04-23T11:52:58Z 2020-04-23T11:52:58Z MEMBER

where should the docstring of the accessor come from? Right now, this is the docstring of the return value which seems reasonable to me.

I added tests verifying that cls.property returns the accessor class and obj.property the accessor instance. Do we need additional checks for __doc__?.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  built-in accessor documentation 603930174
618249149 https://github.com/pydata/xarray/pull/3988#issuecomment-618249149 https://api.github.com/repos/pydata/xarray/issues/3988 MDEyOklzc3VlQ29tbWVudDYxODI0OTE0OQ== shoyer 1217238 2020-04-23T08:07:22Z 2020-04-23T08:07:22Z MEMBER

there are a few of my questions / comments we can resolve by using something like

```python class UncachedAccessor: def init(self, accessor): self._accessor = accessor

def __get__(self, obj, cls):
    if obj is None:
        return self._accessor

    return self._accessor(obj)

```

The only disadvantage is that now pydoc (or help()) show the accessor as a class. That was already the case for str and dt, but plot was a function.

I think we could try to trick inspect.getmembers (which is used to decide which kind of output should be done), but that would require a lot of monkeypatching I'd rather not do.

pandas simply uses the same docstring for the class and __call__, which is not ideal but a lot simpler.

👍 for a simple solution here like pandas rather than using inspect. I think it's probably actually slightly more accurate to show the class.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  built-in accessor documentation 603930174
618248201 https://github.com/pydata/xarray/pull/3988#issuecomment-618248201 https://api.github.com/repos/pydata/xarray/issues/3988 MDEyOklzc3VlQ29tbWVudDYxODI0ODIwMQ== shoyer 1217238 2020-04-23T08:05:24Z 2020-04-23T08:05:24Z MEMBER

This is a really clever yet simple fix. I like it!

A few ideas for testing:

  • Verify that DataArray.plot returns the PlotMethods object.
  • Verify that data_array.plot.__doc__ is still there.
{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  built-in accessor documentation 603930174
618245767 https://github.com/pydata/xarray/pull/3988#issuecomment-618245767 https://api.github.com/repos/pydata/xarray/issues/3988 MDEyOklzc3VlQ29tbWVudDYxODI0NTc2Nw== shoyer 1217238 2020-04-23T08:00:31Z 2020-04-23T08:00:31Z MEMBER

I think pandas might do something similar to do this? It might be worth checking, though it looks like you've figured most of it out already :)

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  built-in accessor documentation 603930174
617763273 https://github.com/pydata/xarray/pull/3988#issuecomment-617763273 https://api.github.com/repos/pydata/xarray/issues/3988 MDEyOklzc3VlQ29tbWVudDYxNzc2MzI3Mw== keewis 14808389 2020-04-22T12:58:18Z 2020-04-22T12:58:18Z MEMBER

there are a few of my questions / comments we can resolve by using something like ```python class UncachedAccessor: def init(self, accessor): self._accessor = accessor

def __get__(self, obj, cls):
    if obj is None:
        return self._accessor

    return self._accessor(obj)

```

The only disadvantage is that now pydoc (or help()) show the accessor as a class. That was already the case for str and dt, but plot was a function.

I think we could try to trick inspect.getmembers (which is used to decide which kind of output should be done), but that would require a lot of monkeypatching I'd rather not do.

pandas simply uses the same docstring for the class and __call__, which is not ideal but a lot simpler.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  built-in accessor documentation 603930174

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