home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 370221802

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/1961#issuecomment-370221802 https://api.github.com/repos/pydata/xarray/issues/1961 370221802 MDEyOklzc3VlQ29tbWVudDM3MDIyMTgwMg== 4160723 2018-03-04T11:32:23Z 2018-03-04T14:12:06Z MEMBER

As an example, in xgcm we would have something like

```python

ds = ds_original.xgcm.generate(...) ds.xgcm.interp(‘var’, axis=‘X’) ```

instead of

```python

ds = xgcm.generate_grid_ds(ds_original, ...) grid = xgcm.Grid(ds) grid.interp(ds.var, axis=‘X’) ```

The advantage in the first example is that the information on the grid’s physical axes is bound to a Dataset object (as coordinate wrappers), so we don’t need to deal with any instance of another class (i.e., Grid in the second example) to perform grid operations like interpolation on a given axis, which can rather be implemented into a Dataset accessor (i.e., Dataset.xgcm in the first example).

@rabernat I don't have much experience with xgcm so maybe this isn't a good example?

I guess we could just use Dataset attributes and/or private instance attributes in the Dataset accessor class for that, but

  • coordinate attributes are not really made for storing complex information
  • attributes in the accessor class are lost when creating a new Dataset
  • important information like grid axes should be exposed to the user
{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  302077805
Powered by Datasette · Queries took 0.52ms · About: xarray-datasette