spartan-array/spartan — pull request #46 by MaggieQi (2014-02-12 07:35:28+00:00)
Title: Fix the serialization bug in some test cases

The bug is due to the np.ascontiguousarray. When the reduce_mapper output a scalar, it will use np.asarray to format it as a () shape np array. However, when we call np.ascontiguousarray(), the data change to (1,) shape np array. Therefore, the next time when we fetch the scalar from the tile, the check len(self.data.shape) == 0 will fail and return a mask array.
In [1]: x = np.asarray(10).reshape(())
In [2]: x
Out[2]: array(10)
In [3]: np.ascontiguousarray(x)
Out[3]: array([10])