Skip to content

Commit

Permalink
fixed mismatch in simulation resolution in test_plot
Browse files Browse the repository at this point in the history
  • Loading branch information
tclose committed Nov 17, 2017
1 parent e216f5e commit 6af058c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
6 changes: 4 additions & 2 deletions pype9/cmd/simulate.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,10 @@ def run(argv):
signal = seg.spiketrains[0]
else:
signal = seg.analogsignals[0]
logger.info("Playing {} signal into port '{}"
.format(signal, port_name))
logger.info("Playing signal (t_start: {}, t_stop: {}, dt: {}) "
"into port '{}"
.format(signal.t_start, signal.t_stop,
signal.sampling_period, port_name))
# Input is an event train or analog signal
cell.play(port_name, signal)
# Set up recorders
Expand Down
10 changes: 6 additions & 4 deletions pype9/simulate/nest/cells/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,14 +212,16 @@ def play(self, port_name, signal, properties=[]):
"Start time of signal played into port '{}' ({}) must "
"be greater than device delay ({})".format(
port_name, signal.t_start, self.device_delay))
self._inputs[port_name] = nest.Create(
'step_current_generator', 1,
{'amplitude_values': list(
step_current_params = {
'amplitude_values': list(
numpy.ravel(pq.Quantity(signal, 'pA'))),
'amplitude_times': list(numpy.ravel(numpy.asarray(
signal.times.rescale(pq.ms))) - self.device_delay_ms),
'start': t_start,
'stop': float(signal.t_stop.rescale(pq.ms))})
'stop': float(signal.t_stop.rescale(pq.ms))}
logger.info("Kernel: {}".format(nest.GetKernelStatus()))
self._inputs[port_name] = nest.Create(
'step_current_generator', 1, step_current_params)
nest.Connect(self._inputs[port_name], self._cell, syn_spec={
"receptor_type": self._receive_ports[port_name],
'delay': self.device_delay_ms})
Expand Down
4 changes: 2 additions & 2 deletions test/unittests/test_cmds/test_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def test_single_cell_plot(self, show=False):
simulate.run(argv.split())
argv = (
"catalog://neuron/Izhikevich#SampleIzhikevichFastSpiking "
"nest {} 0.01 "
"nest {} {} "
"--record V {} "
"--init_value U 1.625 pA "
"--init_value V -65.0 mV "
Expand All @@ -73,7 +73,7 @@ def test_single_cell_plot(self, show=False):
"--build_version Plot "
"--device_delay 0.5 ms "
"--min_delay 0.5 ms "
.format(self.t_stop, self.cell_signal_path,
.format(self.t_stop, self.dt, self.cell_signal_path,
in_path=self.cell_input_path))
simulate.run(argv.split())
# Run plotting command
Expand Down

0 comments on commit 6af058c

Please sign in to comment.