switch from submodule to cloning arrow, travis fixes & Robert's comments

This commit is contained in:
Philipp Moritz
2016-11-19 17:38:36 -08:00
parent 05e0226047
commit d64f69f215
17 changed files with 25 additions and 324 deletions
+1 -4
View File
@@ -116,10 +116,7 @@ Status SerializeArray(
// must be decremented. This is done in SerializeDict in python.cc.
PyObject* result = PyObject_CallObject(numbuf_serialize_callback, arglist);
Py_XDECREF(arglist);
if (!result) {
return Status::NotImplemented("python error"); // TODO(pcm):
// https://github.com/ray-project/numbuf/issues/10
}
if (!result) { return Status::NotImplemented("python error"); }
builder.AppendDict(PyDict_Size(result));
subdicts.push_back(result);
}
@@ -128,10 +128,7 @@ Status append(PyObject* elem, SequenceBuilder& builder, std::vector<PyObject*>&
// must be decremented. This is done in SerializeDict in this file.
PyObject* result = PyObject_CallObject(numbuf_serialize_callback, arglist);
Py_XDECREF(arglist);
if (!result) {
return Status::NotImplemented("python error"); // TODO(pcm):
// https://github.com/ray-project/numbuf/issues/10
}
if (!result) { return Status::NotImplemented("python error"); }
builder.AppendDict(PyDict_Size(result));
subdicts.push_back(result);
}
@@ -285,10 +282,7 @@ Status DeserializeDict(std::shared_ptr<Array> array, int32_t start_idx, int32_t
Py_XDECREF(arglist);
Py_XDECREF(result);
result = callback_result;
if (!callback_result) {
return Status::NotImplemented("python error"); // TODO(pcm):
// https://github.com/ray-project/numbuf/issues/10
}
if (!callback_result) { return Status::NotImplemented("python error"); }
}
*out = result;
return Status::OK();
+1 -1
View File
@@ -38,7 +38,7 @@ class SerializationTests(unittest.TestCase):
self.roundTripTest([{"hello": [1, 2, 3]}])
self.roundTripTest([{"hello": [1, [2, 3]]}])
self.roundTripTest([{"hello": (None, 2, [3, 4])}])
self.roundTripTest([{"hello": (None, 2, [3, 4], np.ndarray([1.0, 2.0, 3.0]))}])
self.roundTripTest([{"hello": (None, 2, [3, 4], np.array([1.0, 2.0, 3.0]))}])
def numpyTest(self, t):
a = np.random.randint(0, 10, size=(100, 100)).astype(t)