Dask array rfft doesn't seems to work
Question: I'm trying to do some real fft in some large arrays and decided to give dask a
try. I've run into a problem where the function dask.array.rfft does not seems
to work no matter what I do. Here's a minimal example.

    
    
    import numpy as np
    import dask.array as da
    import dask
    
    print('Dask version: {}'.format(dask.__version__))
    
    x = np.random.random((10, 10))
    dx = da.from_array(x, chunks=(2, x.shape[1]))
    dx_fft = da.fft.fft(dx)
    dx_ifft = da.fft.ifft(dx_fft)
    dx_ifft.compute()
    print('Regular fft worked out just fine.')
    
    dx = da.from_array(x, chunks=(2, x.shape[1]))
    dx_rfft = da.fft.rfft(dx, axis=1)
    dx_irfft = da.fft.irfft(dx_rfft, axis=1)
    dx_irfft.compute()
    print('Real fft worked out just fine.')
    

The output of the program is.

    
    
    Dask version: 0.7.5
    Regular fft worked out just fine.
    Traceback (most recent call last):
      File "a.py", line 16, in <module>
        dx_irfft = da.fft.irfft(dx_rfft, axis=1)
      File "/home/heitor/anaconda/lib/python2.7/site-packages/dask/array/fft.py", line 35, in func
        chunks=chunks)
      File "/home/heitor/anaconda/lib/python2.7/site-packages/dask/array/core.py", line 449, in map_blocks
        result = atop(func, out_ind, *args, name=name, dtype=dtype)
      File "/home/heitor/anaconda/lib/python2.7/site-packages/dask/array/core.py", line 1420, in atop
        chunkss, arrays = unify_chunks(*args)
      File "/home/heitor/anaconda/lib/python2.7/site-packages/dask/array/core.py", line 1342, in unify_chunks
        for a, i in arginds]
      File "/home/heitor/anaconda/lib/python2.7/site-packages/dask/array/core.py", line 1141, in rechunk
        return rechunk(self, chunks)
      File "/home/heitor/anaconda/lib/python2.7/site-packages/dask/array/rechunk.py", line 232, in rechunk
        return Array(x2, temp_name, chunks, dtype=x.dtype)
      File "/home/heitor/anaconda/lib/python2.7/site-packages/toolz/functoolz.py", line 348, in memof
        raise TypeError("Arguments to memoized function must be hashable")
    TypeError: Arguments to memoized function must be hashable
    

Whatever operation I try to do with dx_rfft, it returns the same error. I've
tried Pythons 2 and 3 and both have the same issue. Am I missing something or
is this a bug of the library?


Answer: This does not occur on dask master. The easiest solution is probably to
install from there. The easiest way to do this is to

    
    
    $ conda remove dask
    $ pip install git+git://github.com/blaze/dask.git # might need root
    

Or you can create a fresh conda environment so your system dask does not have
to be replaced with the potentially broken development version

    
    
    $ conda create -n myenv dask  #create "myenv" environment and install dask + depedencies
    $ source activate myenv
    (myenv)$ conda remove dask
    (myenv)$ pip install git+git://github.com/blaze/dask.git
    

