Ouranosinc / xscen

A climate change scenario-building analysis framework.
https://xscen.readthedocs.io/
Apache License 2.0
15 stars 2 forks source link

Use sdba options for xclim by default #363

Closed aulemahal closed 6 months ago

aulemahal commented 6 months ago

Pull Request Checklist:

What kind of change does this PR introduce?

Instead of setting the options only when calling xclim's adjust, we set the options globally at import time.

This fixes the subtle issue noted in Ouranosinc/xclim#1674 : the context options are not seen by all code when dask-backed data is used. as the actual computation occurs outside of the context.

It also allows to change these options at run time. xc.set_options(sdba_encode_cf=False) will fix #362, for example. This was not possible earlier as the option context was within the function and couldn't be modified by the user.

Does this PR introduce a breaking change?

Yes, issue #362 will now occur on dask arrays too, until xclim's PR is merged. But it can be circumvented as shown above.

review-notebook-app[bot] commented 6 months ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB