virtual_knitting_machine.machine_state_violation_handling.machine_state_violations module

Modula containing structures for tracking responses to machine-state violations.

class ViolationAction(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: Enum

Enumeration of actions taken in response to violations.

RAISE = 1
WARN = 2
IGNORE = 3
classmethod __contains__(member)

Return True if member is a member of this enum raises TypeError if member is not an enum member

note: in 3.12 TypeError will no longer be raised, and True will also be returned if member is the value of a member in this enum

classmethod __getitem__(name)

Return the member matching name.

classmethod __iter__()

Return members in definition order.

classmethod __len__()

Return the number of members (no aliases)

class ViolationResponse(action=ViolationAction.RAISE, handle=True, proceed_with_operation=True)[source]

Bases: object

A response policy for a violation

action: ViolationAction = 1
handle: bool = True
proceed_with_operation: bool = True
__init__(action=ViolationAction.RAISE, handle=True, proceed_with_operation=True)
class Violation(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: Enum

Enumeration of all violations of the machine state’s requirements that can be handled by custom policies

Machine_State_Violation = 1
YARN_CARRIER_VIOLATION = 2
INSERTING_HOOK_IN_USE = 3
HOOKED_CARRIER = 4
BlOCKED_BY_HOOK = 5
INACTIVE_CARRIER = 6
INHOOK_RIGHTWARDS = 7
MAKE_LOOP_ON_SLIDER = 8
RACKING_OUT_OF_RANGE = 9
classmethod __contains__(member)

Return True if member is a member of this enum raises TypeError if member is not an enum member

note: in 3.12 TypeError will no longer be raised, and True will also be returned if member is the value of a member in this enum

classmethod __getitem__(name)

Return the member matching name.

classmethod __iter__()

Return members in definition order.

classmethod __len__()

Return the number of members (no aliases)