-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
error when using broadcast_arrays with coordinates #649
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
Hi @rabernat, Most |
I know.
This only works if the all the arrays are appropriately shaped to begin with. It does not work in this case. np.broadcast_arrays(ds.x.values,ds.y.values,ds.a.values) raises |
Got it. Thanks! I guess I've been living around |
This is yet another issue that magically just works after merging #648! I'll add your example to the test suite as a regression test. I was actually holding off on widely advertising |
@shoyer awesome! |
I frequently use
broadcast_arrays
to to feed xray variables to non-xray libraries (e.g. gsw.) Often I need to broadcast the coordinates and variables in order to do call functions that take both as arguments.I have found that
broadcast_arrays
doesn't work as I expect with coordinates. For exampleThis raises
ValueError: an index variable must be defined with 1-dimensional data
.If I change the last line to
it works fine.
The text was updated successfully, but these errors were encountered: