LocsetExpr#

class braincell.filter.LocsetExpr[source]#
evaluate(morpho, cache=None)[source]#

Evaluate this expression against morpho.

Parameters:
  • morpho (Morphology) – Morphology to evaluate against.

  • cache (SelectionCache | None) – Shared memoization scratch space, threaded to sub-expressions.

Returns:

The selected point set.

Return type:

LocsetMask

Raises:

TypeError – If morpho is not a braincell.Morphology.

Notes

This is the type-checked entry point every caller uses; subclasses implement _evaluate() instead. Keeping the guard here rather than in each leaf is why it cannot be forgotten – it previously was, by EmptyRegion, which accepted arguments every sibling rejected.

unique()[source]#

Return an expression that deduplicates locations after evaluation.

Return type:

LocsetExpr