Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arguments not passed to open_groups_as_dict function when opening a datatree #9427

Closed
aladinor opened this issue Sep 3, 2024 · 0 comments · Fixed by #9428
Closed

arguments not passed to open_groups_as_dict function when opening a datatree #9427

aladinor opened this issue Sep 3, 2024 · 0 comments · Fixed by #9428
Labels
io topic-DataTree Related to the implementation of a DataTree class

Comments

@aladinor
Copy link
Contributor

aladinor commented Sep 3, 2024

What is your issue?

Hi everyone,

I am trying to open a datatree I created, which looks as follows.

Group: /
├── Group: /group_0
│   │   Dimensions:  (x: 4, y: 5)
│   │   Coordinates:
│   │     * x        (x) int64 32B 10 20 30 40
│   │     * y        (y) datetime64[ns] 40B 2000-01-01 2000-01-02 ... 2000-01-05
│   │   Data variables:
│   │       foo      (x, y) float64 160B ...
│   ├── Group: /group_0/subgroup_1
│   └── Group: /group_0/subgroup_2
│       │   Dimensions:  (x: 4, y: 5, dim_0: 9)
│       │   Coordinates:
│       │     * x        (x) int64 32B 10 20 30 40
│       │     * y        (y) datetime64[ns] 40B 2000-01-01 2000-01-02 ... 2000-01-05
│       │   Dimensions without coordinates: dim_0
│       │   Data variables:
│       │       a        (dim_0) int64 72B ...
│       └── Group: /group_0/subgroup_2/subsubgroup_1
│           │   Dimensions:  (x: 4, y: 5, dim_0: 9)
│           │   Coordinates:
│           │     * x        (x) int64 32B 10 20 30 40
│           │     * y        (y) datetime64[ns] 40B 2000-01-01 2000-01-02 ... 2000-01-05
│           │   Dimensions without coordinates: dim_0
│           │   Data variables:
│           │       a        (dim_0) int64 72B ...
│           └── Group: /group_0/subgroup_2/subsubgroup_1/subsubsubnDimensions:  (x: 4, y: 5, dim_0: 9)
│                   Coordinates:
│                     * x        (x) int64 32B 10 20 30 40* y        (y) datetime64[ns] 40B 2000-01-01 2000-01-02 ... 2000-01-05

However, if I wanted to select and specific groups as follows

path = "/path/to/datatree/hdf_dtree_10.h5"
dtree = open_datatree(path, engine='h5netcdf', group="subgroup_1")

The output is the whole datatree. Digging around. I found out that some parameters passed to

groups_dict = self.open_groups_as_dict(filename_or_obj, **kwargs)
are missing, including the group parameter. A similar situation happens with netcdf4 datatrees

@aladinor aladinor added the needs triage Issue that has not been reviewed by xarray team member label Sep 3, 2024
@TomNicholas TomNicholas added topic-DataTree Related to the implementation of a DataTree class io and removed needs triage Issue that has not been reviewed by xarray team member labels Sep 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
io topic-DataTree Related to the implementation of a DataTree class
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants