# Children class

(Shortest import: `from brian2.spatialneuron.morphology import Children)`

class brian2.spatialneuron.morphology.Children(owner)

  Bases: `object`

  Helper class to represent the children (sub trees) of a section. Can be used like a dictionary (mapping names to `Morphology` objects), but iterates over the values (sub trees) instead of over the keys (names).

  Methods

  `add`(name, subtree[, automatic_name]) | Add a new child to the morphology.
  `name`(child) | Return the given name (i.e. not the automatic name such as `1`) for a child subtree.
  `remove`(name) | Remove a subtree from this morphology.

  Details

  add(name, subtree, automatic_name=False)

    Add a new child to the morphology.

    Parameters:

      name : str

      > The name (e.g. `"axon"`, `"soma"`) to use for this sub tree.

      subtree : `Morphology`

      > The subtree to link as a child.

      automatic_name : bool, optional

      > Whether to chose a new name automatically, if a subtree of the same name already exists (uses e.g. `"dend2"` instead `"dend"`). Defaults to `False` and will raise an error instead.

  name(child)

    Return the given name (i.e. not the automatic name such as `1`) for a child subtree.

    Parameters:

      child : `Morphology`

    Returns:

      name : str

      > The given name for the `child`.

  remove(name)

    Remove a subtree from this morphology.

    Parameters:

      name : str

      > The name of the sub tree to remove.