home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

3 rows where issue = 1664193419 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

  • headtr1ck 2
  • LunarLanding 1

author_association 2

  • COLLABORATOR 2
  • NONE 1

issue 1

  • diff('non existing dimension') does not raise exception · 3 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
1506592074 https://github.com/pydata/xarray/issues/7748#issuecomment-1506592074 https://api.github.com/repos/pydata/xarray/issues/7748 IC_kwDOAMm_X85ZzMVK LunarLanding 4441338 2023-04-13T08:51:47Z 2023-04-13T08:51:47Z NONE

My user story is that I had up to some point a DataArray with index 'a', at some point code changed and I used as index 'b', but some code was still operating on 'a'; and I expected that code to error on accessing 'a'.

If I do np.diff(x,axis=(some non-existent axis)), numpy errors.

I might be generalizing, please correct me if I'm wrong, but afaik broadcasting happens in operations with 2 or more arrays, and the resulting dimensions are the union of the dimensions of each input array; the dimensions operated on are always at least in one of the involved arrays. Broadcasting does not happen if the arrays have the same shape, as it is for the diff operation.

So by following the same logic, when using an unary operator on a Dataset, an error should be thrown if none of the contained variables have the requested dimension. Since xarray allows scalar-sized dimensions (where the index shape is () ), those could be used to keep current behavior.

I read the linked issue. imho, the operation on a DataArray should error if the dimension is not there; on a Dataset the operation should be applied to each DataArray that contains the dimension, and if there are none, an error should be thrown. i.e. (set of dimensions allowed as arguments to operators on a set of containers) = ( union of the dimensions in each container).

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  diff('non existing dimension') does not raise exception 1664193419
1506550069 https://github.com/pydata/xarray/issues/7748#issuecomment-1506550069 https://api.github.com/repos/pydata/xarray/issues/7748 IC_kwDOAMm_X85ZzCE1 headtr1ck 43316012 2023-04-13T08:20:24Z 2023-04-13T08:20:24Z COLLABORATOR

See also somewhat related discussion here https://github.com/pydata/xarray/issues/6749

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  diff('non existing dimension') does not raise exception 1664193419
1506544631 https://github.com/pydata/xarray/issues/7748#issuecomment-1506544631 https://api.github.com/repos/pydata/xarray/issues/7748 IC_kwDOAMm_X85ZzAv3 headtr1ck 43316012 2023-04-13T08:16:11Z 2023-04-13T08:16:11Z COLLABORATOR

Not sure what the correct way would be.

If you consider that d f(x) / d y = 0, maybe all zeros could be considered correct as well. The same result can be obtained if one considers that the array might be broadcast to the y-dim.

Also we have to check that happens in Datasets if one of the variables does not contain this dimension, do we raise an error as well?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  diff('non existing dimension') does not raise exception 1664193419

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