Skip to content

Commit

Permalink
raise informative error on map_blocks arg switch
Browse files Browse the repository at this point in the history
  • Loading branch information
mrocklin committed Jun 2, 2015
1 parent 1470223 commit 0549d95
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions dask/array/core.py
Expand Up @@ -411,6 +411,11 @@ def map_blocks(func, *arrs, **kwargs):
>>> def func(block, block_id=None):
... pass
"""
if not callable(func):
raise TypeError("First argument must be callable function, not %s\n"
"Usage: da.map_blocks(function, x)\n"
" or: da.map_blocks(function, x, y, z)" %
type(func).__name__)
dtype = kwargs.get('dtype')
chunks = kwargs.get('chunks')
assert all(isinstance(arr, Array) for arr in arrs)
Expand Down

0 comments on commit 0549d95

Please sign in to comment.