Skip to content

LineStatus

Bases: Enum

An Enum representing the status of a line in a hexagram.

Attributes:

Name Type Description
CHANGING_YANG int

A solid line that is changing to a broken line.

STATIC_YIN int

A static broken line, representing dark, feminine, etc.

STATIC_YANG int

A static solid line, representing light, masculine, etc.

CHANGING_YIN int

A broken line that is changing to a solid line.

Source code in src/ichingpy/enum/line_status.py
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
class LineStatus(Enum):
    """An Enum representing the status of a line in a hexagram.

    Attributes:
        CHANGING_YANG (int): A solid line that is changing to a broken line.
        STATIC_YIN (int): A static broken line, representing dark, feminine, etc.
        STATIC_YANG (int): A static solid line, representing light, masculine, etc.
        CHANGING_YIN (int): A broken line that is changing to a solid line.
    """

    CHANGING_YIN = 0
    STATIC_YANG = 1
    STATIC_YIN = 2
    CHANGING_YANG = 3

    @property
    def opposite(self):
        """Get the opposite status of the current status."""
        match self:
            case LineStatus.CHANGING_YIN:
                return LineStatus.CHANGING_YANG
            case LineStatus.STATIC_YANG:
                return LineStatus.STATIC_YIN
            case LineStatus.STATIC_YIN:
                return LineStatus.STATIC_YANG
            case LineStatus.CHANGING_YANG:
                return LineStatus.CHANGING_YIN

opposite property

Get the opposite status of the current status.