diff --git a/pyNN/common/control.py b/pyNN/common/control.py index cafe6f525..af809f014 100644 --- a/pyNN/common/control.py +++ b/pyNN/common/control.py @@ -51,7 +51,11 @@ def setup(timestep=DEFAULT_TIMESTEP, min_delay=DEFAULT_MIN_DELAY, raise Exception("min_delay has to be less than or equal to max_delay.") if min_delay < timestep: raise Exception("min_delay (%g) must be greater than timestep (%g)" % (min_delay, timestep)) - + if timestep<0. or min_delay<0.: + raise Warning("Times are negative") + if min_delay == 'auto': + if timestep<0.: + raise Warning("Warning : Times are negative") def end(compatible_output=True): """Do any necessary cleaning up before exiting.""" diff --git a/pyNN/nest/__init__.py b/pyNN/nest/__init__.py index fa8f37ffb..9d377b5b8 100644 --- a/pyNN/nest/__init__.py +++ b/pyNN/nest/__init__.py @@ -138,6 +138,9 @@ def setup(timestep=DEFAULT_TIMESTEP, min_delay=DEFAULT_MIN_DELAY, # Set min_delay and max_delay simulator.state.set_delays(min_delay, max_delay) nest.SetDefaults('spike_generator', {'precise_times': True}) + if min_delay == 'auto': + print("Warning due to the parrot neuron which introduces an exra delay. 'min_delay' must be reduced") + return Warning("Warning due to the parrot neuron which introduces an exra delay. 'min_delay' must be reduced") return rank() diff --git a/pyNN/nest/standardmodels/cells.py b/pyNN/nest/standardmodels/cells.py index f57db9bf6..f67bcb4a5 100644 --- a/pyNN/nest/standardmodels/cells.py +++ b/pyNN/nest/standardmodels/cells.py @@ -289,7 +289,8 @@ def adjust_spike_times_forward(spike_times): parrot neuron. """ # todo: emit warning if any times become negative - return spike_times - simulator.state.min_delay +# return spike_times - simulator.state.min_delay + return spike_times + simulator.state.min_delay def adjust_spike_times_backward(spike_times): diff --git a/pyNN/parameters.py b/pyNN/parameters.py index b5dd0e35d..6ff49f898 100644 --- a/pyNN/parameters.py +++ b/pyNN/parameters.py @@ -123,6 +123,8 @@ def __init__(self, value): self.value = value else: self.value = numpy.array(value, float) + if (self.value<0.).any(): + print("Warning : Times are negative") # def __len__(self): # This must not be defined, otherwise Sequence is insufficiently different from NumPy array