-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
Description
dask.array.map_blocks says about dtype:
The dtype of the output array. It is recommended to provide this. If not provided, will be inferred by applying the function to a small set of fake data.
So if dtype is provided, the function should not be called.
This minimal example will print a message if the function is called:
import dask.array as da
def block_func(block,block_info=None):
if block_info is None:
print("block_func called with block_info=None")
return block + 0.5
data=da.arange(10,chunks=2)
data.map_blocks(block_func, dtype='f8')This code print "block_func called with block_info=None", and that show that the function is called, despite of the documentation.
I've found that using the undocumented keyword meta=True, it's work as expected, and the function is not called:
data.map_blocks(block_func, dtype='f8',meta=True)Is it a documentation problem, or am I missing something else ?
Environment:
- Dask version: 2.28.0
- Python version: 3.8.2
- Operating System: linux
- Install method (conda, pip, source): pip
Reactions are currently unavailable