brian-team/brian2 — pull request #56 by mstimberg (2013-06-14 12:14:10+00:00)
Title: Network access

One of the remaining low-hanging fruits...: `Network` now accepts a `weak_references` option (defaults to `False`, set to `True` by `MagicNetwork`) and provides a simple dictionary-based interface for named objects:
```Python
G = NeuronGroup(...)
net = Network(G)
print len(net)
net['neurongroup'].v = ...
del net['neurongroup'] # equivalent to net.remove(G)
for obj in net:
print obj.name
```

I'd rather not introduce the complications of an attribute accessed for now, it will be a rather rarely used feature anyway, and if one uses an object from the network extensively, one would probably start with `G = net['neurongroup']` and only use this notation once. Closes #46