brian-team/brian2 — pull request #11 by mstimberg (2013-02-20 14:48:14+00:00)
Title: Implement system to automatically chose a stateupdater

A central function that receives equations and a namespace (+specifiers?) and returns a stateupdater. This will be used when e.g. a NeuronGroup is constructed and no stateupdater is specified.
To allow for extensibiilty, I propose the following implementation:

* All stateupdaters have to inherit from a common class (or at least provide the respective functionality)
* this class has a function that receives the necessary information and returns a number: 0 means "not suitable", everything > 0 means suitable in general. The higher the number, the higher the priority.
* all stateupdaters are registered in a "StateupdaterRegistry", this object can be asked for a suitable stateupdater.

The priority numbers should ensure that for example for linear equations, the exact stateupdater is preferred over the numerical stateupdaters (even though they are certainly able to integrate the equations).

One question: Should we enforce that only Stateupdater (or whatever the name of the class would be) objects can be passed to NeuronGroup? Currently, any function/callable that turns equations into abstract code is allowed, but always having a class for it might be a sensible thing to do.