virtual_knitting_machine.knitting_machine_warnings.Yarn_Carrier_System_Warning module
A module containing warnings related to the yarn carrier system and yarn management operations. This module provides comprehensive warning classes for various yarn carrier issues including state mismatches, duplicate definitions, hook operation errors, and float length violations during machine knitting operations.
- exception Yarn_Carrier_Warning(carrier_id, message, ignore_instruction=False)[source]
Bases:
Knitting_Machine_WarningBase class for warnings related to yarn carrier operations and states. This class provides a foundation for all yarn carrier-specific warnings and includes the carrier ID reference for detailed error reporting and system state tracking.
- __init__(carrier_id, message, ignore_instruction=False)[source]
Initialize a yarn carrier-specific warning.
- Parameters:
carrier_id (int | Yarn_Carrier) – The carrier ID or carrier object involved in the warning condition.
message (str) – The descriptive warning message about the carrier state or operation.
ignore_instruction (bool, optional) – Whether this warning indicates that the operation should be ignored. Defaults to False.
- 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.
- exception In_Active_Carrier_Warning(carrier_id)[source]
Bases:
Yarn_Carrier_WarningA warning for attempting to bring in a carrier that is already active. This warning occurs when an ‘in’ operation is performed on a carrier that is already in active state, indicating redundant operations or state tracking issues.
- __init__(carrier_id)[source]
Initialize an ‘in’ active carrier warning.
- Parameters:
carrier_id (int | Yarn_Carrier) – The carrier that is already active but was requested to be brought in.
- 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.
- carrier_id: Yarn_Carrier_State | int
- exception In_Loose_Carrier_Warning(carrier_id)[source]
Bases:
Yarn_Carrier_WarningA warning for attempting to bring in a loose carrier without proper hook operations. This warning occurs when trying to bring in a carrier that has loose yarn, suggesting that an in-hook operation should be used instead for proper yarn management.
- __init__(carrier_id)[source]
Initialize an ‘in’ loose carrier warning.
- Parameters:
carrier_id (int | Yarn_Carrier) – The loose carrier that was attempted to be brought in.
- 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.
- carrier_id: Yarn_Carrier_State | int
- exception Out_Inactive_Carrier_Warning(carrier_id)[source]
Bases:
Yarn_Carrier_WarningA warning for attempting to bring out a carrier that is not currently active. This warning occurs when an ‘out’ operation is performed on a carrier that is already inactive, indicating redundant operations or state tracking issues.
- __init__(carrier_id)[source]
Initialize an ‘out’ inactive carrier warning.
- Parameters:
carrier_id (int | Yarn_Carrier) – The inactive carrier that was requested to be brought out.
- 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.
- carrier_id: Yarn_Carrier_State | int
- exception Duplicate_Carriers_In_Set(carrier_id, carrier_set)[source]
Bases:
Yarn_Carrier_WarningA warning for duplicate carrier IDs found in carrier sets. This warning occurs when a carrier set is created with duplicate carrier IDs, and the system automatically removes the duplicates to maintain set integrity.
- __init__(carrier_id, carrier_set)[source]
Initialize a duplicate carriers in set warning.
- Parameters:
carrier_id (int | Yarn_Carrier) – The duplicate carrier ID that was removed.
carrier_set (list[int]) – The original carrier set containing duplicates.
- 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.
- carrier_id: Yarn_Carrier_State | int
- exception Long_Float_Warning(carrier_id, prior_needle, next_needle, max_float_len)[source]
Bases:
Yarn_Carrier_WarningA warning for float segments that exceed the maximum allowed length. This warning occurs when yarn floats between needles exceed the specified maximum float length, which may cause knitting issues or affect fabric quality.
- __init__(carrier_id, prior_needle, next_needle, max_float_len)[source]
Initialize a long float warning.
- Parameters:
carrier_id (int | Yarn_Carrier) – The carrier creating the long float.
prior_needle (Needle_Specification) – The needle where the float begins.
next_needle (Needle_Specification) – The needle where the float ends.
max_float_len (int) – The maximum allowed float length that was exceeded.
- 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.
- carrier_id: Yarn_Carrier_State | int