knit_script.knit_script_interpreter.Machine_Specification module

Module containing enumerations of common machine value terms.

This module provides enumerations and utilities for representing knitting machine specifications and bed positions. It defines the Machine_Bed_Position enumeration which represents different needle bed positions on knitting machines, along with utility methods for working with bed positions and determining bed characteristics.

class Machine_Bed_Position(value)[source]

Bases: Enum

Enumeration of positions on needle beds.

The Machine_Bed_Position enumeration defines the different types of needle bed positions available on knitting machines. It distinguishes between front and back beds, as well as standard needle beds and slider beds, providing a comprehensive representation of needle positioning options.

This enumeration includes utility methods for determining bed characteristics such as whether a position is on the front bed or represents a slider bed,

making it easier to work with needle positioning logic throughout the knit script system.

Front = 'front'
Front_Slider = 'front_slider'
Back = 'back'
Back_Slider = 'back_slider'
property is_front: bool

Check if this is a front bed position.

Returns:

True if this represents a front bed position (either standard front bed or front slider bed).

Return type:

bool

property is_slider: bool

Check if this represents a slider bed.

Returns:

True if this represents a slider bed position (either front slider or back slider).

Return type:

bool

static get_bed(is_front, is_slider=False)[source]

Get the corresponding bed position from criteria.

Parameters:
  • is_front (bool) – Whether the bed is on the front of the machine.

  • is_slider (bool, optional) – Whether the bed is a slider bed. Defaults to False.

Returns:

The corresponding bed position based on the specified criteria.

Return type:

Machine_Bed_Position

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)