HalfFace.cells_where_predicate

HalfFace.cells_where_predicate(predicate, data=False)[source]

Get cells for which a certain condition or set of conditions is true using a lambda function.

Parameters
  • predicate (callable) – The condition you want to evaluate. The callable takes 2 parameters: the cell identifier and the cell attributes, and should return True or False.

  • data (bool, optional) – If True, yield the cell attributes in addition to the identifiers.

Yields

int | tuple[int, dict[str, Any]] – If data is False, the next cell that matches the condition. If data is True, the next cell and its attributes.