DLambda#

class braincell.DLambda(d_lambda, frequency=<factory>, keep_odd=True)[source]#

Splits each branch using the NEURON-style d_lambda discretization.

Computes lambda_f per segment from branch diameter, Ra, cm, and frequency. Sums the electrotonic length of the branch, divides by d_lambda, and rounds up to the next integer (optionally promoted to an odd count when keep_odd is True).

This policy requires uniform (Ra, cm) within each branch. Painting a different CableProperty onto a sub-interval of a branch raises ValueError. Resting-potential and temperature variations within a branch are explicitly allowed — only the two cable values that enter lambda_f are checked for uniformity.

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

Return branch-wise CV bounds from electrotonic length.

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

  • paint_rules (tuple[PaintRule, ...] | None) – Paint declarations used to resolve branch-wise cable properties.

Returns:

Branch-wise normalized intervals sized by the d-lambda rule.

Return type:

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