Commit 2d8eee09 authored by theos's avatar theos
Browse files

Added __array__ method to distributed_data_object. np.array(obj) is now fast!

parent 7589b45b
......@@ -486,6 +486,10 @@ class distributed_data_object(object):
self.set_local_data(generator(self.distributor.local_shape), copy=copy)
self.hermitian = False
def __array__(self):
""" Returns the d2o's full data. """
return self.get_full_data()
def __str__(self):
""" x.__str__() <==> str(x)"""
return self.data.__str__()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment