Skip to content

Fix StepCurrentSource.set_parameters() after simulation run (issue #759)#831

Merged
apdavison merged 1 commit intoNeuralEnsemble:masterfrom
apdavison:issue759
May 5, 2026
Merged

Fix StepCurrentSource.set_parameters() after simulation run (issue #759)#831
apdavison merged 1 commit intoNeuralEnsemble:masterfrom
apdavison:issue759

Conversation

@apdavison
Copy link
Copy Markdown
Member

When set_parameters() was called after sim.run(), _check_step_times() used only the timestep (resolution) as the minimum usable amplitude time, ignoring the current simulation time. This produced amplitude_times less than NEST's biological time, causing NEST to silently ignore the current injection.

Fix uses state.t_kernel + resolution (NEST biological time + one step) as the threshold, ensuring the adjusted time is always strictly greater than the current biological time. At t=0 the behaviour is identical to before.

…uralEnsemble#759)

When set_parameters() was called after sim.run(), _check_step_times() used
only the timestep (resolution) as the minimum usable amplitude time, ignoring
the current simulation time. This produced amplitude_times less than NEST's
biological time, causing NEST to silently ignore the current injection.

Fix uses state.t_kernel + resolution (NEST biological time + one step) as the
threshold, ensuring the adjusted time is always strictly greater than the
current biological time. At t=0 the behaviour is identical to before.
@apdavison apdavison added this to the 0.13.0 milestone May 4, 2026
@apdavison apdavison added the NEST label May 4, 2026
@apdavison apdavison merged commit a334c41 into NeuralEnsemble:master May 5, 2026
1 of 7 checks passed
@apdavison apdavison deleted the issue759 branch May 5, 2026 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant