home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

11 rows where issue = 376167325 sorted by updated_at descending

✖
✖

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 4

  • lilyminium 5
  • max-sixty 3
  • shoyer 2
  • pep8speaks 1

author_association 3

  • CONTRIBUTOR 5
  • MEMBER 5
  • NONE 1

issue 1

  • Check shapes of coordinates and data during DataArray construction · 11 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
851783635 https://github.com/pydata/xarray/pull/2533#issuecomment-851783635 https://api.github.com/repos/pydata/xarray/issues/2533 MDEyOklzc3VlQ29tbWVudDg1MTc4MzYzNQ== max-sixty 5635139 2021-06-01T03:47:01Z 2021-06-01T03:47:01Z MEMBER

Nice, that seems to work!

Is anyone else more familiar with whether using context in this way is reasonable?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Check shapes of coordinates and data during DataArray construction 376167325
851688260 https://github.com/pydata/xarray/pull/2533#issuecomment-851688260 https://api.github.com/repos/pydata/xarray/issues/2533 MDEyOklzc3VlQ29tbWVudDg1MTY4ODI2MA== lilyminium 31115101 2021-05-31T21:22:01Z 2021-05-31T21:22:01Z CONTRIBUTOR

context

I can only find references regarding ufuncs in the numpy docs when I look up the context. I would think that in that case the shapes should be fine, but please do correct me if not?

_unary_op calls __array_wrap__(context=None); if the function only checks the shape when context is None and a dummy value gets passed in for the context, that's one way to avoid it.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Check shapes of coordinates and data during DataArray construction 376167325
434854143 https://github.com/pydata/xarray/pull/2533#issuecomment-434854143 https://api.github.com/repos/pydata/xarray/issues/2533 MDEyOklzc3VlQ29tbWVudDQzNDg1NDE0Mw== pep8speaks 24736507 2018-10-31T21:28:14Z 2021-05-31T21:16:46Z NONE

Hello @lilyminium! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! :beers:

