xarray-contrib/cf-xarray

Improve cfxr.set_options

Closed this issue · 3 comments

#234 will add a very simple version of OPTIONS.

We should copy over some logic from xarray: https://github.com/pydata/xarray/blob/4e61a26fca46635a5f6c1eba60950fc33d88459a/xarray/core/options.py

to get the context manager fanciness

So are you wanting to bring over from xarray the class and functions starting here?

https://github.com/pydata/xarray/blob/4e61a26fca46635a5f6c1eba60950fc33d88459a/xarray/core/options.py#L97

I'm not familiar with the logic here but I can do some pattern matching between cf-xarray and xarray for OPTIONS.

Yes I would copy over the whole file and start deleting things. The only option we have is "custom_criteria" and we don't need _SETTERS and _VALIDATORS AFAICT

PR #243