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

Remove cf-encoding workaround #1887

Open
aulemahal opened this issue Aug 20, 2024 · 0 comments
Open

Remove cf-encoding workaround #1887

aulemahal opened this issue Aug 20, 2024 · 0 comments
Assignees

Comments

@aulemahal
Copy link
Collaborator

The encoding of cftime coordinates within sdba's map_blocks could be removed as the upstream issue in xarray seems to be fixed : pydata/xarray#5701. I don't know how it got fixed, but I believe the snippet below (and some other) and the xclim options can be safely removed. Or I guess the option should stay for 1 or 2 versions and emit a warning.

xclim/xclim/sdba/base.py

Lines 675 to 683 in 7acc410

if OPTIONS[SDBA_ENCODE_CF]:
ds = ds.copy()
# Optimization to circumvent the slow pickle.dumps(cftime_array)
# List of the keys to avoid changing the coords dict while iterating over it.
for crd in list(ds.coords.keys()):
if xr.core.common._contains_cftime_datetimes(
ds[crd].variable
): # noqa
ds[crd] = xr.conventions.encode_cf_variable(ds[crd].variable)

FYI for xsdba, @coxipi

@aulemahal aulemahal self-assigned this Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

1 participant