home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 52455445

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions performed_via_github_app issue
https://github.com/pydata/xarray/issues/197#issuecomment-52455445 https://api.github.com/repos/pydata/xarray/issues/197 52455445 MDEyOklzc3VlQ29tbWVudDUyNDU1NDQ1 1217238 2014-08-18T06:10:39Z 2014-12-19T07:16:14Z MEMBER

Here's my current thinking on implementation: - [x] Dataset._coords_keys is a set that keeps track of the names of variables that are coordinates. This would let us implement Dataset.coords as a dict-like object with very little overhead for lookups. - [x] DataArray.dataset should go away from the public AP (use to_dataset() instead); more importantly, DataArray objects should only know about their coordinates, not any other aspects of the underlying dataset (it's a leaky abstraction). - [x] Dataset.__iter__ only only iterate over non-coordinates; but __contains__ and __getitem__ should be unchanged. - [x] Of course, we should automatically save and load coordinates according to CF conventions.

Also, we need some new methods to make this workable (modeled off of pandas's set_index and reset_index): - [x] Dataset.set_coords(keys, inplace=False) turns the variables in names into coordinates - [x] Dataset.reset_coords(keys=None, drop=False, inplace=False) removes all coordinates and turns them back into variables (unless drop=True). - [x] DataArray.reset_coords() would be very similar to the dataset method; it would return a Dataset unless unless drop=True (in which case it would return another DataArray). - [ ] set_index(keys, inplace=False) should be both a DataArray and Dataset method.

An important aspect is that using non-index coordinates (a power user feature) should be optional, just like how using and understanding Dataset objects should be optional.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  39264845
Powered by Datasette · Queries took 0.985ms · About: xarray-datasette