home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

6 rows where issue = 110979851 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

  • shoyer 2
  • j08lue 2
  • jhamman 1
  • max-sixty 1

author_association 2

  • MEMBER 4
  • CONTRIBUTOR 2

issue 1

  • Circular longitude axis · 6 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
269059125 https://github.com/pydata/xarray/issues/623#issuecomment-269059125 https://api.github.com/repos/pydata/xarray/issues/623 MDEyOklzc3VlQ29tbWVudDI2OTA1OTEyNQ== shoyer 1217238 2016-12-24T00:11:45Z 2016-12-24T00:11:45Z MEMBER

Yeah, let's close this. This could be worth putting in some sort of geo-specific extension but it probably doesn't make sense for core xarray.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Circular longitude axis 110979851
269030684 https://github.com/pydata/xarray/issues/623#issuecomment-269030684 https://api.github.com/repos/pydata/xarray/issues/623 MDEyOklzc3VlQ29tbWVudDI2OTAzMDY4NA== max-sixty 5635139 2016-12-23T18:46:24Z 2016-12-23T18:46:24Z MEMBER

Can this be closed @shoyer ?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Circular longitude axis 110979851
147962600 https://github.com/pydata/xarray/issues/623#issuecomment-147962600 https://api.github.com/repos/pydata/xarray/issues/623 MDEyOklzc3VlQ29tbWVudDE0Nzk2MjYwMA== j08lue 3404817 2015-10-14T07:33:44Z 2015-10-14T07:33:44Z CONTRIBUTOR

Alright, I see. In that case we should not create an entirely new syntax for this - unless there are more people than just me interested in this feature. I can just use my own little convenience function that generates a series of array indices that can be fed to isel, something like this:

python def wrap_iselkw(ds, dim, istart, istop): """Returns a kw dict for indices from `istart` to `istop` that wrap around dimension `dim`""" n = len(ds[dim]) if istart > istop: istart -= n return { dim : np.mod(np.arange(istart, istop), n) }

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Circular longitude axis 110979851
147818075 https://github.com/pydata/xarray/issues/623#issuecomment-147818075 https://api.github.com/repos/pydata/xarray/issues/623 MDEyOklzc3VlQ29tbWVudDE0NzgxODA3NQ== shoyer 1217238 2015-10-13T19:11:31Z 2015-10-13T19:11:31Z MEMBER

I think we need another way of spelling this sort of selection that clearly disambiguates it from slicing. The problem is selection with a slice object (as it currently works) always returns a view, but that's not possible for selections that wrap around a coordinate.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Circular longitude axis 110979851
147727880 https://github.com/pydata/xarray/issues/623#issuecomment-147727880 https://api.github.com/repos/pydata/xarray/issues/623 MDEyOklzc3VlQ29tbWVudDE0NzcyNzg4MA== j08lue 3404817 2015-10-13T14:17:08Z 2015-10-13T14:17:08Z CONTRIBUTOR

@jhamman You guys seem to be always ahead of me - which is great! (I just did not notice it this time before I raised the issue...)

But it would actually not be that hard to make selecting regions across the boundary of a circular dimension more convenient in xray.

It would of course be great if it worked with real coordinate (longitude) values:

ds.sel(lon=slice(-90, 15))

which, however, only works if the axis explicitly covers this range (e.g. has range -180E to 180E). If it ranges, say, from 0E to 360E, an empty DataArray is returned. There is no nice way of resolving this, I guess, because you would need to hard-code 360 or have it as a clumsy, non-CF-standard parameter and transform all values to some common range before trying to find the requested region.

But it should be less problematic with

ds.isel(lon=slice(-100, 200))

i.e. isel with negative slice start. As it is now, this also returns an empty DataArray for me (xray 0.6.0), which is in a way consistent with the sel behaviour. But asking for negative indices is actually a quite pythonic way of implying circular. So could this be implemented, now that netCDF4 supports non-contiguous indexing?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Circular longitude axis 110979851
147451867 https://github.com/pydata/xarray/issues/623#issuecomment-147451867 https://api.github.com/repos/pydata/xarray/issues/623 MDEyOklzc3VlQ29tbWVudDE0NzQ1MTg2Nw== jhamman 2443309 2015-10-12T16:24:14Z 2015-10-12T16:24:14Z MEMBER

@j08lue -

But this works only on data that is already loaded into memory (e.g. with .load()), as illustrated in this gist. I assume that this constraint is due to the netCDF backend (in this case netCDF4) not supporting irregular slicing. Once loaded, the operation is performed on NumPy arrays, I guess?

We've recently addressed this in netCDF4 (issue: https://github.com/Unidata/netcdf4-python/issues/467, PR: https://github.com/Unidata/netcdf4-python/issues/469).

Now the first thing is that it took me quite a while to figure out why this worked in some cases and not in others. Perhaps the IndexError that is thrown by the backend could be caught to give more hints on this? Or add a note in the Docs about this?

We've also added a more descriptive error message on the xray end (#593, #595). These changes will be available in xray 0.6.1 which should be released soon (blocked by read the docs bug).

As for your actual feature request. Maybe you could show us some sample code that does what you're looking for?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Circular longitude axis 110979851

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