pybrain/pybrain — Issue #75: Compatibility with arac is broken by one of recent commits
Author: dchaplinsky
Created: 2012-01-07 22:52:24+00:00
State: open

Hi!

I've tried to run trunk version pybrain with arac but found that it's not possible to create network with fast=True:

```
Traceback (most recent call last):
File "learner.py", line 42, in
net = buildNetwork(total_samples, 5, 1, fast=True)
File "/foobar/env/src/pybrain/pybrain/tools/shortcuts.py", line 105, in buildNetwork
n.sortModules()
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/arac/pybrainbridge.py", line 274, in sortModules
super(_Network, self).sortModules()
File "/foobar/env/src/pybrain/pybrain/structure/networks/network.py", line 259, in sortModules
Module.__init__(self, self.indim, self.outdim, name=self.name)
File "/foobar/env/src/pybrain/pybrain/structure/modules/module.py", line 51, in __init__
self._resetBuffers()
File "/foobar/env/src/pybrain/pybrain/structure/networks/network.py", line 263, in _resetBuffers
super(Network, self)._resetBuffers(length)
File "/foobar/env/src/pybrain/pybrain/structure/modules/module.py", line 58, in _resetBuffers
self.offset = 0
AttributeError: can't set attribute
```

After some investigation I found that this commit:
https://github.com/pybrain/pybrain/commit/76e3a0fd6ac8cefb50efdcc64bbcad9808506efd#L0R57
broke compatibility with arac.

I've commented it out - now everything works like a charm.