nest / nestml

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

Allow physical units to appear in expressions without a numeric literal? #1010

Open clinssen opened 4 months ago

clinssen commented 4 months ago

Currently, physical units can appear in expressions without a numerical literal in front, for example:

parameters:
    d ms = 1 ms

onReceive(spikes):
    emit_spike(1, d)

will emit a spike with a delay of 1 ms. However, if the user forgets to define the variable or parameter $d$, then NESTML assumes this is the physical unit "days", which has the units of time and thus does not raise any errors or warnings.

@heplesser proposes to allow physical units to appear only directly following a numeric literal, for instance, in case "days" is really what is intended, then:

onReceive(spikes):
    emit_spike(1, 1 d)

would be the correct way to write that.