Skip to content
Snippets Groups Projects
Commit ac71ed57 authored by Alexander van Meegen's avatar Alexander van Meegen
Browse files

Proper ZeroDivisionError handling

parent 17083a63
No related branches found
No related tags found
1 merge request!23Fix issues raised by golosio
......@@ -669,9 +669,9 @@ def synchrony(data_array, num_neur, t_min, t_max, resolution=1.0):
data_array, num_neur, t_min, t_max, resolution=resolution)
mean = np.mean(spike_count_histogramm)
std_dev = np.std(spike_count_histogramm)
if std_dev + mean != std_dev: # check for vanishing mean
try:
synchrony = std_dev / mean
else:
except ZeroDivisionError:
synchrony = np.inf
return synchrony
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment