broken_handler_refs

broken_handler_refs#

penzai.data_effects.effect_base.broken_handler_refs(model_tree: Any) list[HandledEffectRef][source]#

Collects the effect types of each broken HandledEffectRef in a (sub)model.

A broken handler reference occurs when a model contains a HandledEffectRef and is then removed from the handler for that ref. This is OK if you are making a targeted modification and will insert it back into the handler, but it can cause problems if the subtree is extracted and used in a different context.

Parameters:

model_tree – A pytree for a model or submodel.

Returns:

A list of all broken HandledEffectRef nodes in the submodel.