issues: 373646673
This data as json
id | node_id | number | title | user | state | locked | assignee | milestone | comments | created_at | updated_at | closed_at | author_association | active_lock_reason | draft | pull_request | body | reactions | performed_via_github_app | state_reason | repo | type |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
373646673 | MDU6SXNzdWUzNzM2NDY2NzM= | 2507 | Error when applying a function with apply_ufunc() when using a function that returns multiple arrays | 1328158 | closed | 0 | 5 | 2018-10-24T19:42:49Z | 2018-10-29T05:07:06Z | 2018-10-29T05:07:06Z | NONE | Code Sample, a copy-pastable example if possibleYou can reproduce this error I think by using the code found here: https://github.com/monocongo/climate_indices/tree/issue_191_groupby To exercise the code where the error occurs run the following command:
```python # stack the lat and lon dimensions into a new dimension named point, so at each lat/lon # we'll have a time series for the geospatial point, and group by these points da_precip_groupby = da_precip.stack(point=('lat', 'lon')).groupby('point') da_pet_groupby = da_pet.stack(point=('lat', 'lon')).groupby('point') da_awc_groupby = da_awc.stack(point=('lat', 'lon')).groupby('point')
``` Problem descriptionI have a function that I apply to The function I'm using returns five arrays. The signature is this:
I'm applying the function over three
When I run the code I get the following error:
When I step through the xarray computation.py code I see that the result data is returned as a list of arrays rather than as a tuple, and this is what raises the error (line 565 in computation.py). I've tried modifying the function to return the arrays as a tuple, along with marking the function's return type as a tuple in the signature but none of this has helped, i.e. the result data always comes through to xarray as a list of arrays rather than as a tuple. I am using xarray version 0.10.9 with Python 3.6. Expected OutputI was expecting to get the five arrays returned after applying the function. I may be doing something else wrong, as this is my first time using appy_ufunc() in this way, and if so please advise. Output of
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/2507/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | 13221727 | issue |