home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

5 rows where issue = 1444752393 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

  • naught101 2
  • benbovy 2
  • TomNicholas 1

author_association 2

  • MEMBER 3
  • NONE 2

issue 1

  • remap_label_indexers removed without deprecation update? · 5 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
1321361968 https://github.com/pydata/xarray/issues/7278#issuecomment-1321361968 https://api.github.com/repos/pydata/xarray/issues/7278 IC_kwDOAMm_X85OwmIw naught101 167164 2022-11-21T02:18:56Z 2022-11-21T02:18:56Z NONE

If it takes another couple of years to break, and need another re-write that's probably OK.

But if there is a better/more standard way to do what I'm trying to do, please let me know.

The underlying issue is that I have a netcdf with a RotatedPole grid (e.g. any of the CORDEX data), and I need to find the nearest grid point to a certain point. To do this, I map my point onto the RotatedPole projection (converting it from lat, lon, to x, y, or rlat, rlon), and then use the index mapping's nearest method to find the nearest grid point.

It didn't seem like there was an obvious way to do this with the actual API functions, so that's what I landed on.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  remap_label_indexers removed without deprecation update? 1444752393
1316230358 https://github.com/pydata/xarray/issues/7278#issuecomment-1316230358 https://api.github.com/repos/pydata/xarray/issues/7278 IC_kwDOAMm_X85OdBTW benbovy 4160723 2022-11-16T02:57:48Z 2022-11-16T02:57:48Z MEMBER

👍

Use it at your own risk 😉

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  remap_label_indexers removed without deprecation update? 1444752393
1316170523 https://github.com/pydata/xarray/issues/7278#issuecomment-1316170523 https://api.github.com/repos/pydata/xarray/issues/7278 IC_kwDOAMm_X85Ocysb naught101 167164 2022-11-16T01:54:24Z 2022-11-16T01:54:24Z NONE

Thank you, this is sufficient for me for now. I was able to replace

python nearest_point = remap_label_indexers(self.data, dict(x=x, y=y), method='nearest')[0]

with

python nearest_point = map_index_queries(self.data, dict(x=x, y=y), method='nearest').dim_indexers

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  remap_label_indexers removed without deprecation update? 1444752393
1311942192 https://github.com/pydata/xarray/issues/7278#issuecomment-1311942192 https://api.github.com/repos/pydata/xarray/issues/7278 IC_kwDOAMm_X85OMqYw benbovy 4160723 2022-11-11T16:52:54Z 2022-11-11T16:52:54Z MEMBER

You may look at the logic implemented in the map_index_queries() function in xarray.core.indexing. This function is still not public API, but it calls .sel() for each index object, which should be more stable (although experimental).

Eventually we'll probably make merge_sel_results() public too. It might be useful for third-party indexes.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  remap_label_indexers removed without deprecation update? 1444752393
1311911082 https://github.com/pydata/xarray/issues/7278#issuecomment-1311911082 https://api.github.com/repos/pydata/xarray/issues/7278 IC_kwDOAMm_X85OMiyq TomNicholas 35968931 2022-11-11T16:21:21Z 2022-11-11T16:21:21Z MEMBER

I realise that this was probably a function intended for internal use only

Yes, everything under xarray.core is internal, and unfortunately internal functions aren't publicly supported, so we provide no guarantee that they will still work/exist between versions.

Is there a better way to do this? What replaces this function?

@benbovy should know!

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  remap_label_indexers removed without deprecation update? 1444752393

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