From 8924e5046336bd0a5da4671a8621a15ff4809bb4 Mon Sep 17 00:00:00 2001 From: John Kirkham Date: Sun, 2 Dec 2018 01:29:43 -0500 Subject: [PATCH] Ensure `Pickle` `encode` method return `ndarray`s --- numcodecs/pickles.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/numcodecs/pickles.py b/numcodecs/pickles.py index 7e1c26f7..f79de000 100644 --- a/numcodecs/pickles.py +++ b/numcodecs/pickles.py @@ -6,7 +6,7 @@ from .abc import Codec -from .compat import PY2, ensure_bytes, ensure_contiguous_ndarray +from .compat import PY2, ensure_bytes, ensure_contiguous_ndarray, ensure_ndarray if PY2: # pragma: py3 no cover @@ -45,7 +45,7 @@ def __init__(self, protocol=pickle.HIGHEST_PROTOCOL): self.protocol = protocol def encode(self, buf): - return pickle.dumps(buf, protocol=self.protocol) + return ensure_ndarray(pickle.dumps(buf, protocol=self.protocol)) def decode(self, buf, out=None): if PY2: # pragma: py3 no cover