home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

2 rows where issue = 806218687 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 2

  • max-sixty 1
  • martinitus 1

author_association 2

  • MEMBER 1
  • NONE 1

issue 1

  • disallow boolean coordinates? · 2 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
810959744 https://github.com/pydata/xarray/issues/4892#issuecomment-810959744 https://api.github.com/repos/pydata/xarray/issues/4892 MDEyOklzc3VlQ29tbWVudDgxMDk1OTc0NA== martinitus 7611856 2021-03-31T10:30:49Z 2021-03-31T10:30:49Z NONE

I don't know the internals of delegation between .sel and .isel. But from the user side I would expect that boolean indexing requires me to use .isel naturally. I mean, I have to provide a boolean mask that fits the shape of the array, i.e. it is naturally index based and should only be used with .isel irrespective of the coordinate types.

While that probably be a breaking change for some people, I think it makes a quite complicated topic slightly easier to document, and figure out intentions in written code.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  disallow boolean coordinates? 806218687
803491262 https://github.com/pydata/xarray/issues/4892#issuecomment-803491262 https://api.github.com/repos/pydata/xarray/issues/4892 MDEyOklzc3VlQ29tbWVudDgwMzQ5MTI2Mg== max-sixty 5635139 2021-03-21T00:35:57Z 2021-03-21T00:35:57Z MEMBER

It's a good issue!

I would have thought .sel should default to using labels. I recognize that boolean indexing is really helpful — and think we should try and support it more (e.g. https://github.com/pydata/xarray/issues/1887).

And I recognize .sel delegates to .isel in some cases — e.g. where there are no indexes on a dimension.

But here, I propose we prioritize the labels above the boolean indexing in .sel. People can still use .isel if they want bool indexing in the method call syntax:

```python

In [4]: test = xr.DataArray( ...: np.ones((3,2)), ...: dims=["ternary","binary"], ...: coords={"ternary":[3,7,9],"binary":[False,True]} ...: )

In [5]: test.sel(binary=[True,False]) Out[5]: <xarray.DataArray (ternary: 3, binary: 1)> array([[1.], [1.], [1.]]) Coordinates: * ternary (ternary) int64 3 7 9 * binary (binary) bool False

In [6]: test.isel(binary=[True,False]) Out[6]: <xarray.DataArray (ternary: 3, binary: 1)> array([[1.], [1.], [1.]]) Coordinates: * ternary (ternary) int64 3 7 9 * binary (binary) bool False ```

I would also be OK removing the .sel delegation to .isel if it causes complications. IIUC the main use case is a single method call to index labels and dimensions without labels. But that's easy to replace with two method calls, I think?

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  disallow boolean coordinates? 806218687

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