Skip to content
This repository has been archived by the owner on Oct 24, 2024. It is now read-only.

Losing top level name attribute when saving and then reopening using h5netcdf #339

Closed
melonora opened this issue Jul 30, 2024 · 4 comments
Closed
Labels
bug Something isn't working

Comments

@melonora
Copy link

Hello!

I have a datatree that looks like this:

DataTree('my_container', parent=None)
│   Dimensions:           (y: 2, x: 2)
│   Dimensions without coordinates: y, x
│   Data variables:
│       latitude_series   (y, x) float64 32B 1.0 2.0 3.0 4.0
│       longitude_series  (y, x) float64 32B 5.0 6.0 7.0 8.0
└── DataTree('temperature_dataset')
        Dimensions:            (date: 2, x: 2, y: 2)
        Coordinates:
          * date               (date) datetime64[ns] 16B 2020-01-01 2020-01-02
            day_in_d           (date) int32 8B 0 1
        Dimensions without coordinates: x, y
        Data variables:
            temperatures_in_K  (x, y, date) float64 64B 0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0
        Attributes:
            name:               my_temperature
            latitude_in_deg:    my_latitude
            longitude_in_deg:   my_longitude
            reference_date:     2020-01-01
            conversion_factor:  1000.0

After saving with engine set to h5netcdfand then reopening with the same engine, I lose the name my_container of the root of the datatree structure. Any idea as to why?

@TomNicholas
Copy link
Member

Hi @melonora ! Thanks for raising this.

We are just in the process of deprecating this repo in favour of xarray's main repository. Would you mind trying again but using xarray.core.datatree.DataTree and xarray.backends.api.open_datatree instead, and if it still happens re-raise this issue on the main xarray issue tracker?

@TomNicholas TomNicholas added the bug Something isn't working label Jul 30, 2024
@melonora
Copy link
Author

Thanks for the quick response! I will check

@melonora
Copy link
Author

Issue persists, will open an issue on the main repo

@melonora
Copy link
Author

Opened here. Closing this issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants