-
Notifications
You must be signed in to change notification settings - Fork 221
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
Segfault with SpikeGeneratorGroup #1017
Comments
Hi, thanks for your bug report. I'm afraid I don't follow 100% what the problem is, can you provide a minimal example that triggers this issue? I tried the following and it seems to work fine: from brian2 import *
T = 10*ms
sgg = SpikeGeneratorGroup(1, [], []*ms)
run(T)
sgg.set_spikes([0], [5]*ms) # 5ms < T
run(T) |
I tried reducing my program to its minimal as shown below.
For When I set the indices using However, none of the errors occur when I uncomment the line The error seems to be related to |
Many thanks for that example, that was very useful. I think I understand where the problem is coming from. Our implementation of the I'm not 100% sure what the best solution is: on the one hand, it would be good to raise an error for such cases, in the same way we do for negative spike times. On the other hand, this also feels not optimal, e.g.: group = SpikeGeneratorGroup(1, [0], [7]*ms)
run(10*ms)
print(group.neuron_index, group.spike_time)
run(5*ms) and group = SpikeGeneratorGroup(1, [0], [7]*ms)
run(10*ms)
group.set_spikes([0], [7]*ms)
print(group.neuron_index, group.spike_time)
run(5*ms) would both print the same stored indices/spike times but the latter would raise an error. In the Maybe as a compromise, we could use this solution and raise a warning? @thesamovar, any thoughts on this? |
I like that idea. I think it's a sign that the user is not doing what they expect if we ever discard information that they have provided, but it's not necessarily an error, so a warning is appropriate. |
Say I have run my network, with a
sgg = SpikeGeneratorGroup()
for T seconds.Now if I set the spikes in
sgg
with time instants < T; in the next run, the program crashes with a segmentation fault.It should ideally throw a runtime error.
The text was updated successfully, but these errors were encountered: