Two reasons:
1) It crashes because hooke.config._comment_textwrap contains a
compiled regexp, and these cannot be deepcopied. See
http://mail.python.org/pipermail/python-dev/2008-November/083348.html
http://bugs.python.org/issue416670
2) We don't want to copy Hooke instances anyway, since we need them to stay
in sync. Anything copying curves (e.g. Playlist.filter) should shallow
copy Hooke instances between the curves.
If this turns up anywhere else, we should think about adding a
Curve.copy method to get the "just right" copy depth ;).
super(NotRecognized, self).__init__(msg)
self.curve = data
+
class Data (numpy.ndarray):
"""Stores a single, continuous data set.
def __repr__(self):
return self.__str__()
+ def __getstate__(self):
+ data = dict(self.__dict__)
+ del(data['_hooke'])
+ return data
+
+ def __setstate__(self, data):
+ self._hooke = None
+ for key,value in data.items():
+ setattr(self, key, value)
+
def set_hooke(self, hooke=None):
if hooke != None:
self._hooke = hooke