API reference

Module MEArec.generators

Module MEArec.generation_tools

function gen_templates

generation_tools.gen_templates(cell_models_folder, params=None, templates_tmp_folder=None, tempgen=None, intraonly=False, parallel=True, n_jobs=None, joblib_backend='loky', recompile=False, delete_tmp=True, verbose=True)[source]
Parameters:
  • cell_models_folder (str) – path to folder containing cell models
  • params (str or dict) – Path to parameters yaml file or parameters dictionary
  • templates_tmp_folder (str) – Path to temporary folder where templates are temporarily saved
  • tempgen (TemplateGenerator) – If a TemplateGenerator is passed, the cell types, locations, and rotations of the templates will be set using the provided templates
  • intraonly (bool) – if True, only intracellular simulation is run
  • parallel (bool) – if True, multi-threading is used
  • n_jobs (int) – Number of jobs to run in parallel (If None all cpus are used)
  • joblib_backend (str) – The joblib backend to use when n_jobs > 1 (default ‘loky’)
  • recompile (bool) – If True, cell models are recompiled
  • delete_tmp – if True, the temporary files are deleted
  • verbose (bool, or int) – If True, the output is verbose (1). If verbose is 2, every step produces an output
Returns:

Generated template generator object

Return type:

TemplateGenerator

function gen_spiketrains

generation_tools.gen_spiketrains(params=None, spiketrains=None, seed=None, verbose=False)[source]

Generates spike trains.

Parameters:
  • params (str or dict) – Path to parameters yaml file or parameters dictionary
  • spiketrains (list) – List of neo.SpikeTrains (alternative to params definition)
  • verbose (bool) – If True, the output is verbose
Returns:

Generated spike train generator object

Return type:

SpikeTrainGenerator

function gen_recordings

generation_tools.gen_recordings(params=None, templates=None, tempgen=None, spgen=None, verbose=True, tmp_mode='memmap', template_ids=None, tmp_folder=None, n_jobs=0, drift_dicts=None)[source]

Generates recordings.

Parameters:
  • templates (str) – Path to generated templates
  • params (dict or str) – Dictionary containing recording parameters OR path to yaml file containing parameters
  • tempgen (TemplateGenerator) – Template generator object
  • spgen (SpikeTrainGenerator) – Spike train generator object. If None spike trains are created from params[‘spiketrains’]
  • verbose (bool or int) – Determines the level of verbose. If 1 or True, low-level, if 2 high level, if False, not verbose
  • tmp_mode (None, 'h5' 'memmap') – Use temporary file h5 memmap or None None is no temporary file
  • template_ids (list or None) – If None, templates are selected randomly based on selection rules. If a list of indices is provided, the indices are used to select templates (template selection is bypassed)
  • tmp_folder (str or Path) – In case of tmp files, you can specify the folder. If None, then it is automatic using tempfile.mkdtemp()
Returns:

Generated recording generator object

Return type:

RecordingGenerator

Module MEArec.tools