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

changes in precision on write changes answers #5

Open
matt-long opened this issue Nov 20, 2019 · 0 comments
Open

changes in precision on write changes answers #5

matt-long opened this issue Nov 20, 2019 · 0 comments

Comments

@matt-long
Copy link
Collaborator

Computation often defaults to double precision, but xarray writes data with encoding['dtype']. If encoding['dtype'] has been inherited from a previous file read, for instance, and does not match DataArray.values.dtype, xarray will truncate precision when writing the file.

This means that using an xpersist cache file might change answers of a computation, which is not desirable.

How to fix?

  • Write data at full precision (DataArray.values.dtype)
  • Retain the encoding information in the file and repopulate it on read.

cc @klindsay28

@matt-long matt-long changed the title changes in precision on write change answers changes in precision on write changes answers Nov 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant