knit_graphs.artin_wale_braids.Crossing_Direction module

Module containing the Crossing_Direction Enum.

This module defines the Crossing_Direction enumeration which represents the different ways loops can cross over or under each other in cable knitting patterns.

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

Bases: Enum

Enumeration of crossing directions between loops in cable knitting patterns.

This enumeration represents the three possible crossing relationships between loops: crossing over to the right, crossing under to the right, or no crossing at all. These directions are fundamental to representing cable structures in knitted fabrics.

Over_Right = '+'
Under_Right = '-'
No_Cross = '|'
property opposite: Crossing_Direction

Get the opposite crossing direction of this direction.

The Over_Right and Under_Right crossing directions are opposites of each other, while No_Cross is its own opposite since there is no crossing to invert.

Returns:

The opposite of this crossing direction. Over_Right returns Under_Right, Under_Right returns Over_Right, and No_Cross returns No_Cross.

Return type:

Crossing_Direction

__invert__()[source]

Get the opposite crossing direction using the bitwise inversion operator.

Returns:

The opposite crossing direction, same as calling the opposite property.

Return type:

Crossing_Direction

__neg__()[source]

Get the opposite crossing direction using the negation operator.

Returns:

The opposite crossing direction, same as calling the opposite property.

Return type:

Crossing_Direction

__str__()[source]

Get the string representation of the crossing direction.

Returns:

The symbol representing the crossing direction (“+”, “-”, or “|”).

Return type:

str

__repr__()[source]

Get the representation string of the crossing direction for debugging.

Returns:

The name of the crossing direction (“Over_Right”, “Under_Right”, or “No_Cross”).

Return type:

str

__hash__()[source]

Get the hash value of the crossing direction for use in sets and dictionaries.

Returns:

Hash value based on the crossing direction value.

Return type:

int

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)