# knitout_interpreter.knitout_operations.carrier_instructions module

Knitout Operations that involve the yarn inserting system

class knitout_interpreter.knitout_operations.carrier_instructions.Yarn_Carrier_Instruction(instruction_type, carrier, comment)

  Bases: `Knitout_Instruction`

  get_yarn(machine)

    Get the yarn on the specified carrier.

    Parameters:

      machine (Knitting_Machine) – The knitting machine to get yarn from.

    Returns:

      The yarn on the specified carrier on the given machine.

    Return type:

      Machine_Knit_Yarn

  get_carrier(machine)

    Get the yarn carrier specified on the given machine.

    Parameters:

      machine (Knitting_Machine) – The knitting machine to get the carrier from.

    Returns:

      The yarn carrier specified on the given machine.

    Return type:

      Yarn_Carrier

class knitout_interpreter.knitout_operations.carrier_instructions.Hook_Instruction(instruction_type, carrier, comment)

  Bases: `Yarn_Carrier_Instruction`

class knitout_interpreter.knitout_operations.carrier_instructions.In_Instruction(carrier, comment=None)

  Bases: `Yarn_Carrier_Instruction`

  execute(machine_state)

    Execute the instruction on the machine state.

    Parameters:

      machine_state (Knitting_Machine) – The machine state to update.

    Returns:

      True if the process completes an update.

    Return type:

      bool

  static execute_in(machine_state, carrier, comment=None)

    Execute an ‘in’ instruction to bring a carrier into the knitting area.

    Parameters:

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

      - carrier (int | Yarn_Carrier) – The carrier to execute with.

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

    Returns:

      The instruction that was executed.

    Return type:

      In_Instruction

class knitout_interpreter.knitout_operations.carrier_instructions.Inhook_Instruction(carrier_set, comment=None)

  Bases: `Hook_Instruction`

  execute(machine_state)

    Execute the instruction on the machine state.

    Parameters:

      machine_state (Knitting_Machine) – The machine state to update.

    Returns:

      True if the process completes an update.

    Return type:

      bool

  static execute_inhook(machine_state, carrier, comment=None)

    Execute an ‘inhook’ instruction to hook a carrier into position.

    Parameters:

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

      - carrier (int | Yarn_Carrier) – The carrier to execute with.

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

    Returns:

      The instruction that was executed.

    Return type:

      Inhook_Instruction

class knitout_interpreter.knitout_operations.carrier_instructions.Releasehook_Instruction(carrier, comment=None, preferred_release_direction=None)

  Bases: `Hook_Instruction`

  property preferred_release_direction: Carriage_Pass_Direction

    Get the preferred direction to release this carrier.

    Returns:

      The preferred direction to release this carrier in. Will default to leftward release.

  execute(machine_state)

    Execute the instruction on the machine state.

    Parameters:

      machine_state (Knitting_Machine) – The machine state to update.

    Returns:

      True if the process completes an update.

    Return type:

      bool

  static execute_releasehook(machine_state, carrier, comment=None)

    Execute a ‘releasehook’ instruction to release a hooked carrier.

    Parameters:

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

      - carrier (int | Yarn_Carrier) – The carrier to execute with.

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

    Returns:

      The instruction that was executed.

    Return type:

      Releasehook_Instruction

class knitout_interpreter.knitout_operations.carrier_instructions.Out_Instruction(carrier, comment=None)

  Bases: `Yarn_Carrier_Instruction`

  execute(machine_state)

    Execute the instruction on the machine state.

    Parameters:

      machine_state (Knitting_Machine) – The machine state to update.

    Returns:

      True if the process completes an update.

    Return type:

      bool

  static execute_out(machine_state, carrier, comment=None)

    Execute an ‘out’ instruction to move a carrier out of the knitting area.

    Parameters:

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

      - carrier (int | Yarn_Carrier) – The carrier to execute with.

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

    Returns:

      The instruction that was executed.

    Return type:

      Out_Instruction

class knitout_interpreter.knitout_operations.carrier_instructions.Outhook_Instruction(carrier_set, comment=None)

  Bases: `Hook_Instruction`

  execute(machine_state)

    Execute the instruction on the machine state.

    Parameters:

      machine_state (Knitting_Machine) – The machine state to update.

    Returns:

      True if the process completes an update.

    Return type:

      bool

  static execute_outhook(machine_state, carrier, comment=None)

    Execute an ‘outhook’ instruction to hook a carrier out of position.

    Parameters:

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

      - carrier (int | Yarn_Carrier) – The carrier to execute with.

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

    Returns:

      The instruction that was executed.

    Return type:

      Outhook_Instruction