-
Notifications
You must be signed in to change notification settings - Fork 191
Closed
Milestone
Description
Any model with nengo.spa doesn't seem to be able to be copied:
import nengo.spa as spa
model = spa.SPA()
with model:
model.a = spa.Buffer(16)
m2 = model.copy()AttributeError Traceback (most recent call last)
<ipython-input-8-4c0bfc568332> in <module>()
4 with model:
5 model.a = spa.Buffer(16)
----> 6 m2 = model.copy()
/home/tcstewar/github/nengo/nengo/network.pyc in copy(self, add_to_container)
227 # However, we deal with it here, so we ignore the warning.
228 warnings.simplefilter('ignore', category=NotAddedToNetworkWarning)
--> 229 c = deepcopy(self)
230 if add_to_container is None:
231 add_to_container = len(Network.context) > 0
/usr/lib/python2.7/copy.pyc in deepcopy(x, memo, _nil)
188 raise Error(
189 "un(deep)copyable object of type %s" % cls)
--> 190 y = _reconstruct(x, rv, 1, memo)
191
192 memo[d] = y
/usr/lib/python2.7/copy.pyc in _reconstruct(x, info, deep, memo)
334 state = deepcopy(state, memo)
335 if hasattr(y, '__setstate__'):
--> 336 y.__setstate__(state)
337 else:
338 if isinstance(state, tuple) and len(state) == 2:
/home/tcstewar/github/nengo/nengo/network.pyc in __setstate__(self, state)
206 def __setstate__(self, state):
207 for k, v in iteritems(state):
--> 208 setattr(self, k, v)
209 if len(Network.context) > 0:
210 warnings.warn(NotAddedToNetworkWarning(self))
/home/tcstewar/github/nengo/nengo/spa/spa.pyc in __setattr__(self, key, value)
108 if value.label is None:
109 value.label = key
--> 110 self._modules[key] = value
111 for k, (obj, v) in iteritems(value.inputs):
112 if type(v) == int:
AttributeError: 'SPA' object has no attribute '_modules'