DanglerMatch

class samplomatic.pre_samplex.DanglerMatch(direction: Direction | None = None, node_types: tuple[type[PreNode], ...] | None = None, dangler_type: DanglerType | None = None)[source]

Bases: object

A helper class to specify conditions on danglers.

Attributes Summary

dangler_type

The desired type of dangler.

direction

The desired direction of the node.

node_types

The desired type of the node.

Methods Summary

match_node(node)

Check if a node matches the conditions specified in the object

Attributes Documentation

dangler_type: DanglerType | None = None

The desired type of dangler.

Set to None to get both required and optional danglers.

direction: Direction | None = None

The desired direction of the node.

Set to None to get all node directions. Note that setting to BOTH will only match nodes with BOTH direction.

node_types: tuple[type[PreNode], ...] | None = None

The desired type of the node.

Set to None to get all node types.

Methods Documentation

match_node(node: PreNode) bool[source]

Check if a node matches the conditions specified in the object