Skip to content

Commit

Permalink
Merge 08dc086 into 6351ae8
Browse files Browse the repository at this point in the history
  • Loading branch information
legouee committed Sep 26, 2017
2 parents 6351ae8 + 08dc086 commit d9de9a1
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
6 changes: 5 additions & 1 deletion pyNN/common/control.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down
3 changes: 3 additions & 0 deletions pyNN/nest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()


Expand Down
3 changes: 2 additions & 1 deletion pyNN/nest/standardmodels/cells.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 2 additions & 0 deletions pyNN/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d9de9a1

Please sign in to comment.