-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Dataset.broadcast_like(other)
should broadcast against like variables in other
#6549
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
see also #6304 which covers |
I tried adding a |
related to #6227 |
I keep misunderstanding this issue so typing this out to make sure I got it right. Writing out dimension names in square brackets ds['a': 'x', 'b': 'z'].broadcast_like(da: ['x', 'y']) -> ds['a': ['x', y'], 'b': ['x', 'y', 'z']] IIUC the request is to avoid broadcasting the variables in |
Dataset.broadcast_like(other)
should broadcast against like variables in other
@mjwillson posted a nice summary in #10031 :
|
In the light of #10031, and broadcasting a dataset to itself not behaving as a no-op, should we label this as "bug" rather than "enhancement"? |
Is your feature request related to a problem?
I am a bit puzzled about how xarrays is broadcasting Datasets.
It seems to always add all dimensions to all variables.
Is this what you want in general?
See this example:
Describe the solution you'd like
I would like broadcasting to behave the same way as e.g. a simple addition.
In the upper example
da + ds
produces the dimensions that I want.Describe alternatives you've considered
ds + xr.zeros_like(da)
this works, but seems more like a "dirty hack".Additional context
Maybe one can add an option to broadcasting that controls this behavior?
The text was updated successfully, but these errors were encountered: