From 6ae9781cecf57d9bcd17b3b9d607a6e9493bd993 Mon Sep 17 00:00:00 2001 From: AlexanderOtt Date: Thu, 2 Apr 2020 10:03:48 +0200 Subject: [PATCH] allow non int indexes as simulation time may not be a multiple of the sampling time (TODO fix the simulation time?) --- stimuli/SinusoidalStepStimulus.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stimuli/SinusoidalStepStimulus.py b/stimuli/SinusoidalStepStimulus.py index 6271cc7..64b77cf 100644 --- a/stimuli/SinusoidalStepStimulus.py +++ b/stimuli/SinusoidalStepStimulus.py @@ -63,7 +63,8 @@ def convert_to_array(frequency, amplitude, contrast, start_time, duration, time_ idx_end = (am_end - time_start) / step_size_s if idx_start != round(idx_start) or idx_end != round(idx_end): - raise ValueError("Didn't calculate integers when searching the start and end index. start:", idx_start, "end:", idx_end) + pass + # raise ValueError("Didn't calculate integers when searching the start and end index. start:", idx_start, "end:", idx_end) # print("am_start: {:.0f}, am_end: {:.0f}, length: {:.0f}".format(am_start, am_end, am_end-am_start)) idx_start = int(idx_start)