knitout_interpreter.knitout_operations.kick_instruction module — knitout-interpreter 0.0.18 documentation

# knitout_interpreter.knitout_operations.kick_instruction module

Module containing the Kick_Instruction class.

class knitout_interpreter.knitout_operations.kick_instruction.Kick_Instruction(position, direction, cs=None, comment=None)

  Bases: `Miss_Instruction`

  A subclass of the Miss_Instruction used to mark kickbacks added in dat-complication process.

  property position: int

    Returns: The position from the front bed to kick the carrier to.

  property no_carriers: bool

    Check if this is a soft-miss kickback with no carriers.

    Returns:

      True if this is a soft-miss kickback with no carriers. No carriers can be set with a null carrier set or a carrier set with a 0 carrier (not a valid index for a carrier).

  execute(machine_state)

    Position the carrier above the given front-bed needle position.

    Parameters:

      machine_state (Knitting_Machine) – The machine state to update.

    Returns:

      True indicating the operation completed successfully.

    Return type:

      bool

  static execute_kick(machine_state, needle, direction, cs, comment=None)

    Execute a kick instruction on the machine.

    Parameters:

      - machine_state (Knitting_Machine) – The current machine model to update.

      - needle (Needle | int) – The needle or front-bed needle position to move the carrier set to.

      - direction (str | Carriage_Pass_Direction) – The direction to execute in.

      - cs (Yarn_Carrier_Set) – The yarn carriers set to execute with.

      - comment (str | None) – Additional details to document in the knitout.

    Returns:

      The instruction that was executed.

    Return type:

      Miss_Instruction