issue_comments
4 rows where issue = 1372035441 and user = 4160723 sorted by updated_at descending
This data as json, CSV (advanced)
Suggested facets: reactions, created_at (date), updated_at (date)
issue 1
- Periodic Boundary Index · 4 ✖
id | html_url | issue_url | node_id | user | created_at | updated_at ▲ | author_association | body | reactions | performed_via_github_app | issue |
---|---|---|---|---|---|---|---|---|---|---|---|
1249218631 | https://github.com/pydata/xarray/issues/7031#issuecomment-1249218631 | https://api.github.com/repos/pydata/xarray/issues/7031 | IC_kwDOAMm_X85KdZBH | benbovy 4160723 | 2022-09-16T10:50:10Z | 2022-09-16T10:50:10Z | MEMBER |
I've created a I've extracted the boilerplate from @dcherian's
Yeah I guess it will work well with independent For multi-dimension coordinates with periodic boundaries this would probably be best handled by more specific indexes, e.g., xoak's s2point index that supports periodicity for lat/lon data (I think). |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Periodic Boundary Index 1372035441 | |
1247731386 | https://github.com/pydata/xarray/issues/7031#issuecomment-1247731386 | https://api.github.com/repos/pydata/xarray/issues/7031 | IC_kwDOAMm_X85KXt66 | benbovy 4160723 | 2022-09-15T08:03:50Z | 2022-09-15T08:03:50Z | MEMBER | Great @TomNicholas! To avoid copying the body of ```python class PeriodicBoundaryIndex(PandasIndex): """ An index representing any 1D periodic numberline.
``` Note: I also added It should work in most cases I think: ```python lon_coord = xr.DataArray(data=np.linspace(-180, 180, 19), dims="lon") da = xr.DataArray(data=np.random.randn(19), dims="lon", coords={"lon": lon_coord}) note the period set hereworld = da.drop_indexes("lon").set_xindex("lon", index_cls=PeriodicBoundaryIndex, period=360) ``` ```python world.sel(lon=200, method="nearest") <xarray.DataArray ()>array(-0.86583185)Coordinates:lon float64 -160.0world.sel(lon=[200, 200], method="nearest") <xarray.DataArray (lon: 2)>array([-0.86583185, -0.86583185])Coordinates:* lon (lon) float64 -160.0 -160.0world.sel(lon=slice(180, 200), method="nearest") <xarray.DataArray (lon: 2)>array([-1.59829997, -0.86583185])Coordinates:* lon (lon) float64 -180.0 -160.0``` There's likely more things to do for slices as you point out. I don't think either that it's possible to pass two slices to If we really need more flexibility in Or like you suggest we could define some |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Periodic Boundary Index 1372035441 | |
1246944137 | https://github.com/pydata/xarray/issues/7031#issuecomment-1246944137 | https://api.github.com/repos/pydata/xarray/issues/7031 | IC_kwDOAMm_X85KUtuJ | benbovy 4160723 | 2022-09-14T15:30:59Z | 2022-09-14T16:31:29Z | MEMBER |
Yes that's indeed what I've written in #6975 and I realize now that this is confusing, especially for
So we can describe the implementation of
This omits a few implementation details (special cases for multi-index), but that's basically how it works. I think it would help if such "how label-based selection works in Xarray" high-level description was added somewhere in the "Xarray internals" documentation, along with other "how it works" sections for, e.g., alignment. |
{ "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Periodic Boundary Index 1372035441 | |
1246398771 | https://github.com/pydata/xarray/issues/7031#issuecomment-1246398771 | https://api.github.com/repos/pydata/xarray/issues/7031 | IC_kwDOAMm_X85KSokz | benbovy 4160723 | 2022-09-14T08:08:26Z | 2022-09-14T08:08:26Z | MEMBER | tl;dr: Xarray There's a big difference now between
Most coordinate and data variables are still sliced via If we want to support periodic indexing with @TomNicholas your experiment makes it clear that the documentation on this part (#6975) should be improved. Thanks! |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Periodic Boundary Index 1372035441 |
Advanced export
JSON shape: default, array, newline-delimited, object
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]);
user 1