Skip to content
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

Add broadcast_like? #2885

Closed
dcherian opened this issue Apr 10, 2019 · 5 comments · Fixed by #3086
Closed

Add broadcast_like? #2885

dcherian opened this issue Apr 10, 2019 · 5 comments · Fixed by #3086

Comments

@dcherian
Copy link
Contributor

What do you think of adding da.broadcast_like(a)?

This would be equivalent to xr.broadcast(a, da)[1]

@shoyer
Copy link
Member

shoyer commented Apr 11, 2019

Sounds good to me!

@fujiisoup
Copy link
Member

Can it be simply da.broadcast(a) or is it confusing?

@shoyer
Copy link
Member

shoyer commented Apr 11, 2019

Can it be simply da.broadcast(a) or is it confusing?

I think that would be a little confusing -- it's not clear whether the result should include a broadcast version of only da or also a.

@dcherian
Copy link
Contributor Author

Yeah broadcast_like would be less confusing and the similarity to reindex_like and interp_like is really nice.

@fujiisoup
Copy link
Member

That makes sense. Convinced.

@dcherian dcherian pinned this issue Jun 27, 2019
dcherian added a commit to dcherian/xarray that referenced this issue Jul 6, 2019
dcherian added a commit to dcherian/xarray that referenced this issue Jul 6, 2019
@dcherian dcherian mentioned this issue Jul 6, 2019
3 tasks
shoyer pushed a commit that referenced this issue Jul 14, 2019
* Add broadcast_like.

Closes #2885

* lint.

* lint2

* Use a helper function

* lint
@dcherian dcherian unpinned this issue Jul 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants