virtual_knitting_machine.knitting_machine_warnings.Knitting_Machine_Warning module

A module containing the base class for knitting machine warnings. This module provides the foundational warning class that all knitting machine-specific warnings inherit from, standardizing warning message formatting and handling behavior across the virtual knitting machine system.

exception Knitting_Machine_Warning(message, ignore_instructions=False)[source]

Bases: RuntimeWarning

Base class for warnings about the state of the knitting machine that can be handled gracefully. This class provides standardized warning message formatting and supports configurable instruction ignoring behavior for different types of machine state issues.

Parameters:
  • message (str)

  • ignore_instructions (bool)

__init__(message, ignore_instructions=False)[source]

Initialize a knitting machine warning with formatted message.

Parameters:
  • message (str) – The descriptive warning message about the machine state issue.

  • ignore_instructions (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.