From 7f9f71537e7670642f5a93b289a0454d04e45d18 Mon Sep 17 00:00:00 2001 From: Matthew Rocklin Date: Thu, 26 Jan 2017 16:56:01 -0500 Subject: [PATCH 1/3] Ravel bytes before creating memoryview --- distributed/protocol/numpy.py | 2 +- distributed/protocol/tests/test_numpy.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/distributed/protocol/numpy.py b/distributed/protocol/numpy.py index e963d557ca3..224f48d1edc 100644 --- a/distributed/protocol/numpy.py +++ b/distributed/protocol/numpy.py @@ -48,7 +48,7 @@ def serialize_numpy_ndarray(x): 'strides': x.strides, 'shape': x.shape} - data = x.view('u1').data + data = x.ravel().view('u1').data if blosc and x.nbytes > 1e5: frames = frame_split_size([data]) diff --git a/distributed/protocol/tests/test_numpy.py b/distributed/protocol/tests/test_numpy.py index 3f23b044111..0ce3c022e3d 100644 --- a/distributed/protocol/tests/test_numpy.py +++ b/distributed/protocol/tests/test_numpy.py @@ -49,6 +49,7 @@ def test_serialize(): np.array([(1, 'abc')], dtype=[('x', 'i4'), ('s', object)]), np.zeros(5000, dtype=[('x%d'%i,' Date: Thu, 26 Jan 2017 17:02:25 -0500 Subject: [PATCH 2/3] add non-contiguous array --- distributed/protocol/tests/test_numpy.py | 1 + 1 file changed, 1 insertion(+) diff --git a/distributed/protocol/tests/test_numpy.py b/distributed/protocol/tests/test_numpy.py index 0ce3c022e3d..e8f40a41b25 100644 --- a/distributed/protocol/tests/test_numpy.py +++ b/distributed/protocol/tests/test_numpy.py @@ -50,6 +50,7 @@ def test_serialize(): np.zeros(5000, dtype=[('x%d'%i,' Date: Thu, 26 Jan 2017 17:03:53 -0500 Subject: [PATCH 3/3] add blosc to travis tests --- .travis.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1433b3d61af..9bbbfae3894 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,7 @@ matrix: fast_finish: true include: - python: "2.7" + env: PACKAGES=blosc - python: "3.4" env: COVERAGE=true - python: "3.5" @@ -15,7 +16,7 @@ matrix: sudo: true dist: trusty - python: "3.5" - env: HDFS=true + env: HDFS=true PACKAGES=blosc sudo: true dist: trusty @@ -48,7 +49,7 @@ install: # Install dependencies - conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION - source activate test-environment - - conda install -q pytest pytest-timeout coverage tornado toolz dill futures dask ipywidgets psutil bokeh requests joblib mock ipykernel jupyter_client h5py netcdf4 lz4 paramiko tblib click -c conda-forge + - conda install -q pytest pytest-timeout coverage tornado toolz dill futures dask ipywidgets psutil bokeh requests joblib mock ipykernel jupyter_client h5py netcdf4 lz4 paramiko tblib click $PACKAGES -c conda-forge - | if [[ $HDFS == true ]]; then conda install -q libxml2 krb5 boost