home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

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

  • shoyer 3
  • ms8r 2

author_association 2

  • MEMBER 3
  • NONE 2

issue 1

  • Dataset.__delitem__() kills dimensions dictionary · 5 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
36970906 https://github.com/pydata/xarray/issues/32#issuecomment-36970906 https://api.github.com/repos/pydata/xarray/issues/32 MDEyOklzc3VlQ29tbWVudDM2OTcwOTA2 shoyer 1217238 2014-03-07T06:15:36Z 2014-03-07T06:15:36Z MEMBER

Closing this issue since it was resolved by #34 (now merged into master).

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Dataset.__delitem__() kills dimensions dictionary 28575097
36469527 https://github.com/pydata/xarray/issues/32#issuecomment-36469527 https://api.github.com/repos/pydata/xarray/issues/32 MDEyOklzc3VlQ29tbWVudDM2NDY5NTI3 shoyer 1217238 2014-03-02T22:23:08Z 2014-03-03T02:23:19Z MEMBER

OK, I just added squeeze back in PR #34.

One change I made from in indexed_by from views is that it automatically squeezes out dimensions if you give an integer as the indexer. So fcst.indexed_by(height_above_ground=0) removes the height_above_ground dimension. If you wanted to keep that dimension with size 1, you would need to do fcst.indexed_by(height_above_ground=slice(0, 1)) or fcst.indexed_by(height_above_ground=[0]). This behavior is more consistent with numpy, especially because I use indexed_by under the hood for indexing with DatasetArray objects.

Your suggestion for __delitem__ is interesting but with the current implementation of squeeze (and indexed_by more generally) I'm not sure how to make it work, because we currently have to load a variable into memory as a numpy array to squeeze out a dimension. This means that deleting a variable could cause other variables to be loaded. My expectation (in general) is that deleting an item should only release resources, and do so in a fairly lightweight fashion.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Dataset.__delitem__() kills dimensions dictionary 28575097
36472462 https://github.com/pydata/xarray/issues/32#issuecomment-36472462 https://api.github.com/repos/pydata/xarray/issues/32 MDEyOklzc3VlQ29tbWVudDM2NDcyNDYy ms8r 6509590 2014-03-02T23:55:51Z 2014-03-02T23:55:51Z NONE

Many thanks! I hadn't realized the indexed_by behavior for integer indexers - that's great. In that case my __delitem__ suggestion becomes superfluous anyway, since what I described can be achieved by indexed_by as it appears.

The new polyglot aka xray looks very impressive - and the name is cool...

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Dataset.__delitem__() kills dimensions dictionary 28575097
36467822 https://github.com/pydata/xarray/issues/32#issuecomment-36467822 https://api.github.com/repos/pydata/xarray/issues/32 MDEyOklzc3VlQ29tbWVudDM2NDY3ODIy ms8r 6509590 2014-03-02T21:33:17Z 2014-03-02T21:33:17Z NONE

Many thanks for the clarification. np.squeeze was used in slocum to remove a dimension that had been shrunk down to one value (then via views, now via indexed_by). The idea was to get the resulting Dataset as small as possible before dumping it and sending it over a very low bandwidth email link. If a dimension with only one element (like height_above_ground in the example) can be neglected in terms of size impact, it's not worth the trouble with np.squeeze. Otherwise it would be nice to have it back. Thanks in any case.

I think the right behavior would be to delete every variable that uses the dimension.

How about deleting it from every variable that uses the dimension to be deleted, and only keep index 0 if there were multiple values along that dimension. That would seem closer to what happens in a n-dimensional coordinate system if I get rid of one axis?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Dataset.__delitem__() kills dimensions dictionary 28575097
36462034 https://github.com/pydata/xarray/issues/32#issuecomment-36462034 https://api.github.com/repos/pydata/xarray/issues/32 MDEyOklzc3VlQ29tbWVudDM2NDYyMDM0 shoyer 1217238 2014-03-02T18:37:38Z 2014-03-02T18:37:38Z MEMBER

I removed Dataset.squeeze because I've never actually had a use-case for np.squeeze. But it would be very easy to bring it back if you find it genuinely useful. The equivalent in the current version of xray would be fcst.indexed_by(height_above_ground=0), which would select out (a view) of the 0th element along the forecast dimension.

__delitem__ is intended to remove a variable from a dataset but I have not tested it very carefully. Since every dimension is a variable, I think the right behavior would be to delete every variable that uses the dimension. So the later behavior you found is definitely not right! I'll see if I can put in a fix for that.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Dataset.__delitem__() kills dimensions dictionary 28575097

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