virtual_knitting_machine.knitting_machine_warnings.Needle_Warnings module
A module containing warnings related to needle operations and states on knitting machines. This module provides warning classes for various needle-related issues including loop capacity violations, transfer operations on empty needles, and knitting operations on needles without loops.
- exception Needle_Warning(needle, message)[source]
Bases:
Knitting_Machine_WarningBase class for warnings related to specific needle operations and states. This class provides a foundation for all needle-specific warnings and includes the needle reference for detailed error reporting and debugging.
- __init__(needle, message)[source]
Initialize a needle-specific warning.
- Parameters:
needle (Needle_Specification) – The needle involved in the warning condition.
message (str) – The descriptive warning message about the needle state or operation.
- 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 Needle_Holds_Too_Many_Loops(needle, max_loop_allowance)[source]
Bases:
Needle_WarningA warning for needles that have reached their maximum loop holding capacity. This warning occurs when attempting to add loops to a needle that is already at or near its maximum capacity as defined by the machine specification.
- 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.
- needle: Needle_Specification
- exception Knit_on_Empty_Needle_Warning(needle)[source]
Bases:
Needle_WarningA warning for knitting operations attempted on needles that do not hold any loops. This warning indicates that a knitting operation was requested on an empty needle, which may produce unexpected results or indicate a programming error in the knitting sequence.
- __init__(needle)[source]
Initialize a knit on empty needle warning.
- Parameters:
needle (Needle) – The empty needle on which a knit operation was attempted.
- 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.
- needle: Needle_Specification
- exception Xfer_Dropped_Loop_Warning(needle)[source]
Bases:
Needle_WarningWarning for attempting to transfer dropped loops to target needles. This occurs when trying to transfer a loop that has already been dropped from the machine, which is not physically possible as the loop is no longer held by any needle.
- __init__(needle)[source]
Initialize a transfer dropped loop exception.
- Parameters:
needle (Needle_Specification) – The target needle where transfer of a dropped loop was attempted.
- 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.
- needle: Needle_Specification