You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As mentioned on the discussion forum, very small refractory values are not handled correctly, since they are converted into code with Python's f format specifier which defaults to 6 significant digits:
This is of course rarely relevant (note that above the refractory period is < 1 microsecond), but still, it is unnecessary. I think I introduced this bug at some point when I modernized the code base to use format strings instead of the former % or .format syntax.
This issue is only triggered when you provide a Quantity as the refractory argument, not when you use a string directly:
group1=NeuronGroup(..., refractory=0.4*us) # WRONG: uses 0 as refractory periodgroup2=NeuronGroup(..., refractory="0.4*us") # WORKS
The text was updated successfully, but these errors were encountered:
This specifier defaults to 6 significant digits, truncating extremely small refractory times
Fixes (Very) small refractory values get lost in code generation #1521
As mentioned on the discussion forum, very small refractory values are not handled correctly, since they are converted into code with Python's
f
format specifier which defaults to 6 significant digits:This is of course rarely relevant (note that above the refractory period is < 1 microsecond), but still, it is unnecessary. I think I introduced this bug at some point when I modernized the code base to use format strings instead of the former
%
or.format
syntax.This issue is only triggered when you provide a
Quantity
as the refractory argument, not when you use a string directly:The text was updated successfully, but these errors were encountered: