##// END OF EJS Templates
pickle length-0 arrays.
MinRK -
Show More
@@ -94,8 +94,10 class SerializeIt(object):
94 94 self.data = None
95 95 self.obj = unSerialized.getObject()
96 96 if globals().has_key('numpy') and isinstance(self.obj, numpy.ndarray):
97 if len(self.obj) == 0: # length 0 arrays can't be reconstructed
98 raise SerializationError("You cannot send a length 0 array")
97 if len(self.obj.shape) == 0: # length 0 arrays are just pickled
98 self.typeDescriptor = 'pickle'
99 self.metadata = {}
100 else:
99 101 self.obj = numpy.ascontiguousarray(self.obj, dtype=None)
100 102 self.typeDescriptor = 'ndarray'
101 103 self.metadata = {'shape':self.obj.shape,
@@ -61,7 +61,6 class EngineFactory(RegistrationFactory):
61 61 ctx = self.context
62 62 loop = self.loop
63 63 identity = self.ident
64 print (identity)
65 64
66 65 idents,msg = self.session.feed_identities(msg)
67 66 msg = Message(self.session.unpack_message(msg))
General Comments 0
You need to be logged in to leave comments. Login now