Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
clinssen opened this issue Mar 5, 2024 · 0 comments
Open

Comments

@clinssen
Copy link
Contributor

clinssen commented Mar 5, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant