Python utils

class python_utils.SpikeSim(path, sim_fname, neglect_t, neglect_t_end=-1, config_fname='')[source]

Class loading and parsing files given by a simulation. The main attributes are the simulation parameters and results:

  • end_t: end time of simulation

  • dt: time resolution of the simulation

  • input_mode: external input mode:
    • 0 (base mode): each neuron receives an indipendent poisson signal with mean frequency = SubNetwork::ext_in_rate

    • 1 (not implemented)

  • data: dictionary with spike times corresponding to each population; data[‘pop’] is a list of np.arrays each containing the activity of a neuron

  • subnets: a list of the SubNetworks in the simulation

MeanActivity()[source]

Method computing the mean spiking activity of the subnets

getParameterValues()[source]

Method initializing the simulation parameters

histogram(pop='', res=1.0, save_img='')[source]

Method showing or saving the spiking activity of a given subnet

Parameters:
  • pop (float) – desidered population; if ‘all’ is passed all population are showed.

  • res – time width of each bin in the histogram

  • save_img (string) – path and name of the file to be saved

info()[source]

Method printing the simulation parameters

loadData()[source]

Method loading spike times for each SubNetwork

necglectTime()[source]

Method removing the spikes occurring before t_start and after t_end (if > 0)

python_utils.load_pkl(path)[source]

Function loading an object from a pickle file.

Parameters:

path (string) – path to the object to be loaded

python_utils.newReadSpikes(file, n)[source]

Function reading spike times in the format produced by the simulation

Parameters:

file (string) – path to the file with spike times

python_utils.readSpikes(file)[source]

Function reading spike times in the format produced by the simulation

Parameters:

file (string) – path to the file with spike times

python_utils.save_pkl(obj, path)[source]

Function saving an object as a pickle file.

Parameters:
  • obj (generic) – python object (list, dictionary…) to be saved

  • path (string) – path to the object to be saved