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

to_dataset_dict not setting time.encoding when decode_times=True #153

Closed
klindsay28 opened this issue Oct 16, 2019 · 2 comments · Fixed by #161
Closed

to_dataset_dict not setting time.encoding when decode_times=True #153

klindsay28 opened this issue Oct 16, 2019 · 2 comments · Fixed by #161
Labels
bug Issues that present a reasonable conviction there is a reproducible bug.

Comments

@klindsay28
Copy link

It looks like time.encoding is not being set when I read in multiple files with to_dataset_dict with decode_times=True.

When you write a dataset to netCDF with no time encoding, the resulting time units end up differing from the original datasets, which I find to be unexpected behavior.

Following pydata/xarray#1614, a potential behavior is to keep the encoding from the first file. I think this is already being done for attributes.

@klindsay28 klindsay28 added the bug Issues that present a reasonable conviction there is a reproducible bug. label Oct 16, 2019
@andersy005
Copy link
Member

@klindsay28, when you get time, can you try the master branch

pip install git+https://github.com/NCAR/intake-esm.git

and confirm that this is working properly?

@klindsay28
Copy link
Author

@andersy005, this update appears to be working.

I spot checked a couple of CMIP6 datasets for which to_dataset_dict was previously not setting time.encoding, and time.encoding is being set with the updated intake_esm.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues that present a reasonable conviction there is a reproducible bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants