Skip to content

SixLineLineInterpretation

Bases: LineInterpretationBase

Source code in src/ichingpy/model/interpretation/line/six_line_line.py
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
class SixLineLineInterp(LineInterpretationBase):

    def __repr__(self) -> str:
        representation = f"-----" if self.is_yang else f"-- --"

        if self.is_transform:
            if self.is_yin:
                representation += f" X -> -----"
            else:
                representation += f" O -> -- --"

        has_stem = hasattr(self, "_stem")
        has_branch = hasattr(self, "_branch")
        has_relative = hasattr(self, "_relative")
        match self.display_language:
            case Language.ENGLISH:
                stem = f"{self.stem.name.ljust(4)} ({self.stem.value}) " if has_stem else ""
                branch = f"{self.branch.name_en.ljust(4)} " if has_branch else ""
                relative = f"{self.relative.name.ljust(9)}" if has_relative else ""
                role = f" {self.role.name.ljust(7)}" if self.role is not None else ""
            case Language.CHINESE:
                stem = f"{self.stem.label} " if has_stem else ""
                branch = f"{self.branch.label_with_phase} " if has_branch else ""
                relative = f"{self.relative.label} " if has_relative else ""
                role = f" {self.role.label} " if self.role is not None else ""

        representation = f"{relative}{stem}{branch}{representation}{role}"
        return representation

    @property
    def stem(self) -> HeavenlyStem:
        """The HeavenlyStem associated with the Line."""
        return self._stem

    @stem.setter
    def stem(self, value: HeavenlyStem) -> None:
        """Set the HeavenlyStem associated with the Line."""
        self._stem = value

    @property
    def branch(self) -> EarthlyBranch:
        """The EarthlyBranch associated with the Line."""
        return self._branch

    @branch.setter
    def branch(self, value: EarthlyBranch) -> None:
        """Set the EarthlyBranch associated with the Line."""
        self._branch = value

    @property
    def relative(self) -> SixRelative:
        """The relative associated with the line, w.r.t. to the Palace"""
        return self._relative

    @relative.setter
    def relative(self, value: SixRelative) -> None:
        """Set the relative.
        装六亲"""
        self._relative = value

    @property
    def role(self) -> HexagramRole | None:
        """The role (世应) of the line in the hexagram."""
        return self._role if hasattr(self, "_role") else None

    @role.setter
    def role(self, value: HexagramRole) -> None:
        """Set the role (世应) of the line in the hexagram."""
        self._role = value

branch property writable

The EarthlyBranch associated with the Line.

relative property writable

The relative associated with the line, w.r.t. to the Palace

role property writable

The role (世应) of the line in the hexagram.

stem property writable

The HeavenlyStem associated with the Line.