NeuralEnsemble / PyNN

A Python package for simulator-independent specification of neuronal network models.
Other
275 stars 125 forks source link

plot_spiketrainlist errorrs #765

Closed Christian-B closed 1 year ago

Christian-B commented 1 year ago

The plotting method plot_spiketrainlist https://github.com/NeuralEnsemble/PyNN/blob/9dfb42bca07a5b5925e12ce369549ce9d903b14b/pyNN/utility/plotting.py#L104 appears broken.

  1. ax.set_xlim(spiketrains[0].t_start, spiketrains[0].t_stop / ms) both t_start and t_stop are quanties with a dimension so this line raises ValueError: Unable to convert between units of "dimensionless" and "ms"

fix: ax.set_xlim(spiketrains.t_start, spiketrains.t_stop)

  1. ax.plot(channel_ids, spike_times, 'k.', **options) channel_ids are the y value as shown in the next line ax.set_ylabel("Neuron index")

fix: ax.plot(spike_times, channel_ids, 'k.', **options)

  1. there is no label on the x axis

fix: ax.set_xlabel("Spike times")

Without these fixes we have to cap Spynnaker at Neo 0.9

apdavison commented 1 year ago

Thanks for the report @Christian-B. It seems this error crept in while adapting to the latest Neo.

(1) and (2) are fixed in #763. (3) is not an error: the user is expected to specify the x-axis label in the Panel constructor.