issues: 528701910
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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
528701910 | MDU6SXNzdWU1Mjg3MDE5MTA= | 3574 | apply_ufunc with dask='parallelized' and vectorize=True fails on compute_meta | 941907 | closed | 0 | 12 | 2019-11-26T12:45:55Z | 2020-01-22T15:43:19Z | 2020-01-22T15:43:19Z | NONE | MCVE Code Sample```python import numpy as np import xarray as xr ds = xr.Dataset({ 'signal': (['das_time', 'das', 'record'], np.empty((1000, 120, 45))), 'min_height': (['das'], np.empty((120,))) # each DAS has a different resolution }) def some_peak_finding_func(data1d, min_height): """process data1d with contraints by min_height""" result = np.zeros((4,2)) # summary matrix with 2 peak characteristics return result ds_dask = ds.chunk({'record':3}) xr.apply_ufunc(some_peak_finding_func, ds_dask['signal'], ds_dask['min_height'], input_core_dims=[['das_time'], []], # apply peak finding along trace output_core_dims=[['peak_pos', 'pulse']], vectorize=True, # up to here works without dask! dask='parallelized', output_sizes={'peak_pos': 4, 'pulse':2}, output_dtypes=[np.float], ) ``` fails with Expected OutputThis should work and works well on the non-chunked ds, without Problem DescriptionI'm trying to parallelize a peak finding routine with dask (works well without it) and I hoped that https://github.com/dask/dask/blob/e6ba8f5de1c56afeaed05c39c2384cd473d7c893/dask/array/utils.py#L118 A possible solution might be for I know I could use groupby-apply as an alternative, but there are several issues that made us use Output of
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/3574/reactions", "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | 13221727 | issue |