def _run_dask_numpy(data: da.Array, cellsize: Union[int, float]) -> da.Array: data = data.astype(np.float32) _func = partial(_cpu, cellsize=cellsize) out = data.map_overlap(_func, depth=(1, 1), boundary=np.nan, meta=np.array(())) return out
def _run_dask_numpy(data: da.Array) -> da.Array: _func = partial(_cpu) out = data.map_overlap(_func, depth=(1, 1), boundary=np.nan, meta=np.array(())) return out
def _run_dask_numpy(data: da.Array) -> da.Array: data = data.astype(np.float32) _func = partial(_run_numpy) out = data.map_overlap(_func, depth=(1, 1), boundary=np.nan, meta=np.array(())) return out
def _run_dask_numpy(data: da.Array, cellsize_x: Union[int, float], cellsize_y: Union[int, float]) -> da.Array: _func = partial(_cpu, cellsize_x=cellsize_x, cellsize_y=cellsize_y) out = data.map_overlap(_func, depth=(1, 1), boundary=np.nan, meta=np.array(())) return out
def _run_dask_cupy(data: da.Array, cellsize_x: Union[int, float], cellsize_y: Union[int, float]) -> da.Array: msg = 'Upstream bug in dask prevents cupy backed arrays' raise NotImplementedError(msg) _func = partial(_run_cupy, cellsize_x=cellsize_x, cellsize_y=cellsize_y) out = data.map_overlap(_func, depth=(1, 1), boundary=cupy.nan, dtype=cupy.float32, meta=cupy.array(())) return out
def _run_dask_cupy(data: da.Array) -> da.Array: msg = 'Upstream bug in dask prevents cupy backed arrays' raise NotImplementedError(msg) # add any func args # TODO: probably needs cellsize args _func = partial(_run_cupy) out = data.map_overlap(_func, depth=(1, 1), boundary=cupy.nan, dtype=cupy.float32, meta=cupy.array(())) return out