-
Notifications
You must be signed in to change notification settings - Fork 41
warn at import time if xr.core.options.OPTIONS["keep_attrs"] is False #77
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
Comments
I think it would be good to include the warning, but perhaps give the option to disable it with a cf-xarray option or environment variable if the user wants |
but you can't set a cf_xarray option without importing it first which would show a warning ;) to be clear, this warning will only be shown once at import time not on every operation. |
Ah, so an environment variable it would have to be! |
turns out the default is |
Even better! |
One (minor) issue with implementing this is that linters will format code to something like import cf_xarray # will raise warning here.
import xarray
xr.set_options(keep_attrs=True) making the warning useless. |
Maybe say something like
This may be annoying though. We should definitely mention this in the docs (#73)
The text was updated successfully, but these errors were encountered: