knitout_to_dat_python.kickback_injection.carriage_pass_with_kick module

Module containing the Carriage_Pass_with_Kick class.

This module provides a wrapper class for Carriage_Pass that allows kickback instructions to be integrated with regular knit-tuck passes. This enables carrier management operations to be combined with knitting operations in a single carriage pass.

class Carriage_Pass_with_Kick(carriage_pass: Carriage_Pass, kicks: list[Kick_Instruction])[source]

Bases: Carriage_Pass

Wrapper class for Carriage Pass that allows for kickbacks to be added to knit-tuck passes.

This class extends the standard Carriage_Pass to support the integration of kick instructions (kickbacks) with regular knitting operations. It combines all instructions into a properly sorted execution order based on needle positions and carriage direction.

Parameters:
  • carriage_pass (Carriage_Pass)

  • kicks (list[Kick_Instruction])

__init__(carriage_pass: Carriage_Pass, kicks: list[Kick_Instruction])[source]

Initialize a Carriage_Pass_with_Kick.

Creates a new carriage pass that combines the original carriage pass instructions with the provided kick instructions. Sorts them according to the carriage direction and needle positions for proper execution order.

Parameters:
  • carriage_pass (Carriage_Pass) – The original carriage pass to extend with kick instructions.

  • kicks (list[Kick_Instruction]) – The list of kick instructions to integrate with the carriage pass.

Raises:

AssertionError – If any instruction cannot be added to the carriage pass.

compatible_with_pass_type(instruction: Needle_Instruction) bool[source]

Check if an instruction is compatible with this carriage pass type.

Extends the parent class compatibility check to allow kick instructions in addition to the standard compatible instruction types.

Parameters:

instruction (Needle_Instruction) – The instruction to check for compatibility.

Returns:

True if the instruction is compatible with this carriage pass type, False otherwise.

Return type:

bool