Hi @luol3. Please have a look at the documentation for the Brian 1→2 conversion: Changes for Brian 1 users — Brian 2 2.5.4 documentation In particular this part which talks about networks and clocks: Networks and clocks (Brian 1 –> 2 conversion) — Brian 2 2.5.4 documentation
As it states, defaultclock.reinit
does not exist anymore, and isn’t necessary. The same is true for net.prepare
.
I am not quite sure why you think this is a unit error – the error message states that it cannot resolve the name, i.e. it does not find a value for tau_GABA
. This is because the way Brian 2 resolves constants in the equations is different from Brian 1: In Brian 1, they were taken from the namespace at the point where the objects were created (at least most of the time – in practice there were several issues with it), whereas in Brian 2 they are taken from the namespace at the point where run(...)
(or net.run(...)
is called. This is mentioned here, and explained in more detail for Brian 2 here: Namespaces — Brian 2 2.5.4 documentation
In your example, a quick&dirty way to make the Brian 1 code work would be to add namespace=locals()
to the construction of the NeuronGroup
s in the function that creates them.