Comment last updated at 2021-05-31 21:16:46 UTC
{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Check shapes of coordinates and data during DataArray construction 376167325
851631521 https://github.com/pydata/xarray/pull/2533#issuecomment-851631521 https://api.github.com/repos/pydata/xarray/issues/2533 MDEyOklzc3VlQ29tbWVudDg1MTYzMTUyMQ== max-sixty 5635139 2021-05-31T18:38:43Z 2021-05-31T18:38:43Z MEMBER

Hmmmm. It's been quite some time since I've last used xarray, but I'm not sure I see an easy way to:

1. hijack np.insert (which I would guess goes directly to `DataArray.__array_wrap__ / __array_finalize__`)

2. without passing a `fastpath`-like argument to `__array_wrap__`, but

3. efficiently not checking the shape of safe operations, like `_unary_op`.

I think that's exactly correct. Without being able to tell __array_wrap__ from _unary_op that we don't need to check the sizes, they all follow the same path. Is it possible to use the context arg for this? I don't think it's sufficiently flexible from an initial glance of the docs.

Maybe this new implementation has a low enough overhead that it's worthwhile?

If we do go ahead — what about calling _check_shape_consistency from within __array_wrap__ after creating the object, instead of adding the fastpath kwarg?

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Check shapes of coordinates and data during DataArray construction 376167325
851614917 https://github.com/pydata/xarray/pull/2533#issuecomment-851614917 https://api.github.com/repos/pydata/xarray/issues/2533 MDEyOklzc3VlQ29tbWVudDg1MTYxNDkxNw== lilyminium 31115101 2021-05-31T17:46:49Z 2021-05-31T17:46:49Z CONTRIBUTOR

The 3.7 test looks like an installation error.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Check shapes of coordinates and data during DataArray construction 376167325
851599339 https://github.com/pydata/xarray/pull/2533#issuecomment-851599339 https://api.github.com/repos/pydata/xarray/issues/2533 MDEyOklzc3VlQ29tbWVudDg1MTU5OTMzOQ== lilyminium 31115101 2021-05-31T17:01:25Z 2021-05-31T17:01:25Z CONTRIBUTOR

Hmmmm. It's been quite some time since I've last used xarray, but I'm not sure I see an easy way to:

  1. hijack np.insert (which I would guess goes directly to DataArray.__array_wrap__ / __array_finalize__)
  2. without passing a fastpath-like argument to __array_wrap__, but
  3. efficiently not checking the shape of safe operations, like _unary_op.

I have for now stuck fastpath in _replace but it fails condition 3 and just runs for all calls to __array_wrap__.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Check shapes of coordinates and data during DataArray construction 376167325
850606084 https://github.com/pydata/xarray/pull/2533#issuecomment-850606084 https://api.github.com/repos/pydata/xarray/issues/2533 MDEyOklzc3VlQ29tbWVudDg1MDYwNjA4NA== lilyminium 31115101 2021-05-28T18:55:14Z 2021-05-28T18:55:14Z CONTRIBUTOR

Ooh, this is a blast from the past. Anyone passing by, feel free to pick this up if you like, otherwise I'll see what I can do over the weekend :)

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Check shapes of coordinates and data during DataArray construction 376167325
850580427 https://github.com/pydata/xarray/pull/2533#issuecomment-850580427 https://api.github.com/repos/pydata/xarray/issues/2533 MDEyOklzc3VlQ29tbWVudDg1MDU4MDQyNw== max-sixty 5635139 2021-05-28T18:00:05Z 2021-05-28T18:00:05Z MEMBER

This would still be valuable if @lilyminium (or someone else, if they're not interested) would want to finish this off.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Check shapes of coordinates and data during DataArray construction 376167325
436498217 https://github.com/pydata/xarray/pull/2533#issuecomment-436498217 https://api.github.com/repos/pydata/xarray/issues/2533 MDEyOklzc3VlQ29tbWVudDQzNjQ5ODIxNw== shoyer 1217238 2018-11-07T04:07:59Z 2018-11-07T04:07:59Z MEMBER

Does adding fastpath to skip shape checking in array_wrap work? fastpath=True in both DataArray.array_wrap and Variable.array_wrap didn't seem to break any tests.

I think it would be slightly better to stick with a separate method for xarray's fast-path. __array_wrap__ is a special protocol used by NumPy, so there's always a (unlikely) risk that if we use different arguments in our version it could break in the future.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Check shapes of coordinates and data during DataArray construction 376167325
436474639 https://github.com/pydata/xarray/pull/2533#issuecomment-436474639 https://api.github.com/repos/pydata/xarray/issues/2533 MDEyOklzc3VlQ29tbWVudDQzNjQ3NDYzOQ== lilyminium 31115101 2018-11-07T01:50:06Z 2018-11-07T01:50:06Z CONTRIBUTOR

I think the clean way to fix this would be to add error checking to DataArray.__array_wrap__. But we currently use this method inside DataArray._unary_op (and maybe elsewhere?), which is called every time you do unwary math with an xarray object (e.g., -). We’ll want to update these uses to use a method that uses the same shortcut to avoid redundant metadata checks.

Does adding fastpath to skip shape checking in array_wrap work? fastpath=True in both DataArray.array_wrap and Variable.array_wrap didn't seem to break any tests.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Check shapes of coordinates and data during DataArray construction 376167325
435271342 https://github.com/pydata/xarray/pull/2533#issuecomment-435271342 https://api.github.com/repos/pydata/xarray/issues/2533 MDEyOklzc3VlQ29tbWVudDQzNTI3MTM0Mg== shoyer 1217238 2018-11-02T04:57:31Z 2018-11-02T04:57:31Z MEMBER

@lilyminium thanks for looking into this! I think the specific problem here is due to our use of the shortcut _replace method in DataArray.__array_wrap__ (which is called by NumPy, e.g., inside np.insert): https://github.com/pydata/xarray/blob/6d55f99905d664ef73cb708cfe8c52c2c651e8dc/xarray/core/dataarray.py#L193

I think the clean way to fix this would be to add error checking to DataArray.__array_wrap__. But we currently use this method inside DataArray._unary_op (and maybe elsewhere?), which is called every time you do unwary math with an xarray object (e.g., -). We’ll want to update these uses to use a method that uses the same shortcut to avoid redundant metadata checks.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Check shapes of coordinates and data during DataArray construction 376167325

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