-
-
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
implement map_over_datasets kwargs #10012
implement map_over_datasets kwargs #10012
Conversation
c9d6bc0
to
3c07cce
Compare
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.
This looks good! Though needs some docs, even just the docstring.
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.
Thanks. One question on the implementation.
Yes, please suggest or add as you see fit. |
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 guess "Allow kwargs in map_over_datasets
" is enough for the changelog entry.
I'll approve. Just want to add, that the old implementation allowed the kwargs
to be a DataTree
, while this does not (I assume this is a deliberate decision in the re-implementation?). I don't want to hold up this PR for this reason but just remark that this makes using it ever so slightly more annoying, i.e. you may have to re-arrange your inputs to accommodate for it.
The implementation as of this PR matches |
xarray/core/datatree.py
Outdated
*args : tuple, optional | ||
Positional arguments passed on to `func`. |
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.
Should we show / state that the *args
can be DataTree
s while the kwargs
cannot? This is shown clearly in the apply_ufunc
docstring.
Co-authored-by: Mathias Hauser <[email protected]>
@TomNicholas Is this now more explicit in the docstring? |
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.
Thank you @kmuehlbauer - just one nit, but I'm approving.
Thanks! |
kwargs
inmap_over_datasets
? #10009whats-new.rst
api.rst