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