-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Set up new default values for kwargs on open_mfdataset
#10051
Conversation
) | ||
|
||
if "join" not in input_kwargs: | ||
# TODO: Figure out how conditions that xarray/tests/test_backends.py::TestDask::test_encoding_mfdataset |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am having a hard time figuring out how to catch the conditions that make xarray/tests/test_backends.py::TestDask::test_encoding_mfdataset fail with the new join kwarg. It seems like it has to do with the concat_dim in each dataset having a different encoding, but the values of the concat_dim in each dataset doe not overlap. So I'm a little wondering if the align index function is too strict.
f"in `open_mfdataset`. Previously the default was {old}", | ||
category=UserWarning, | ||
stacklevel=2, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are the warnings that are meant to provide extra context on failures when you set use_new_open_mfdataset_kwargs=True
and for a while after xarray switches to using the new defaults by default.
Thank you for working on this @jsignell ! Note that the scope of the changes implied by #8778 are larger than what you've done here - we also need to change the defaults in As |
Yes! I had that comment in my head at one point, but somehow misread it when I actually started working on this this week 🤦🏻
I agree this might be easier. It also involves passing the context that the user did not explicitly set the kwarg values between functions. It seems kind of nice to me to keep this kind of default kwarg-setting pretty high up in the chain. So maybe it's just a matter of abstracting the
I think having it all be one PR will be fine. |
That sounds like it could be a very neat way to abstract out this complexity. |
Ok new (still WIP) PR is up (#10062)! |
_get_default_open_mfdataset_kwargs
whats-new.rst
api.rst
This PR attempts to throw warnings if and only if the output would change with the new kwarg defaults. These are the steps I am going through:
Change the defaults and see which tests fail
13 failed
Add warnings and switch back to old defaults
13 failed
Notes
None
to indicate a kwarg value that the user has not explicitly set, but it might be preferable to instead use a special indicator value so you can't actually set the kwargs to None. The benefit of using that approach is that it makes it more obvious that people should not be setting these kwargs to None in their own code.open_mfdataset
succeeds but is different than before.