quilt_knit.swatch.Merge_Process module
Module containing the Merge_Process class
- exception Failed_Merge_Release_Exception(release)[source]
Bases:
Knitting_Machine_ExceptionException raised when a release required by the merge program cannot be executed.
- Parameters:
release (
Releasehook_Instruction)
- __init__(release)[source]
Initialize a knitting machine exception with formatted message.
- Parameters:
message (str) – The descriptive error message about the machine state or operation failure.
release (
Releasehook_Instruction)
- add_note()
Exception.add_note(note) – add a note to the exception
- args
- with_traceback()
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- class Merge_Process(swatch_connection, starting_swatch_side, seam_search_space)[source]
Bases:
objectSuper class for swatch merging processes that tracks the merged machine state.
- merged_instructions
The ordered list of knitout instructions that result from the merge.
- Type:
list[Knitout_Line]
- Parameters:
swatch_connection (
Swatch_Connection)starting_swatch_side (
Swatch_Side)seam_search_space (
Seam_Search_Space)
- __init__(swatch_connection, starting_swatch_side, seam_search_space)[source]
- Parameters:
swatch_connection (
Swatch_Connection)starting_swatch_side (
Swatch_Side)seam_search_space (
Seam_Search_Space)
- property current_swatch_rack: int
Returns: int: The rack value of the machine state of the current swatch.
- property current_swatch_all_needle_rack: bool
Returns: bool: True if the machine state of the current swatch is set to all needle rack. False, otherwise.
- property merged_and_current_racks_match: bool
Returns: bool: True if the racking values of the merged program state and the current swatch state match. False, otherwise.
- instruction_requires_release(next_instruction)[source]
- Parameters:
next_instruction (Knitout_Line) – The next instruction to test if it requires a releasehook.
- Returns:
True if the specified next instruction would trigger a releasehook from the current merged program machine state.
- Return type:
- get_merged_instructions()[source]
Updates the merged instructions with comments specifying the origin swatch and updated line numbers for the merged program.
- Returns:
List of instructions in the merged program.
- Return type:
list[Knitout_Line]
- write_knitout(merge_name=None)[source]
Creates a knitout file of the given merge name of the merged instructions from this merger.