home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

6 rows where issue = 536900797 sorted by updated_at descending

✖
✖

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 3

  • benbovy 2
  • keewis 2
  • rdoyle45 2

author_association 2

  • MEMBER 4
  • CONTRIBUTOR 2

issue 1

  • Autocomplete in registered accessors · 6 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
566094477 https://github.com/pydata/xarray/issues/3614#issuecomment-566094477 https://api.github.com/repos/pydata/xarray/issues/3614 MDEyOklzc3VlQ29tbWVudDU2NjA5NDQ3Nw== benbovy 4160723 2019-12-16T14:53:08Z 2019-12-16T14:53:08Z MEMBER

Autocomplete indeed works in ipython, but it doesn't seem to work for accessors in my emacs configuration (lsp-mode / lsp-python-ms / python-language-server). I haven't checked in VSCode / LSP. I'll investigate this later, it's likely an issue external to xarray.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Autocomplete in registered accessors 536900797
566089302 https://github.com/pydata/xarray/issues/3614#issuecomment-566089302 https://api.github.com/repos/pydata/xarray/issues/3614 MDEyOklzc3VlQ29tbWVudDU2NjA4OTMwMg== rdoyle45 48983334 2019-12-16T14:40:24Z 2019-12-16T14:40:24Z CONTRIBUTOR

You are right. The autocomplete does work. I had a problem in my script.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Autocomplete in registered accessors 536900797
565718679 https://github.com/pydata/xarray/issues/3614#issuecomment-565718679 https://api.github.com/repos/pydata/xarray/issues/3614 MDEyOklzc3VlQ29tbWVudDU2NTcxODY3OQ== keewis 14808389 2019-12-14T13:45:38Z 2019-12-14T13:54:30Z MEMBER

that works for me, too. I moved the accessor code into a file, then imported it: ```python In [1]: import xarray as xr ...: import numpy as np ...: import custom_accessor

In [2]: ds = xr.Dataset( ...: {"a": (("latitude", "longitude"), np.linspace(0, 1, 5 * 10).reshape(5, 10))}, ...: coords={"latitude": np.arange(5), "longitude": np.arange(10)}, ...: )

In [3]: # ds.geo.c<TAB> ...: ds.geo.center Out[3]: (2.0, 4.5) `` It also works with the builtinstr,dtandplotDataArrayaccessors (just not if I'm trying to access theDataArrays from aDataset` as described above).

Edit: does your accessor work, i.e. does ds.geo.center return something?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Autocomplete in registered accessors 536900797
565718085 https://github.com/pydata/xarray/issues/3614#issuecomment-565718085 https://api.github.com/repos/pydata/xarray/issues/3614 MDEyOklzc3VlQ29tbWVudDU2NTcxODA4NQ== rdoyle45 48983334 2019-12-14T13:37:06Z 2019-12-14T13:37:06Z CONTRIBUTOR

I can reproduce your first code perfect fine in ipython, with autocomplete. However, we're defining an accessor in ipython. It seems if an accessor is used in a module and that module imported to ipython the autocomplete doesn't work. It's like ipython can't "see" the functions in the accessor's class until runtime.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Autocomplete in registered accessors 536900797
565476562 https://github.com/pydata/xarray/issues/3614#issuecomment-565476562 https://api.github.com/repos/pydata/xarray/issues/3614 MDEyOklzc3VlQ29tbWVudDU2NTQ3NjU2Mg== keewis 14808389 2019-12-13T15:11:57Z 2019-12-14T00:14:55Z MEMBER

This already works for me in a IPython shell (jedi 0.15.1, ipython 7.9.0): ```python In [1]: import xarray as xr ...: import numpy as np

In [2]: @xr.register_dataset_accessor("geo") ...: class GeoAccessor: ...: def init(self, xarray_obj): ...: self._obj = xarray_obj ...: ...: @property ...: def center(self): ...: # return the geographic center point of this dataset ...: lon = self._obj.latitude ...: lat = self._obj.longitude ...: return (float(lon.mean()), float(lat.mean())) ...: ...: def plot(self): ...: # plot this array's data on a map, e.g., using Cartopy ...: pass ...:

In [3]: ds = xr.Dataset( ...: {"a": (("latitude", "longitude"), np.linspace(0, 1, 5 * 10).reshape(5, 10))}, ...: coords={"latitude": np.arange(5), "longitude": np.arange(10)}, ...: )

In [4]: # ds.geo.c<TAB>: ...: ds.geo.center Out[4]: (2.0, 4.5) ``` Am I missing something?

Edit: what does not work is something like ```python In [5]: ds = xr.Dataset( ...: {"a": (("latitude", "longitude"), np.linspace(0, 1, 5 * 10).reshape(5, 10))}, ...: coords={ ...: "latitude": np.arange(5), ...: "longitude": np.arange(10), ...: "time": np.datetime64("1999-01-01"), ...: }, ...: )

In [6]: # ds.time.dt.y<TAB> ...: ds.time.dt.y

In [7]: time = ds.time ...: # time.dt.y<TAB> ...: time.dt.year `` so it's not possible to autocompleteDataArrayaccessors viagetattronDataset`.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Autocomplete in registered accessors 536900797
565403514 https://github.com/pydata/xarray/issues/3614#issuecomment-565403514 https://api.github.com/repos/pydata/xarray/issues/3614 MDEyOklzc3VlQ29tbWVudDU2NTQwMzUxNA== benbovy 4160723 2019-12-13T11:13:26Z 2019-12-13T11:13:26Z MEMBER

That would be great if it could work in ipython and elsewhere too (e.g., IDEs, etc.). I guess it might be worth having a look at jedi and see if this could be easily fixed.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Autocomplete in registered accessors 536900797

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 89.247ms · About: xarray-datasette
  • Sort ascending
  • Sort descending
  • Facet by this
  • Hide this column
  • Show all columns
  • Show not-blank rows