step.motion.path.passes.merge ============================= .. py:module:: step.motion.path.passes.merge .. autoapi-nested-parse:: Merge pass — collapse adjacent same-type segments. Two segments are merge-eligible if they share kind/axis/direction, both have known endpoints, and neither has a stop condition. ``SideAction`` and deferred-placeholder (``None``) entries act as merge barriers. Classes ------- .. autoapisummary:: step.motion.path.passes.merge.MergePass Functions --------- .. autoapisummary:: step.motion.path.passes.merge.can_merge step.motion.path.passes.merge.merge_two step.motion.path.passes.merge.run_merge Module Contents --------------- .. py:function:: can_merge(a: step.motion.path.ir.Segment, b: step.motion.path.ir.Segment) -> bool Return True if two adjacent known-endpoint segments can be merged. .. py:function:: merge_two(a: step.motion.path.ir.Segment, b: step.motion.path.ir.Segment) -> step.motion.path.ir.Segment Merge two compatible segments. Precondition: ``can_merge(a, b)``. .. py:function:: run_merge(nodes: list[step.motion.path.ir.PathNode | None]) -> list[step.motion.path.ir.PathNode | None] Collapse adjacent same-type/same-direction segments with no conditions. .. py:class:: MergePass Compiler pass that runs the merge transform. .. py:attribute:: name :value: 'merge' .. py:method:: run(nodes: list[step.motion.path.ir.PathNode | None]) -> list[step.motion.path.ir.PathNode | None]