bluepyopt.ephys.models

Cell template class

class bluepyopt.ephys.models.CellModel(name, morph=None, mechs=None, params=None, gid=0)[source]

Bases: bluepyopt.ephys.models.Model

Cell model class

Constructor

Parameters:
  • name (str) – name of this object should be alphanumeric string, underscores are allowed, first char should be a letter
  • morph (Morphology) – underlying Morphology of the cell
  • mechs (list of Mechanisms) – Mechanisms associated with the cell
  • params (list of Parameters) – Parameters of the cell model
check_name()[source]

Check if name complies with requirements

check_nonfrozen_params(param_names)[source]

Check if all nonfrozen params are set

static create_empty_cell(name, sim, seclist_names=None, secarray_names=None)[source]

Create an empty cell in Neuron

static create_empty_template(template_name, seclist_names=None, secarray_names=None)[source]

create an hoc template named template_name for an empty cell

create_hoc(param_values, ignored_globals=(), template='cell_template.jinja2', disable_banner=False, template_dir=None)[source]

Create hoc code for this model

destroy(sim=None)[source]

Destroy instantiated model in simulator

freeze(param_dict)[source]

Set params

instantiate(sim=None)[source]

Instantiate model in simulator

params_by_names(param_names)[source]

Get parameter objects by name

unfreeze(param_names)[source]

Unset params

class bluepyopt.ephys.models.HocCellModel(name, morphology_path, hoc_path=None, hoc_string=None)[source]

Bases: bluepyopt.ephys.models.CellModel

Wrapper class for a hoc template so it can be used by BluePyOpt

Constructor

Parameters:
  • name (str) – name of this object
  • sim (NrnSimulator) – simulator in which to instatiate hoc_string
  • hoc_path (str) – Path to a hoc file (hoc_path and hoc_string can’t be used simultaneously, but one of them has to specified)
  • hoc_string (str) – String that of hoc code that defines a template (hoc_path and hoc_string can’t be used simultaneously, but one of them has to specified))
  • morphology_path (str path) – path to morphology that can be loaded by Neuron
static get_template_name(hoc_string)[source]

Find the template name from hoc_string

Note: this will fail if there is a begintemplate in a /* */ style comment before the real begintemplate

static load_hoc_template(sim, hoc_string)[source]

Have neuron hoc template, and detect what the name template name is

The template must have an init that takes two parameters, the second of which is the path to a morphology.

It must also have a CellRef member that is the result of
Import3d_GUI(...).instantiate()
class bluepyopt.ephys.models.HocMorphology(morphology_path)[source]

Bases: bluepyopt.ephys.morphologies.Morphology

wrapper for Morphology so that it has a morphology_path

class bluepyopt.ephys.models.Model(name)[source]

Bases: object

Constructor :param name: name of the model :type name: str

destroy(sim=None)[source]

Destroy instantiated model in simulator

instantiate(sim=None)[source]

Instantiate model in simulator