issue_comments: 350879291
This data as json
| html_url | issue_url | id | node_id | user | created_at | updated_at | author_association | body | reactions | performed_via_github_app | issue |
|---|---|---|---|---|---|---|---|---|---|---|---|
| https://github.com/pydata/xarray/issues/1773#issuecomment-350879291 | https://api.github.com/repos/pydata/xarray/issues/1773 | 350879291 | MDEyOklzc3VlQ29tbWVudDM1MDg3OTI5MQ== | 1217238 | 2017-12-11T22:27:58Z | 2017-12-11T22:27:58Z | MEMBER | It seems that sympy functions returned by lambdfy may not work on arbitrary dimensional inputs, or might not follow broadcasting rules. The workaround might be something like: ```python def vector_func_wrapper(dx, dy, dz, dt): dx, dy, dz, dt = np.broadcast_arrays(dx, dy, dz, dt) # explicitly broadcast args = [a.ravel() for a in [dx, dy, dz, dt]] # convert everything to a vector return vector_funcN(*args).reshape(dx.shape) xarray.apply_ufunc(vector_func_wrapper, dx, dy, dz, dt) ``` |
{
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0,
"rocket": 0,
"eyes": 0
} |
280899335 |