Repository: dask/dask

Issue:
dask.array test failures on OS X
Got this on an OS X machine where I ran the test suite out of curiosity (with Python 3.6):
```
____________________________________________________________________________ test_coarsen ____________________________________________________________________________
Traceback (most recent call last):
  File "/Users/buildbot/antoine/dask/dask/array/tests/test_array_core.py", line 628, in test_coarsen
    assert_eq(chunk.coarsen(np.sum, x, {0: 2, 1: 4}),
  File "/Users/buildbot/antoine/dask/dask/array/chunk.py", line 148, in coarsen
    return reduction(x.reshape(newshape), axis=tuple(range(1, x.ndim * 2, 2)))
TypeError: 'float' object cannot be interpreted as an integer
______________________________________________________________________ test_coarsen_with_excess ______________________________________________________________________
Traceback (most recent call last):
  File "/Users/buildbot/antoine/dask/dask/array/tests/test_array_core.py", line 637, in test_coarsen_with_excess
    np.array([0, 5]))
  File "/Users/buildbot/antoine/dask/dask/array/utils.py", line 51, in assert_eq
    a = a.compute(get=get_sync)
  File "/Users/buildbot/antoine/dask/dask/base.py", line 94, in compute
    (result,) = compute(self, traverse=False, **kwargs)
  File "/Users/buildbot/antoine/dask/dask/base.py", line 201, in compute
    results = get(dsk, keys, **kwargs)
  File "/Users/buildbot/antoine/dask/dask/async.py", line 544, in get_sync
    raise_on_exception=True, **kwargs)
  File "/Users/buildbot/antoine/dask/dask/async.py", line 487, in get_async
    fire_task()
  File "/Users/buildbot/antoine/dask/dask/async.py", line 483, in fire_task
    callback=queue.put)
  File "/Users/buildbot/antoine/dask/dask/async.py", line 532, in apply_sync
    res = func(*args, **kwds)
  File "/Users/buildbot/antoine/dask/dask/async.py", line 266, in execute_task
    result = _execute_task(task, data)
  File "/Users/buildbot/antoine/dask/dask/async.py", line 247, in _execute_task
    return func(*args2)
  File "/Users/buildbot/antoine/dask/dask/array/chunk.py", line 148, in coarsen
    return reduction(x.reshape(newshape), axis=tuple(range(1, x.ndim * 2, 2)))
TypeError: 'float' object cannot be interpreted as an integer
____________________________________________________________________________ test_coarsen ____________________________________________________________________________
Traceback (most recent call last):
  File "/Users/buildbot/antoine/dask/dask/array/tests/test_chunk.py", line 98, in test_coarsen
    y = coarsen(np.sum, x, {0: 2, 1: 4})
  File "/Users/buildbot/antoine/dask/dask/array/chunk.py", line 148, in coarsen
    return reduction(x.reshape(newshape), axis=tuple(range(1, x.ndim * 2, 2)))
TypeError: 'float' object cannot be interpreted as an integer
```



Discussion:
Replicated

Resolving patch:
diff --git a/dask/array/chunk.py b/dask/array/chunk.py
--- a/dask/array/chunk.py
+++ b/dask/array/chunk.py
@@ -142,7 +142,7 @@ def coarsen(reduction, x, axes, trim_excess=False):
         x = x[ind]
 
     # (10, 10) -> (5, 2, 5, 2)
-    newshape = tuple(concat([(x.shape[i] / axes[i], axes[i])
+    newshape = tuple(concat([(x.shape[i] // axes[i], axes[i])
                              for i in range(x.ndim)]))
 
     return reduction(x.reshape(newshape), axis=tuple(range(1, x.ndim * 2, 2)))


Test patch: