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

Optionally include encoding in Dataset to_dict #6634

Closed
jhamman opened this issue May 24, 2022 · 0 comments · Fixed by #6635
Closed

Optionally include encoding in Dataset to_dict #6634

jhamman opened this issue May 24, 2022 · 0 comments · Fixed by #6635

Comments

@jhamman
Copy link
Member

jhamman commented May 24, 2022

Is your feature request related to a problem?

When using Xarray's to_dict methods to record a Dataset's schema, it would be useful to (optionally) include encoding in the output.

Describe the solution you'd like

The feature request may be resolved by simply adding an encoding keyword argument. This may look like this:

ds = xr.Dataset(...)
ds.to_dict(data=False, encoding=True)

Describe alternatives you've considered

It is currently possible to manually extract encoding attributes but this is a less desirable solution.

xref: pangeo-forge/pangeo-forge-recipes#256

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant