arborize package#
Subpackages#
Submodules#
arborize.definitions module#
- class arborize.definitions.CableProperties(Ra: float = None, cm: float = None)[source]#
Bases:
Copy
,Merge
,Assert
,Iterable
- Ra: float = None#
- cm: float = None#
Axial resistivity in ohm/cm
- class arborize.definitions.CableType(cable_property_class=<class 'arborize.definitions.CableProperties'>)[source]#
Bases:
object
- add_mech(mech_id: str | tuple[str] | tuple[str, str] | tuple[str, str, str], mech: Mechanism)[source]#
- add_synapse(label: str | tuple[str] | tuple[str, str] | tuple[str, str, str], synapse: Synapse)[source]#
- classmethod anchor(defs: ~typing.Iterable[~arborize.definitions.CableType], synapses: dict[typing.Union[str, tuple[str], tuple[str, str], tuple[str, str, str]], arborize.definitions.Synapse] | None = None, use_defaults: bool = False, ion_class=<class 'arborize.definitions.Ion'>) CableType [source]#
- cable: CableProperties#
- ions: dict[str, arborize.definitions.Ion]#
- mechs: dict[Union[str, tuple[str], tuple[str, str], tuple[str, str, str]], arborize.definitions.Mechanism]#
- synapses: dict[Union[str, tuple[str], tuple[str, str], tuple[str, str, str]], arborize.definitions.Synapse]#
- class arborize.definitions.CableTypeDict#
Bases:
dict
- cable: CablePropertiesDict#
- ions: dict[str, arborize.definitions.IonDict]#
- mechanisms: dict[Union[str, tuple[str], tuple[str, str], tuple[str, str, str]], dict[str, float]]#
- synapses: dict[Union[str, tuple[str], tuple[str, str], tuple[str, str, str]], Union[dict[str, float], arborize.definitions.ExpandedSynapseDict]]#
- class arborize.definitions.Definition(use_defaults=False)[source]#
Bases:
Generic
[CT
,CP
,I
,M
,S
],ABC
- add_synapse_type(label: str | tuple[str] | tuple[str, str] | tuple[str, str, str], synapse: S)[source]#
- abstract class property cable_properties_class: Type[CP]#
- abstract class property cable_type_class: Type[CT]#
- abstract class property ion_class: Type[I]#
- abstract class property mechanism_class: Type[M]#
- abstract class property synapse_class: Type[S]#
- class arborize.definitions.ExpandedSynapseDict#
Bases:
dict
- mechanism: str | tuple[str] | tuple[str, str] | tuple[str, str, str]#
- parameters: dict[str, float]#
- class arborize.definitions.Ion(rev_pot: float = None, int_con: float = None, ext_con: float = None)[source]#
Bases:
Copy
,Merge
,Assert
,Iterable
- ext_con: float = None#
- int_con: float = None#
- rev_pot: float = None#
- class arborize.definitions.ModelDefinition(use_defaults=False)[source]#
Bases:
Definition
[CableType
,CableProperties
,Ion
,Mechanism
,Synapse
]- cable_properties_class[source]#
alias of
CableProperties
- class arborize.definitions.ModelDefinitionDict#
Bases:
dict
- cable_types: dict[str, arborize.definitions.CableTypeDict]#
- synapse_types: dict[Union[str, tuple[str], tuple[str, str], tuple[str, str, str]], Union[dict[str, float], arborize.definitions.ExpandedSynapseDict]]#
- class arborize.definitions.Synapse(parameters, mech_id: str | tuple[str] | tuple[str, str] | tuple[str, str, str])[source]#
Bases:
Mechanism
- mech_id: tuple[str] | tuple[str, str] | tuple[str, str, str]#
- arborize.definitions.define_model(template: ModelDefinition, definition: ModelDefinitionDict, /, use_defaults: bool = False) ModelDefinition [source]#
- arborize.definitions.define_model(definition: ModelDefinitionDict, /, use_defaults: bool = False) ModelDefinition
arborize.exceptions module#
- exception arborize.exceptions.ArborizeError(*args, **kwargs)#
Bases:
DetailedException
ArborizeError exception
- exception arborize.exceptions.ConstructionError(*args, **kwargs)#
Bases:
SchematicError
ConstructionError exception
- exception arborize.exceptions.FrozenError(*args, **kwargs)#
Bases:
SchematicError
FrozenError exception
- exception arborize.exceptions.ModelDefinitionError(*args, **kwargs)#
Bases:
ArborizeError
ModelDefinitionError exception
- exception arborize.exceptions.ModelError(*args, **kwargs)#
Bases:
ArborizeError
ModelError exception
- exception arborize.exceptions.SchematicError(*args, **kwargs)#
Bases:
ArborizeError
SchematicError exception
- exception arborize.exceptions.TransmitterError(*args, **kwargs)#
Bases:
ModelError
TransmitterError exception
- exception arborize.exceptions.UnknownLocationError(*args, **kwargs)#
Bases:
ModelError
UnknownLocationError exception
- exception arborize.exceptions.UnknownSynapseError(*args, **kwargs)#
Bases:
ModelError
UnknownSynapseError exception
arborize.parameter module#
arborize.schematic module#
- class arborize.schematic.Branch[source]#
Bases:
object
- children: list['Branch']#
- points: list[arborize.schematic.Point]#
- class arborize.schematic.CableBranch[source]#
Bases:
Branch
- children: list['CableBranch']#
- parent: CableBranch | None#
- class arborize.schematic.Point(loc, branch: UnitBranch, coords, radius)[source]#
Bases:
object
- class arborize.schematic.Schematic(name=None)[source]#
Bases:
object
A schematic is an intermediate object that associates parameter definitions to points in space. You can define locations (3d coords + radius) and tag them with labels, or set parameters directly on the locations. You can pass a schematic to a Builder, which will freeze the schematic (no changes can be made anymore) and create a simulator specific instance of the model.
Schematics create a user-facing layer of “virtual branches”, which is the network graph of the created locations. However, NEURON does not support the resolution that arbor does, so an underlying layer of “true branches” is created. In NEURON, a map is kept on the model between the locations on the virtual branches and the locations on the true branches, so that we can arbitrarily split up true branches into smaller pieces to achieve the resolution we need.
- arbor: CableCellTemplate | None#
- create_location(location: tuple[int, int], coords, radii, labels, endpoint=None)[source]#
Add a new location to the schematic. A location is a tuple of the branch id and point-on-branch id. Locations must be appended in ascending order.
- Parameters:
location –
coords –
radii –
labels –
endpoint –
- Returns:
- property definition#
Definition of the model, contains the definition of the parameters for the cables, mechanisms, and synapses of this model.
- property name#
Base name for all the instances of this model. Suffixed unique names for each instance can be obtained by calling
create_name
.
arborize.synapse module#
Module contents#
Write descriptions for NEURON cell models in an Arbor-like manner for both the Arbor and NEURON brain simulation engines.
- class arborize.CableProperties(Ra: float = None, cm: float = None)[source]#
Bases:
Copy
,Merge
,Assert
,Iterable
- Ra: float = None#
- cm: float = None#
Axial resistivity in ohm/cm
- class arborize.CableType(cable_property_class=<class 'arborize.definitions.CableProperties'>)[source]#
Bases:
object
- add_mech(mech_id: str | tuple[str] | tuple[str, str] | tuple[str, str, str], mech: Mechanism)[source]#
- add_synapse(label: str | tuple[str] | tuple[str, str] | tuple[str, str, str], synapse: Synapse)[source]#
- classmethod anchor(defs: ~typing.Iterable[~arborize.definitions.CableType], synapses: dict[typing.Union[str, tuple[str], tuple[str, str], tuple[str, str, str]], arborize.definitions.Synapse] | None = None, use_defaults: bool = False, ion_class=<class 'arborize.definitions.Ion'>) CableType [source]#
- cable: CableProperties#
- ions: dict[str, arborize.definitions.Ion]#
- mechs: dict[Union[str, tuple[str], tuple[str, str], tuple[str, str, str]], arborize.definitions.Mechanism]#
- synapses: dict[Union[str, tuple[str], tuple[str, str], tuple[str, str, str]], arborize.definitions.Synapse]#
- class arborize.Ion(rev_pot: float = None, int_con: float = None, ext_con: float = None)[source]#
Bases:
Copy
,Merge
,Assert
,Iterable
- ext_con: float = None#
- int_con: float = None#
- rev_pot: float = None#
- class arborize.ModelDefinition(use_defaults=False)[source]#
Bases:
Definition
[CableType
,CableProperties
,Ion
,Mechanism
,Synapse
]- cable_properties_class[source]#
alias of
CableProperties
- class arborize.Schematic(name=None)[source]#
Bases:
object
A schematic is an intermediate object that associates parameter definitions to points in space. You can define locations (3d coords + radius) and tag them with labels, or set parameters directly on the locations. You can pass a schematic to a Builder, which will freeze the schematic (no changes can be made anymore) and create a simulator specific instance of the model.
Schematics create a user-facing layer of “virtual branches”, which is the network graph of the created locations. However, NEURON does not support the resolution that arbor does, so an underlying layer of “true branches” is created. In NEURON, a map is kept on the model between the locations on the virtual branches and the locations on the true branches, so that we can arbitrarily split up true branches into smaller pieces to achieve the resolution we need.
- arbor: CableCellTemplate | None#
- cables: list['CableBranch']#
- create_location(location: tuple[int, int], coords, radii, labels, endpoint=None)[source]#
Add a new location to the schematic. A location is a tuple of the branch id and point-on-branch id. Locations must be appended in ascending order.
- Parameters:
location –
coords –
radii –
labels –
endpoint –
- Returns:
- property definition#
Definition of the model, contains the definition of the parameters for the cables, mechanisms, and synapses of this model.
- property name#
Base name for all the instances of this model. Suffixed unique names for each instance can be obtained by calling
create_name
.
- roots: list['UnitBranch']#
- arborize.bsb_schematic(morphology: Morphology, definitions: Definition | None = None) Schematic [source]#
- arborize.define_constraints(constraints: ConstraintsDefinitionDict, tolerance=None, use_defaults=False) ConstraintsDefinition [source]#
- arborize.define_model(templ_or_def, def_dict=None, /, use_defaults=False) ModelDefinition [source]#
- arborize.file_schematic(file_like: str | os.PathLike | TextIO, definitions: Definition | None = None, fname: str = None, *, name=None) Schematic [source]#