-
-
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
Follow keep_attrs in Dataset binary ops #7391
Follow keep_attrs in Dataset binary ops #7391
Conversation
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 for the PR, @arongergely, and sorry for the delayed reply.
If possible I'd like to change the computation of the attrs
of the result a bit to allow more than just bool
values (see below).
And yes, a entry to whats-new.rst
would be great (section "Bug fixes").
Thanks for your suggestions @keewis!
I was puzzled initially. We would introduce the I like the idea, shouldn't we
could do all these, let me know |
The missing documentation for this in
I always struggle with classifying changes, but I guess the more we add onto this PR, the more it becomes a new feature.
probably. The only reason this is not done yet is because nobody took the time to actually do it. So, once again: PRs very welcome! |
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.
accept non-boolean keep_attrs arguments Co-authored-by: Justus Magin <[email protected]>
Hit a roadblock. For binary ops the only way to set with xr.set_options(keep_attrs="drop_conflicts"):
ds1 + ds2 To cricle around this we could let ds1.__add__(ds2, keep_attrs="drop_conflicts") But this isn't "nice". Or perhaps I missed something? |
Changing the option setters to accept |
I guess this means that we have two options: just assume this does not cause anything else to fail to get this PR to work (but then this PR would be blocked until we fixed every use of the global Option 2 seems easier, so I'd suggest we go with that? |
Agreed! |
Will you cherry pick? |
maybe not. I changed it back so you could squash to exclude the noise. |
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, @arongergely. We always squash-merge so this is basically what I would have done.
Thanks @arongergely ! |
Dataset
binary ops ignorekeep_attrs
option #7390whats-new.rst
Should I describe in
whats-new.rst
?