nest / nestml

A domain specific language for neuron and synapse models in spiking neural network simulation
GNU General Public License v2.0
46 stars 45 forks source link

Add "exclude" parameter to ``integrate_odes()`` #1097

Open clinssen opened 3 weeks ago

clinssen commented 3 weeks ago

In order to enhance readability and allow models to be formulated in a way that minimises the potential for errors, we propose to add an "exclude" parameter to the integrate_odes() function.

Currently, by default, integrate_odes() integrates all variables in the system. Variable names can be explicitly specified as a list, for instance, integrate_odes(x, y).

There might be a scenario, where we want to integrate for example all variables but one, such as all except for V_m in the case the neuron is refractory. In this case, an "exclude" parameter would come in handy.

This might require an "include" parameter to be made explicit as well, to prevent ambiguities, but this might not be necessary.

There is probably no circumstance where one would specify both "include=" and "exclude=".

The specification integrate_odes(include=[x, y], exclude=[z]) is harmless because z is anyway not in the list [x,y]. A warning could issued because the exclude has no effect.

The specification integrate_odes(include=[x,y], exclude=[x]) is probably a typo and should raise an error because we should not prescribe the same variable to be simultaneously included and excluded.

The "include" keyword can potentially be assumed to be there by default, so that we can continue using the integrate_odes(x, y) syntax. We have to check on a technical level if this needs to be replaced by integrate_odes([x, y]) to make it explicit that it is an "include" list.