Skip to content

Instantly share code, notes, and snippets.

Created August 1, 2021 16:38
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
gufunc error with whitespace in dask
ValueError Traceback (most recent call last)
/var/folders/yt/z22_f0896l74f8gs3_20vc_00000gn/T/ipykernel_88946/ in <module>
7 return np.linalg.inv(x)
----> 9 y = gufoo(b)
~/mambaforge/envs/py/lib/python3.9/site-packages/dask/array/ in __call__(self, *args, **kwargs)
660 def __call__(self, *args, **kwargs):
--> 661 return apply_gufunc(
662 self.pyfunc,
663 self.signature,
~/mambaforge/envs/py/lib/python3.9/site-packages/dask/array/ in apply_gufunc(func, signature, axes, axis, keepdims, output_dtypes, output_sizes, vectorize, allow_rechunk, meta, *args, **kwargs)
356 if vectorize:
357 otypes = [x.dtype for x in meta] if isinstance(meta, tuple) else [meta.dtype]
--> 358 func = np.vectorize(func, signature=signature, otypes=otypes)
360 ## Miscellaneous
~/mambaforge/envs/py/lib/python3.9/site-packages/numpy/lib/ in __init__(self, pyfunc, otypes, doc, excluded, cache, signature)
2130 if signature is not None:
-> 2131 self._in_and_out_core_dims = _parse_gufunc_signature(signature)
2132 else:
2133 self._in_and_out_core_dims = None
~/mambaforge/envs/py/lib/python3.9/site-packages/numpy/lib/ in _parse_gufunc_signature(signature)
1865 """
1866 if not re.match(_SIGNATURE, signature):
-> 1867 raise ValueError(
1868 'not a valid gufunc signature: {}'.format(signature))
1869 return tuple([tuple(re.findall(_DIMENSION_NAME, arg))
ValueError: not a valid gufunc signature: (n, n)->(n, n)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment