arborize package

arborize.core module

class arborize.core.Builder(builder)[source]

Bases: object

A builder is a method interface that exposes an instantiate method that can be passed the model that is being instantiated. You can create your own builder by initializing a builder with a builder function, which is a function that takes the model and all it’s contructor arguments as its own arguments. It’s a builder’s responsibility to add or label sections.

Constructing your own Builders is of limited use, because every model’s morphologies field takes morphology files and/or builder functions and automatically constructs and applies the Builder from there:

class MyNeuron(NeuronModel):
    @staticmethod
    def build(model, *args, **kwargs):
        model.soma.append(p.Section())
        model.dendrites.append(p.Section())
        model.axon.append(p.Section())

    # Creates 2 different morphologies for this cell model.
    morphologies = [
        build, # Create 1 soma, dendrite & axonal compartment
        ('morfo2.swc', self.extend_axon) # First loads morfo2.swc
    ]
instantiate(model, *args, **kwargs)[source]
class arborize.core.ComboBuilder(*pipeline)[source]

Bases: arborize.core.Builder

Chains together multiple morphology files and/or builder functions.

class arborize.core.NeuronModel(position=None, morphology_id=0)[source]

Bases: object

The base class that helps you describe your model. Generate all the required sections, insert all mechanisms and define all synapses using the appropriate class variables. See the NeuronModel Reference

boot()[source]
connect(from_cell, from_section, to_section, synapse_type=None)[source]

Connect this cell as the postsynaptic cell in a connection with from_cell between the from_section and to_section. Additionally a synapse_type can be specified if there’s multiple synapse types present on the postsynaptic section.

Parameters
  • from_cell (NeuronModel) – The presynaptic cell.

  • from_section (Section) – The presynaptic section.

  • to_section (Section) – The postsynaptic section.

  • synapse_type (string) – The name of the synapse type.

create_synapse(section, synapse_type=None)[source]

Create a synapse in the specified section based on the synapse definitions present on this model. Additionally a synapse_type can be specified if there’s multiple synapse types present on the section.

Parameters
  • section (Section) – The postsynaptic section.

  • synapse_type (string) – The name of the synapse type.

record_soma()[source]
set_reference_id(id)[source]

Add an id that can be used as reference for outside software.

arborize.core.import3d(file, model)[source]

Perform NEURON’s Import3D and import file 3D data into the model.

arborize.core.make_builder(blueprint)[source]

Turn a blueprint (morphology string, builder function or tuple of the former) into a Builder.

arborize.synapse module

class arborize.synapse.Synapse(cell, section, point_process_name, attributes={}, variant=None)[source]

Bases: object

stimulate(*args, **kwargs)[source]

Module contents

arborize.add_directory(path)[source]

Add a path that Arborize should look through for morphology files.