home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 187859705

This data as json

id node_id number title user state locked assignee milestone comments created_at updated_at closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
187859705 MDU6SXNzdWUxODc4NTk3MDU= 1092 Dataset groups 4160723 closed 0     20 2016-11-07T23:28:36Z 2021-07-02T19:56:50Z 2021-07-02T19:56:49Z MEMBER      

EDIT: see https://github.com/pydata/xarray/issues/4118 for ongoing discussion


Probably it has been already suggested, but similarly to netCDF4 groups it would be nice if we could access Dataset data variables, coordinates and attributes via groups.

Currently xarray allows loading a specific netCDF4 group into a Dataset. Different groups can be loaded as separate Dataset objects, which may be then combined into a single, flat Dataset. Yet, in some cases it makes sense to represent data as a single object while it would be convenient to keep some nested structure. For example, a Dataset representing data on a staggered grid might have scalar_vars and flux_vars groups. Here are some potential uses for groups. When there are a lot of data variables and/or attributes, it would also help to have a more concise repr.

I think about an implementation of Dataset.groups that would be specific to xarray, i.e., independent of any backend, and which would easily co-exist with the flat Dataset. It shouldn't be required for a backend to support groups (some existing backends simply don't). It is up to each backend to eventually transpose the Dataset.groups logic to its own group logic.

Dataset.groups might return a DatasetGroups object, which quite similarly to xarray.core.coordinates.DatasetCoordinates would (1) have a reference to the Dataset object, (2) basically consist of a Mapping of group names to data variable/coordinate/attribute names and (3) dynamically create another Dataset object (sub-dataset) on __getitem__. Keys of Dataset.groups should be accessible as attributes , e.g., ds.groups['scalar_vars'] == ds.scalar_vars.

Questions:

  • How to handle hierarchies of > 1 levels (i.e., groups of groups...)?
  • How to ensure that a variable / attribute in one group is not also present in another group?
  • Case of methods called from groups with inplace=True?
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/1092/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed 13221727 issue

Links from other tables

  • 0 rows from issues_id in issues_labels
  • 20 rows from issue in issue_comments
Powered by Datasette · Queries took 319.82ms · About: xarray-datasette