CVPolicy#

class braincell.CVPolicy[source]#

Base class for morphology-to-CV discretization policies.

A CVPolicy answers one question: for each branch in a morphology, which normalized intervals should become control volumes. The rest of the cell stack treats policy output as the source of truth for CV splitting.

Cell owns one policy instance. During rebuild the CV lowering pipeline calls resolve_cv_bounds(), feeds the result into the geometry / mechanism passes, and freezes the outputs into CV records.

abstractmethod resolve_cv_bounds(morpho, *, paint_rules=None)[source]#

Return normalized CV intervals for each branch.

Parameters:
  • morpho (Morphology) – Morphology being discretized.

  • paint_rules (tuple[PaintRule, ...] | None) – Normalized paint declarations. Policies that depend on cable properties, such as DLambda, may inspect them.

Returns:

Branch-wise normalized (prox, dist) intervals.

Return type:

tuple[tuple[tuple[float, float], ...], ...]