neurodynex.neuron_type package¶
Submodules¶
neurodynex.neuron_type.neurons module¶
This file implements a type I and a type II model from the abstract base class NeuronAbstract.
You can inject step currents and plot the responses, as well as get firing rates.
Relevant book chapters:
-
class
neurodynex.neuron_type.neurons.
NeuronAbstract
[source]¶ Bases:
object
Abstract base class for both neuron types.
This stores its own recorder and network, allowing each neuron to be run several times with changing currents while keeping the same neurogroup object and network internally.
-
get_rate
(I_amp, t_end=1000.0, do_plot=False)[source]¶ Return the firing rate under a current step.
Parameters: Returns: firing rate of neuron
Return type:
-
run
(curr, simtime)[source]¶ Runs the neuron for a given current.
Parameters: - curr (TimedArray) – Input current injected into the neuron
- simtime (float) – Simulation time [seconds]
Returns: Brian2 StateMonitor with input current (I) and voltage (V) recorded
Return type: StateMonitor
-
step
(t_end=300.0, I_tstart=20, I_tend=270, I_amp=0.5, do_plot=True, show=True)[source]¶ Runs the neuron for a step current and plots the data.
Parameters: - t_end (float, optional) – the simulation time of the model [ms]
- I_tstart (float, optional) – start of current step [ms]
- I_tend (float, optional) – start of end step [ms]
- I_amp (float, optional) – amplitude of current step [nA]
- do_plot (bool, optional) – plot the resulting simulation
- show (bool, optional) – call plt.show for the plot
Returns: Brian2 StateMonitor with input current (I) and voltage (V) recorded
Return type: StateMonitor
-
-
neurodynex.neuron_type.neurons.
get_spiketimes
(t, v, v_th=0.5, do_plot=False)[source]¶ Returns numpy.ndarray of spike times, for a given time and voltage series.
Parameters: - t (numpy.ndarray) – time dimension of timeseries [ms]
- v (numpy.ndarray) – voltage dimension of timeseries [mV]
- v_th (float, optional) – threshold voltage for spike detection [mV]
- do_plot (bool, optional) – plot the results
Returns: detected spike times
Return type: np.ndarray
-
neurodynex.neuron_type.neurons.
get_step_curr
(I_tstart=20, I_tend=270, I_amp=0.5)[source]¶ Returns a pA step current TimedArray.
Parameters: - I_tstart (float, optional) – start of current step [ms]
- I_tend (float, optional) – start of end step [ms]
- I_amp (float, optional) – amplitude of current step [pA]
Returns: Brian2 StateMonitor with input current (I) and voltage (V) recorded
Return type: StateMonitor
-
neurodynex.neuron_type.neurons.
plot_data
(rec, title=None, show=False)[source]¶ Plots a TimedArray for values I, v and w
Parameters: - rec (TimedArray) – the data to plot
- title (string, optional) – plot title to display
- show (bool, optional) – call plt.show for the plot
Returns: Brian2 StateMonitor with input current (I) and voltage (V) recorded
Return type: StateMonitor
neurodynex.neuron_type.typeXY module¶
This module has two neuron models, NeuronX and NeuronY. One of them is Type I, the other is Type II - the assignment is randomly generated when the module is loaded.
Relevant book chapters:
-
class
neurodynex.neuron_type.typeXY.
NeuronX
¶
-
class
neurodynex.neuron_type.typeXY.
NeuronY
¶