home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

9 rows where issue = 679575175 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 4

  • max-sixty 4
  • Illviljan 3
  • shoyer 1
  • keewis 1

issue 1

  • Improve Dataset documentation · 9 ✖

author_association 1

  • MEMBER 9
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
674589019 https://github.com/pydata/xarray/issues/4345#issuecomment-674589019 https://api.github.com/repos/pydata/xarray/issues/4345 MDEyOklzc3VlQ29tbWVudDY3NDU4OTAxOQ== max-sixty 5635139 2020-08-16T23:02:14Z 2020-08-18T19:57:11Z MEMBER

Maybe we keep it focused on one issue, but another oddity — JupyterLab seems to list the signature as xr.Dataset(*args, **kwds), but the signature is explicit: https://github.com/pydata/xarray/blob/v0.16.0/xarray/core/dataset.py#L468-L475

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Improve Dataset documentation 679575175
675234132 https://github.com/pydata/xarray/issues/4345#issuecomment-675234132 https://api.github.com/repos/pydata/xarray/issues/4345 MDEyOklzc3VlQ29tbWVudDY3NTIzNDEzMg== shoyer 1217238 2020-08-18T03:54:57Z 2020-08-18T03:54:57Z MEMBER

I don't think it's unusual to document constructor parameters on __init__. For example, that's the recommendation of the Google Python style-guide, followed by most Google Python projects (e.g., TensorFlow). So I think Spyder would be improved by documenting __init__, too.

That said, I don't have any principled reason for deviating from the NumPy docstring standards here. I also agree that the Dataset constructor would be improved by adding usage examples of how to create a Dataset.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Improve Dataset documentation 679575175
674588981 https://github.com/pydata/xarray/issues/4345#issuecomment-674588981 https://api.github.com/repos/pydata/xarray/issues/4345 MDEyOklzc3VlQ29tbWVudDY3NDU4ODk4MQ== max-sixty 5635139 2020-08-16T23:01:55Z 2020-08-16T23:01:55Z MEMBER

Thanks @keewis , good spot.

That looks right @Illviljan , so unless there's other information, it looks like we should move it to the class.

Is there any reason to keep it on the __init__?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Improve Dataset documentation 679575175
674583004 https://github.com/pydata/xarray/issues/4345#issuecomment-674583004 https://api.github.com/repos/pydata/xarray/issues/4345 MDEyOklzc3VlQ29tbWVudDY3NDU4MzAwNA== Illviljan 14371165 2020-08-16T21:57:36Z 2020-08-16T22:02:34Z MEMBER

Creating a decorator for this sounds a bit too fancy compared to just moving the init docstring to the class docstring in my opinion.

Is xarray following the numpy docstring guidelines? Reading up on the numpy guidelines they recommend that the constructor (init) should be documented at the class docstring. https://numpydoc.readthedocs.io/en/latest/format.html#class-docstring

And after looking around some more the modules that prefers having init parameters at the class docstring are: * numpy - https://github.com/numpy/numpy/blob/master/numpy/core/records.py#L98 * scipy - https://github.com/scipy/scipy/blob/v1.5.2/scipy/interpolate/interpolate.py * pandas - https://github.com/pandas-dev/pandas/blob/v1.1.0/pandas/core/frame.py#L339-L9257 * dask - https://github.com/dask/dask/blob/master/dask/blockwise.py#L135

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Improve Dataset documentation 679575175
674576523 https://github.com/pydata/xarray/issues/4345#issuecomment-674576523 https://api.github.com/repos/pydata/xarray/issues/4345 MDEyOklzc3VlQ29tbWVudDY3NDU3NjUyMw== keewis 14808389 2020-08-16T20:53:44Z 2020-08-16T20:53:44Z MEMBER

python -m pydoc xarray.Dataset displays __doc__ and then all methods / attributes / properties and their __doc__, so that's not a problem there. As @Illviljan pointed out, ipython / jupyter display the docstring of Dataset.__init__ as a special Init docstring section.

So I guess this is a "bug" in spyder (and maybe also other IDEs?), but we could work around that using a decorator.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Improve Dataset documentation 679575175
674575204 https://github.com/pydata/xarray/issues/4345#issuecomment-674575204 https://api.github.com/repos/pydata/xarray/issues/4345 MDEyOklzc3VlQ29tbWVudDY3NDU3NTIwNA== Illviljan 14371165 2020-08-16T20:40:16Z 2020-08-16T20:40:16Z MEMBER

My opinion is that it is a general issue but maybe that's because I prefer Spyder? Jupyterlab is the other IDE I know that has this functionality it seems to print class and init information. Are there any others?

Checking pd.DataFrame() in JupyterLab:

Checking xr.Dataset() in JupyterLab:

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Improve Dataset documentation 679575175
674557633 https://github.com/pydata/xarray/issues/4345#issuecomment-674557633 https://api.github.com/repos/pydata/xarray/issues/4345 MDEyOklzc3VlQ29tbWVudDY3NDU1NzYzMw== max-sixty 5635139 2020-08-16T18:01:48Z 2020-08-16T18:01:48Z MEMBER

Any idea whether this is a Spyder issue only or more general?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Improve Dataset documentation 679575175
674491988 https://github.com/pydata/xarray/issues/4345#issuecomment-674491988 https://api.github.com/repos/pydata/xarray/issues/4345 MDEyOklzc3VlQ29tbWVudDY3NDQ5MTk4OA== Illviljan 14371165 2020-08-16T07:30:14Z 2020-08-16T07:30:14Z MEMBER

Yeah, I've read the same thing that either __init__ or the class can be used. I liked adding it in __init__ too when I've developed classes because it's consistent with other functions and methods. But now that I'm on the user side I think the class docstring is the way to go. Pandas and scipy seems to be pretty consistent with this as well: * Series - https://github.com/pandas-dev/pandas/blob/v1.1.0/pandas/core/series.py#L139-L4979 * Interpolate- https://github.com/scipy/scipy/blob/v1.5.2/scipy/interpolate/interpolate.py

The Spyder help pane simply reads xr.Dataset.__doc__ and it would correctly read the __init__ doc if I I typed out xr.Dataset.__init__ too, but which users prefers to do that?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Improve Dataset documentation 679575175
674453249 https://github.com/pydata/xarray/issues/4345#issuecomment-674453249 https://api.github.com/repos/pydata/xarray/issues/4345 MDEyOklzc3VlQ29tbWVudDY3NDQ1MzI0OQ== max-sixty 5635139 2020-08-15T22:28:18Z 2020-08-15T22:28:18Z MEMBER

Thanks for the feedback; I agree there's more to initializing a Dataset than a DataFrame, and we should make the docs as accessible as possible.

In this specific case, is this a Spyder issue only or more general? IIUC using the __init__ or the class are both standard for the class docstring

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Improve Dataset documentation 679575175

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