kerykeion 4.14.2__py3-none-any.whl → 4.18.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of kerykeion might be problematic. Click here for more details.
- kerykeion/__init__.py +2 -1
- kerykeion/aspects/aspects_utils.py +33 -117
- kerykeion/aspects/natal_aspects.py +26 -25
- kerykeion/aspects/synastry_aspects.py +25 -27
- kerykeion/astrological_subject.py +145 -189
- kerykeion/charts/charts_utils.py +400 -126
- kerykeion/charts/draw_planets.py +407 -0
- kerykeion/charts/kerykeion_chart_svg.py +502 -770
- kerykeion/charts/templates/aspect_grid_only.xml +452 -0
- kerykeion/charts/templates/chart.xml +39 -39
- kerykeion/charts/templates/wheel_only.xml +499 -0
- kerykeion/charts/themes/classic.css +82 -0
- kerykeion/charts/themes/dark-high-contrast.css +121 -0
- kerykeion/charts/themes/dark.css +121 -0
- kerykeion/charts/themes/light.css +117 -0
- kerykeion/ephemeris_data.py +22 -18
- kerykeion/kr_types/chart_types.py +3 -7
- kerykeion/kr_types/kr_literals.py +10 -1
- kerykeion/kr_types/kr_models.py +33 -8
- kerykeion/kr_types/settings_models.py +1 -10
- kerykeion/relationship_score/__init__.py +2 -0
- kerykeion/relationship_score/relationship_score.py +175 -0
- kerykeion/relationship_score/relationship_score_factory.py +275 -0
- kerykeion/report.py +6 -3
- kerykeion/settings/kerykeion_settings.py +6 -1
- kerykeion/settings/kr.config.json +238 -98
- kerykeion/utilities.py +116 -215
- {kerykeion-4.14.2.dist-info → kerykeion-4.18.0.dist-info}/METADATA +40 -10
- kerykeion-4.18.0.dist-info/RECORD +42 -0
- kerykeion/relationship_score.py +0 -205
- kerykeion-4.14.2.dist-info/RECORD +0 -33
- {kerykeion-4.14.2.dist-info → kerykeion-4.18.0.dist-info}/LICENSE +0 -0
- {kerykeion-4.14.2.dist-info → kerykeion-4.18.0.dist-info}/WHEEL +0 -0
- {kerykeion-4.14.2.dist-info → kerykeion-4.18.0.dist-info}/entry_points.txt +0 -0
|
@@ -68,7 +68,6 @@ class KerykeionSettingsChartColorsModel(SubscriptableBaseModel):
|
|
|
68
68
|
# Deprecated: Not used anymore
|
|
69
69
|
lunar_phase_0: str = Field(title="Lunar Phase Color 0", description="Lunar Phase Color 0")
|
|
70
70
|
lunar_phase_1: str = Field(title="Lunar Phase Color 1", description="Lunar Phase Color 1")
|
|
71
|
-
lunar_phase_2: str = Field(title="Lunar Phase Color 2", description="Lunar Phase Color 2")
|
|
72
71
|
|
|
73
72
|
|
|
74
73
|
# Aspect Settings
|
|
@@ -80,9 +79,7 @@ class KerykeionSettingsAspectModel(SubscriptableBaseModel):
|
|
|
80
79
|
degree: int = Field(title="Aspect Degrees", description="The degree of the aspect")
|
|
81
80
|
name: str = Field(title="Aspect Name", description="The name of the aspect")
|
|
82
81
|
is_active: bool = Field(title="Aspect is Active", description="Is the aspect active?")
|
|
83
|
-
visible_grid: bool = Field(title="Aspect Visible Grid", description="Is the aspect visible in the grid?")
|
|
84
82
|
is_major: bool = Field(title="Aspect is Major", description="Is the aspect major?")
|
|
85
|
-
is_minor: bool = Field(title="Aspect is Minor", description="Is the aspect minor?")
|
|
86
83
|
orb: int = Field(title="Aspect Orb", description="The orb of the aspect")
|
|
87
84
|
color: str = Field(title="Aspect Color", description="The color of the aspect")
|
|
88
85
|
|
|
@@ -145,12 +142,7 @@ class KerykeionLanguageModel(SubscriptableBaseModel):
|
|
|
145
142
|
|
|
146
143
|
class KerykeionGeneralSettingsModel(SubscriptableBaseModel):
|
|
147
144
|
axes_orbit: int = Field(title="Axes Orbit", description="The orbit of the axes in the chart")
|
|
148
|
-
planet_in_zodiac_extra_points: int = Field(title="Planet in Zodiac Extra Points", description="The extra points of the planet in the zodiac")
|
|
149
|
-
language: str = Field(title="Language", description="The language of the chart")
|
|
150
145
|
|
|
151
|
-
class KerykeionChartSettingsModel(SubscriptableBaseModel):
|
|
152
|
-
basic_chart_viewBox: str = Field(title="Basic Chart ViewBox", description="The viewbox of the basic chart")
|
|
153
|
-
wide_chart_viewBox: str = Field(title="Wide Chart ViewBox", description="The viewbox of the wide chart")
|
|
154
146
|
|
|
155
147
|
# Settings Model
|
|
156
148
|
class KerykeionSettingsModel(SubscriptableBaseModel):
|
|
@@ -162,5 +154,4 @@ class KerykeionSettingsModel(SubscriptableBaseModel):
|
|
|
162
154
|
celestial_points: List[KerykeionSettingsCelestialPointModel] = Field(title="Celestial Points", description="The list of the celestial points of the chart")
|
|
163
155
|
aspects: List[KerykeionSettingsAspectModel] = Field(title="Aspects", description="The list of the aspects of the chart")
|
|
164
156
|
language_settings: dict[str, KerykeionLanguageModel] = Field(title="Language Settings", description="The language settings of the chart")
|
|
165
|
-
general_settings: KerykeionGeneralSettingsModel = Field(title="General Settings", description="The general settings of the chart")
|
|
166
|
-
chart_settings: KerykeionChartSettingsModel = Field(title="Chart Settings", description="The chart settings of the chart")
|
|
157
|
+
general_settings: KerykeionGeneralSettingsModel = Field(title="General Settings", description="The general settings of the chart")
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
"""
|
|
3
|
+
This is part of Kerykeion (C) 2024 Giacomo Battaglia
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from kerykeion import AstrologicalSubject
|
|
7
|
+
from kerykeion.aspects.synastry_aspects import SynastryAspects
|
|
8
|
+
import logging
|
|
9
|
+
from pathlib import Path
|
|
10
|
+
from typing import Union
|
|
11
|
+
from kerykeion.kr_types.kr_models import AstrologicalSubjectModel
|
|
12
|
+
import warnings
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class RelationshipScore:
|
|
16
|
+
"""
|
|
17
|
+
Calculates the relevance of the relationship between two subjects using the Ciro Discepolo method.
|
|
18
|
+
|
|
19
|
+
Results:
|
|
20
|
+
- 0 to 5: Minimal relationship
|
|
21
|
+
- 5 to 10: Medium relationship
|
|
22
|
+
- 10 to 15: Important relationship
|
|
23
|
+
- 15 to 20: Very important relationship
|
|
24
|
+
- 20 and 35: Exceptional relationship
|
|
25
|
+
- 35 and above: Rare Exceptional relationship
|
|
26
|
+
|
|
27
|
+
Documentation: http://www.cirodiscepolo.it/Articoli/Discepoloele.htm
|
|
28
|
+
|
|
29
|
+
Args:
|
|
30
|
+
first_subject (AstrologicalSubject): First subject instance
|
|
31
|
+
second_subject (AstrologicalSubject): Second subject instance
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
def __init__(
|
|
35
|
+
self,
|
|
36
|
+
first_subject: Union[AstrologicalSubject, AstrologicalSubjectModel],
|
|
37
|
+
second_subject: Union[AstrologicalSubject, AstrologicalSubjectModel],
|
|
38
|
+
new_settings_file: Union[Path, None] = None,
|
|
39
|
+
):
|
|
40
|
+
warnings.warn(
|
|
41
|
+
"The RelationshipScore class is deprecated and will be removed in a future version. Use RelationshipScoreFactory instead.",
|
|
42
|
+
DeprecationWarning,
|
|
43
|
+
stacklevel=2
|
|
44
|
+
)
|
|
45
|
+
self.first_subject = first_subject
|
|
46
|
+
self.second_subject = second_subject
|
|
47
|
+
self.score = 0
|
|
48
|
+
self.is_destiny_sign = False
|
|
49
|
+
self.relevant_aspects: list = []
|
|
50
|
+
self.relevant_default_aspects: list = []
|
|
51
|
+
self.__all_synastry_aspects = SynastryAspects(first_subject, second_subject, new_settings_file=new_settings_file).all_aspects
|
|
52
|
+
|
|
53
|
+
# Calculate all aspects at initialization
|
|
54
|
+
self._calculate_all()
|
|
55
|
+
|
|
56
|
+
def __str__(self) -> str:
|
|
57
|
+
return f"CoupleScoreInstance: {self.first_subject.name} and {self.second_subject.name}, score: {self.score}"
|
|
58
|
+
|
|
59
|
+
def __dict__(self) -> dict: # type: ignore
|
|
60
|
+
return {
|
|
61
|
+
"first_subject_name": self.first_subject.name,
|
|
62
|
+
"second_subject_name": self.second_subject.name,
|
|
63
|
+
"score": self.score,
|
|
64
|
+
"relevant_aspects": self.relevant_aspects,
|
|
65
|
+
"relevant_default_aspects": self.relevant_default_aspects,
|
|
66
|
+
"is_destiny_sign": self.is_destiny_sign,
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
def _log_aspect(self, aspect: dict, points: int) -> None:
|
|
70
|
+
logging.debug(f"{points} Points: {aspect['p1_name']} {aspect['aspect']} {aspect['p2_name']}, rounded orbit: {int(aspect['orbit'])}")
|
|
71
|
+
|
|
72
|
+
def _evaluate_destiny_sign(self) -> int:
|
|
73
|
+
"""
|
|
74
|
+
Adds 5 points if the subjects share the same sun sign quality.
|
|
75
|
+
"""
|
|
76
|
+
if self.first_subject.sun["quality"] == self.second_subject.sun["quality"]:
|
|
77
|
+
logging.debug(f'5 points: Destiny sign, {self.first_subject.sun["sign"]} and {self.second_subject.sun["sign"]}')
|
|
78
|
+
self.is_destiny_sign = True
|
|
79
|
+
return 5
|
|
80
|
+
return 0
|
|
81
|
+
|
|
82
|
+
def _check_if_sun_sun_aspect(self, aspect: dict) -> int:
|
|
83
|
+
"""
|
|
84
|
+
Adds points for Sun-Sun aspects:
|
|
85
|
+
- 8 points for conjunction/opposition/square
|
|
86
|
+
- 11 points if the aspect's orbit is <= 2 degrees
|
|
87
|
+
"""
|
|
88
|
+
aspect_types = ["conjunction", "opposition", "square"]
|
|
89
|
+
|
|
90
|
+
if aspect["p1_name"] == "Sun" and aspect["p2_name"] == "Sun" and aspect["aspect"] in aspect_types:
|
|
91
|
+
self.relevant_default_aspects.append(aspect)
|
|
92
|
+
score = 11 if aspect["orbit"] <= 2 else 8
|
|
93
|
+
|
|
94
|
+
self._log_aspect(aspect, score)
|
|
95
|
+
self.relevant_aspects.append(self._create_aspects_dictionary(aspect, score))
|
|
96
|
+
|
|
97
|
+
return score
|
|
98
|
+
return 0
|
|
99
|
+
|
|
100
|
+
def _check_if_sun_moon_conjunction(self, aspect: dict) -> int:
|
|
101
|
+
"""
|
|
102
|
+
Adds points for Sun-Moon conjunction:
|
|
103
|
+
- 8 points for conjunction
|
|
104
|
+
- 11 points if the aspect's orbit is <= 2 degrees
|
|
105
|
+
"""
|
|
106
|
+
planets = {"Moon", "Sun"}
|
|
107
|
+
|
|
108
|
+
if {aspect["p1_name"], aspect["p2_name"]} == planets and aspect["aspect"] == "conjunction":
|
|
109
|
+
self.relevant_default_aspects.append(aspect)
|
|
110
|
+
score = 11 if aspect["orbit"] <= 2 else 8
|
|
111
|
+
|
|
112
|
+
self._log_aspect(aspect, score)
|
|
113
|
+
self.relevant_aspects.append(self._create_aspects_dictionary(aspect, score))
|
|
114
|
+
|
|
115
|
+
return score
|
|
116
|
+
return 0
|
|
117
|
+
|
|
118
|
+
def _check_if_sun_moon_asc_aspect(self, aspect: dict) -> int:
|
|
119
|
+
"""
|
|
120
|
+
Adds 4 points for aspects involving Sun, Moon, and Ascendant.
|
|
121
|
+
"""
|
|
122
|
+
planets = ["Sun", "Moon", "First_House"]
|
|
123
|
+
|
|
124
|
+
if self._check_if_sun_sun_aspect(aspect) or self._check_if_sun_moon_conjunction(aspect):
|
|
125
|
+
return 0
|
|
126
|
+
|
|
127
|
+
if aspect["p1_name"] in planets and aspect["p2_name"] in planets:
|
|
128
|
+
self.relevant_default_aspects.append(aspect)
|
|
129
|
+
score = 4
|
|
130
|
+
|
|
131
|
+
self._log_aspect(aspect, score)
|
|
132
|
+
self.relevant_aspects.append(self._create_aspects_dictionary(aspect, score))
|
|
133
|
+
|
|
134
|
+
return score
|
|
135
|
+
return 0
|
|
136
|
+
|
|
137
|
+
def _check_if_venus_mars_aspect(self, aspect: dict) -> int:
|
|
138
|
+
"""
|
|
139
|
+
Adds 4 points for Venus-Mars aspects.
|
|
140
|
+
"""
|
|
141
|
+
planets = {"Venus", "Mars"}
|
|
142
|
+
|
|
143
|
+
if {aspect["p1_name"], aspect["p2_name"]} == planets:
|
|
144
|
+
score = 4
|
|
145
|
+
self.relevant_default_aspects.append(aspect)
|
|
146
|
+
|
|
147
|
+
self._log_aspect(aspect, score)
|
|
148
|
+
self.relevant_aspects.append(self._create_aspects_dictionary(aspect, score))
|
|
149
|
+
|
|
150
|
+
return score
|
|
151
|
+
return 0
|
|
152
|
+
|
|
153
|
+
def _create_aspects_dictionary(self, aspect: dict, score: int) -> dict:
|
|
154
|
+
"""
|
|
155
|
+
Creates a dictionary representation of an aspect with its score.
|
|
156
|
+
"""
|
|
157
|
+
return {
|
|
158
|
+
"points": score,
|
|
159
|
+
"p1_name": aspect["p1_name"],
|
|
160
|
+
"p2_name": aspect["p2_name"],
|
|
161
|
+
"aspect": aspect["aspect"],
|
|
162
|
+
"orbit": aspect["orbit"],
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
def _calculate_all(self) -> None:
|
|
166
|
+
"""
|
|
167
|
+
Calculates the total score based on all relevant aspects.
|
|
168
|
+
"""
|
|
169
|
+
self.score += self._evaluate_destiny_sign()
|
|
170
|
+
|
|
171
|
+
for aspect in self.__all_synastry_aspects:
|
|
172
|
+
self.score += self._check_if_sun_sun_aspect(aspect)
|
|
173
|
+
self.score += self._check_if_sun_moon_conjunction(aspect)
|
|
174
|
+
self.score += self._check_if_sun_moon_asc_aspect(aspect)
|
|
175
|
+
self.score += self._check_if_venus_mars_aspect(aspect)
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
"""
|
|
3
|
+
This is part of Kerykeion (C) 2024 Giacomo Battaglia
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from kerykeion import AstrologicalSubject
|
|
7
|
+
from kerykeion.aspects.synastry_aspects import SynastryAspects
|
|
8
|
+
import logging
|
|
9
|
+
from pathlib import Path
|
|
10
|
+
from typing import Union
|
|
11
|
+
from kerykeion.kr_types.kr_models import AstrologicalSubjectModel, RelationshipScoreAspectModel, RelationshipScoreModel
|
|
12
|
+
from kerykeion.kr_types.kr_literals import RelationshipScoreDescription
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class RelationshipScoreFactory:
|
|
16
|
+
"""
|
|
17
|
+
Calculates the relevance of the relationship between two subjects using the Ciro Discepolo method.
|
|
18
|
+
|
|
19
|
+
Results:
|
|
20
|
+
- 0 to 5: Minimal relationship
|
|
21
|
+
- 5 to 10: Medium relationship
|
|
22
|
+
- 10 to 15: Important relationship
|
|
23
|
+
- 15 to 20: Very important relationship
|
|
24
|
+
- 20 to 35: Exceptional relationship
|
|
25
|
+
- 30 and above: Rare Exceptional relationship
|
|
26
|
+
|
|
27
|
+
Documentation: http://www.cirodiscepolo.it/Articoli/Discepoloele.htm
|
|
28
|
+
|
|
29
|
+
Args:
|
|
30
|
+
first_subject (Union[AstrologicalSubject, AstrologicalSubjectModel]): First subject instance
|
|
31
|
+
second_subject (Union[AstrologicalSubject, AstrologicalSubjectModel]): Second subject instance
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
SCORE_MAPPING = [
|
|
35
|
+
("Minimal", 5),
|
|
36
|
+
("Medium", 10),
|
|
37
|
+
("Important", 15),
|
|
38
|
+
("Very Important", 20),
|
|
39
|
+
("Exceptional", 30),
|
|
40
|
+
("Rare Exceptional", float("inf")),
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
def __init__(
|
|
44
|
+
self,
|
|
45
|
+
first_subject: Union[AstrologicalSubject, AstrologicalSubjectModel],
|
|
46
|
+
second_subject: Union[AstrologicalSubject, AstrologicalSubjectModel],
|
|
47
|
+
use_only_major_aspects: bool = True,
|
|
48
|
+
):
|
|
49
|
+
if isinstance(first_subject, AstrologicalSubject):
|
|
50
|
+
self.first_subject = first_subject.model()
|
|
51
|
+
if isinstance(second_subject, AstrologicalSubject):
|
|
52
|
+
self.second_subject = second_subject.model()
|
|
53
|
+
|
|
54
|
+
self.use_only_major_aspects = use_only_major_aspects
|
|
55
|
+
|
|
56
|
+
self.score_value = 0
|
|
57
|
+
self.relationship_score_description: RelationshipScoreDescription = "Minimal"
|
|
58
|
+
self.is_destiny_sign = True
|
|
59
|
+
self.relationship_score_aspects: list[RelationshipScoreAspectModel] = []
|
|
60
|
+
self._synastry_aspects = SynastryAspects(self.first_subject, self.second_subject).all_aspects
|
|
61
|
+
|
|
62
|
+
def _evaluate_destiny_sign(self):
|
|
63
|
+
"""
|
|
64
|
+
Evaluates if the subjects share the same sun sign quality and adds points if true.
|
|
65
|
+
"""
|
|
66
|
+
if self.first_subject.sun["quality"] == self.second_subject.sun["quality"]:
|
|
67
|
+
self.is_destiny_sign = True
|
|
68
|
+
self.score_value += 5
|
|
69
|
+
logging.debug(f"Destiny sign found, adding 5 points, total score: {self.score_value}")
|
|
70
|
+
|
|
71
|
+
def _evaluate_aspect(self, aspect, points):
|
|
72
|
+
"""
|
|
73
|
+
Evaluates an aspect and adds points to the score.
|
|
74
|
+
|
|
75
|
+
Args:
|
|
76
|
+
aspect (dict): Aspect information.
|
|
77
|
+
points (int): Points to add.
|
|
78
|
+
"""
|
|
79
|
+
if self.use_only_major_aspects and not aspect["is_major"]:
|
|
80
|
+
return
|
|
81
|
+
|
|
82
|
+
self.score_value += points
|
|
83
|
+
self.relationship_score_aspects.append(
|
|
84
|
+
RelationshipScoreAspectModel(
|
|
85
|
+
p1_name=aspect["p1_name"],
|
|
86
|
+
p2_name=aspect["p2_name"],
|
|
87
|
+
aspect=aspect["aspect"],
|
|
88
|
+
orbit=aspect["orbit"],
|
|
89
|
+
)
|
|
90
|
+
)
|
|
91
|
+
logging.debug(f"{aspect['p1_name']}-{aspect['p2_name']} aspect: {aspect['aspect']} with orbit {aspect['orbit']} degrees, adding {points} points, total score: {self.score_value}, total aspects: {len(self.relationship_score_aspects)}")
|
|
92
|
+
|
|
93
|
+
def _evaluate_sun_sun_main_aspect(self, aspect):
|
|
94
|
+
"""
|
|
95
|
+
Evaluates Sun-Sun main aspects and adds points accordingly:
|
|
96
|
+
- 8 points for conjunction/opposition/square
|
|
97
|
+
- 11 points if the aspect's orbit is <= 2 degrees
|
|
98
|
+
|
|
99
|
+
Args:
|
|
100
|
+
aspect (dict): Aspect information.
|
|
101
|
+
"""
|
|
102
|
+
if aspect["p1_name"] == "Sun" and aspect["p2_name"] == "Sun" and aspect["aspect"] in {"conjunction", "opposition", "square"}:
|
|
103
|
+
points = 11 if aspect["orbit"] <= 2 else 8
|
|
104
|
+
self._evaluate_aspect(aspect, points)
|
|
105
|
+
|
|
106
|
+
def _evaluate_sun_moon_conjunction(self, aspect):
|
|
107
|
+
"""
|
|
108
|
+
Evaluates Sun-Moon conjunctions and adds points accordingly:
|
|
109
|
+
- 8 points for conjunction
|
|
110
|
+
- 11 points if the aspect's orbit is <= 2 degrees
|
|
111
|
+
|
|
112
|
+
Args:
|
|
113
|
+
aspect (dict): Aspect information.
|
|
114
|
+
"""
|
|
115
|
+
if {aspect["p1_name"], aspect["p2_name"]} == {"Moon", "Sun"} and aspect["aspect"] == "conjunction":
|
|
116
|
+
points = 11 if aspect["orbit"] <= 2 else 8
|
|
117
|
+
self._evaluate_aspect(aspect, points)
|
|
118
|
+
|
|
119
|
+
def _evaluate_sun_sun_other_aspects(self, aspect):
|
|
120
|
+
"""
|
|
121
|
+
Evaluates Sun-Sun aspects that are not conjunctions and adds points accordingly:
|
|
122
|
+
- 4 points for other aspects
|
|
123
|
+
|
|
124
|
+
Args:
|
|
125
|
+
aspect (dict): Aspect information.
|
|
126
|
+
"""
|
|
127
|
+
if aspect["p1_name"] == "Sun" and aspect["p2_name"] == "Sun" and aspect["aspect"] not in {"conjunction", "opposition", "square"}:
|
|
128
|
+
points = 4
|
|
129
|
+
self._evaluate_aspect(aspect, points)
|
|
130
|
+
|
|
131
|
+
def _evaluate_sun_moon_other_aspects(self, aspect):
|
|
132
|
+
"""
|
|
133
|
+
Evaluates Sun-Moon aspects that are not conjunctions and adds points accordingly:
|
|
134
|
+
- 4 points for other aspects
|
|
135
|
+
|
|
136
|
+
Args:
|
|
137
|
+
aspect (dict): Aspect information.
|
|
138
|
+
"""
|
|
139
|
+
if {aspect["p1_name"], aspect["p2_name"]} == {"Moon", "Sun"} and aspect["aspect"] != "conjunction":
|
|
140
|
+
points = 4
|
|
141
|
+
self._evaluate_aspect(aspect, points)
|
|
142
|
+
|
|
143
|
+
def _evaluate_sun_ascendant_aspect(self, aspect):
|
|
144
|
+
"""
|
|
145
|
+
Evaluates Sun-Ascendant aspects and adds points accordingly:
|
|
146
|
+
- 4 points for any aspect
|
|
147
|
+
|
|
148
|
+
Args:
|
|
149
|
+
aspect (dict): Aspect information.
|
|
150
|
+
"""
|
|
151
|
+
if {aspect["p1_name"], aspect["p2_name"]} == {"Sun", "First_House"}:
|
|
152
|
+
points = 4
|
|
153
|
+
self._evaluate_aspect(aspect, points)
|
|
154
|
+
|
|
155
|
+
def _evaluate_moon_ascendant_aspect(self, aspect):
|
|
156
|
+
"""
|
|
157
|
+
Evaluates Moon-Ascendant aspects and adds points accordingly:
|
|
158
|
+
- 4 points for any aspect
|
|
159
|
+
|
|
160
|
+
Args:
|
|
161
|
+
aspect (dict): Aspect information.
|
|
162
|
+
"""
|
|
163
|
+
if {aspect["p1_name"], aspect["p2_name"]} == {"Moon", "First_House"}:
|
|
164
|
+
points = 4
|
|
165
|
+
self._evaluate_aspect(aspect, points)
|
|
166
|
+
|
|
167
|
+
def _evaluate_venus_mars_aspect(self, aspect):
|
|
168
|
+
"""
|
|
169
|
+
Evaluates Venus-Mars aspects and adds points accordingly:
|
|
170
|
+
- 4 points for any aspect
|
|
171
|
+
|
|
172
|
+
Args:
|
|
173
|
+
aspect (dict): Aspect information.
|
|
174
|
+
"""
|
|
175
|
+
if {aspect["p1_name"], aspect["p2_name"]} == {"Venus", "Mars"}:
|
|
176
|
+
points = 4
|
|
177
|
+
self._evaluate_aspect(aspect, points)
|
|
178
|
+
|
|
179
|
+
def _evaluate_relationship_score_description(self):
|
|
180
|
+
"""
|
|
181
|
+
Evaluates the relationship score description based on the total score.
|
|
182
|
+
"""
|
|
183
|
+
for description, threshold in self.SCORE_MAPPING:
|
|
184
|
+
if self.score_value < threshold:
|
|
185
|
+
self.relationship_score_description = description
|
|
186
|
+
break
|
|
187
|
+
|
|
188
|
+
def get_relationship_score(self):
|
|
189
|
+
"""
|
|
190
|
+
Calculates the relationship score based on synastry aspects.
|
|
191
|
+
|
|
192
|
+
Returns:
|
|
193
|
+
RelationshipScoreModel: The calculated relationship score.
|
|
194
|
+
"""
|
|
195
|
+
self._evaluate_destiny_sign()
|
|
196
|
+
|
|
197
|
+
for aspect in self._synastry_aspects:
|
|
198
|
+
self._evaluate_sun_sun_main_aspect(aspect)
|
|
199
|
+
self._evaluate_sun_moon_conjunction(aspect)
|
|
200
|
+
self._evaluate_sun_moon_other_aspects(aspect)
|
|
201
|
+
self._evaluate_sun_sun_other_aspects(aspect)
|
|
202
|
+
self._evaluate_sun_ascendant_aspect(aspect)
|
|
203
|
+
self._evaluate_moon_ascendant_aspect(aspect)
|
|
204
|
+
self._evaluate_venus_mars_aspect(aspect)
|
|
205
|
+
|
|
206
|
+
self._evaluate_relationship_score_description()
|
|
207
|
+
|
|
208
|
+
return RelationshipScoreModel(
|
|
209
|
+
score_value=self.score_value,
|
|
210
|
+
score_description=self.relationship_score_description,
|
|
211
|
+
is_destiny_sign=self.is_destiny_sign,
|
|
212
|
+
aspects=self.relationship_score_aspects,
|
|
213
|
+
subjects=[self.first_subject, self.second_subject],
|
|
214
|
+
)
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
if __name__ == "__main__":
|
|
218
|
+
from kerykeion.utilities import setup_logging
|
|
219
|
+
|
|
220
|
+
setup_logging(level="critical")
|
|
221
|
+
|
|
222
|
+
john = AstrologicalSubject("John", 1940, 10, 9, 18, 30, "Liverpool", "UK")
|
|
223
|
+
yoko = AstrologicalSubject("Yoko", 1933, 2, 18, 20, 30, "Tokyo", "JP")
|
|
224
|
+
|
|
225
|
+
relationship_score_factory = RelationshipScoreFactory(john, yoko)
|
|
226
|
+
relationship_score = relationship_score_factory.get_relationship_score()
|
|
227
|
+
|
|
228
|
+
print("John and Yoko relationship score:")
|
|
229
|
+
print(relationship_score.score_value)
|
|
230
|
+
print(relationship_score.score_description)
|
|
231
|
+
print(relationship_score.is_destiny_sign)
|
|
232
|
+
print(len(relationship_score.aspects))
|
|
233
|
+
print(len(relationship_score_factory._synastry_aspects))
|
|
234
|
+
|
|
235
|
+
print("------------------->")
|
|
236
|
+
freud = AstrologicalSubject("Freud", 1856, 5, 6, 18, 30, "Freiberg", "DE")
|
|
237
|
+
jung = AstrologicalSubject("Jung", 1875, 7, 26, 18, 30, "Kesswil", "CH")
|
|
238
|
+
|
|
239
|
+
relationship_score_factory = RelationshipScoreFactory(freud, jung)
|
|
240
|
+
relationship_score = relationship_score_factory.get_relationship_score()
|
|
241
|
+
|
|
242
|
+
print("Freud and Jung relationship score:")
|
|
243
|
+
print(relationship_score.score_value)
|
|
244
|
+
print(relationship_score.score_description)
|
|
245
|
+
print(relationship_score.is_destiny_sign)
|
|
246
|
+
print(len(relationship_score.aspects))
|
|
247
|
+
print(len(relationship_score_factory._synastry_aspects))
|
|
248
|
+
|
|
249
|
+
print("------------------->")
|
|
250
|
+
richart_burton = AstrologicalSubject("Richard Burton", 1925, 11, 10, 15, 00, "Pontrhydyfen", "UK")
|
|
251
|
+
liz_taylor = AstrologicalSubject("Elizabeth Taylor", 1932, 2, 27, 2, 30, "London", "UK")
|
|
252
|
+
|
|
253
|
+
relationship_score_factory = RelationshipScoreFactory(richart_burton, liz_taylor)
|
|
254
|
+
relationship_score = relationship_score_factory.get_relationship_score()
|
|
255
|
+
|
|
256
|
+
print("Richard Burton and Elizabeth Taylor relationship score:")
|
|
257
|
+
print(relationship_score.score_value)
|
|
258
|
+
print(relationship_score.score_description)
|
|
259
|
+
print(relationship_score.is_destiny_sign)
|
|
260
|
+
print(len(relationship_score.aspects))
|
|
261
|
+
print(len(relationship_score_factory._synastry_aspects))
|
|
262
|
+
|
|
263
|
+
print("------------------->")
|
|
264
|
+
dario_fo = AstrologicalSubject("Dario Fo", 1926, 3, 24, 12, 25, "Sangiano", "IT")
|
|
265
|
+
franca_rame = AstrologicalSubject("Franca Rame", 1929, 7, 18, 12, 25, "Parabiago", "IT")
|
|
266
|
+
|
|
267
|
+
relationship_score_factory = RelationshipScoreFactory(dario_fo, franca_rame)
|
|
268
|
+
relationship_score = relationship_score_factory.get_relationship_score()
|
|
269
|
+
|
|
270
|
+
print("Dario Fo and Franca Rame relationship score:")
|
|
271
|
+
print(relationship_score.score_value)
|
|
272
|
+
print(relationship_score.score_description)
|
|
273
|
+
print(relationship_score.is_destiny_sign)
|
|
274
|
+
print(len(relationship_score.aspects))
|
|
275
|
+
print(len(relationship_score_factory._synastry_aspects))
|
kerykeion/report.py
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
from kerykeion import AstrologicalSubject
|
|
2
2
|
from terminaltables import AsciiTable
|
|
3
|
+
from kerykeion.utilities import get_houses_list, get_available_planets_list
|
|
4
|
+
from typing import Union
|
|
5
|
+
from kerykeion.kr_types.kr_models import AstrologicalSubjectModel
|
|
3
6
|
|
|
4
7
|
class Report:
|
|
5
8
|
"""
|
|
@@ -11,7 +14,7 @@ class Report:
|
|
|
11
14
|
planets_table: str
|
|
12
15
|
houses_table: str
|
|
13
16
|
|
|
14
|
-
def __init__(self, instance: AstrologicalSubject):
|
|
17
|
+
def __init__(self, instance: Union[AstrologicalSubject, AstrologicalSubjectModel]):
|
|
15
18
|
self.instance = instance
|
|
16
19
|
|
|
17
20
|
self.get_report_title()
|
|
@@ -51,7 +54,7 @@ class Report:
|
|
|
51
54
|
("R" if planet.retrograde else "-"),
|
|
52
55
|
planet.house,
|
|
53
56
|
]
|
|
54
|
-
for planet in self.instance
|
|
57
|
+
for planet in get_available_planets_list(self.instance)
|
|
55
58
|
]
|
|
56
59
|
|
|
57
60
|
self.planets_table = AsciiTable(planets_data).table
|
|
@@ -62,7 +65,7 @@ class Report:
|
|
|
62
65
|
"""
|
|
63
66
|
|
|
64
67
|
houses_data = [["House", "Sign", "Position"]] + [
|
|
65
|
-
[house.name, house.sign, round(float(house.position), 2)] for house in self.instance
|
|
68
|
+
[house.name, house.sign, round(float(house.position), 2)] for house in get_houses_list(self.instance)
|
|
66
69
|
]
|
|
67
70
|
|
|
68
71
|
self.houses_table = AsciiTable(houses_data).table
|
|
@@ -11,7 +11,7 @@ from typing import Dict, Union
|
|
|
11
11
|
from kerykeion.kr_types import KerykeionSettingsModel
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
def get_settings(new_settings_file: Union[Path, None] = None) -> KerykeionSettingsModel:
|
|
14
|
+
def get_settings(new_settings_file: Union[Path, None, KerykeionSettingsModel, dict] = None) -> KerykeionSettingsModel:
|
|
15
15
|
"""
|
|
16
16
|
This function is used to get the settings dict from the settings file.
|
|
17
17
|
If no settings file is passed as argument, or the file is not found, it will fallback to:
|
|
@@ -25,6 +25,11 @@ def get_settings(new_settings_file: Union[Path, None] = None) -> KerykeionSettin
|
|
|
25
25
|
Dict: The settings dict
|
|
26
26
|
"""
|
|
27
27
|
|
|
28
|
+
if isinstance(new_settings_file, dict):
|
|
29
|
+
return KerykeionSettingsModel(**new_settings_file)
|
|
30
|
+
elif isinstance(new_settings_file, KerykeionSettingsModel):
|
|
31
|
+
return new_settings_file
|
|
32
|
+
|
|
28
33
|
# Config path we passed as argument
|
|
29
34
|
if new_settings_file is not None:
|
|
30
35
|
settings_file = new_settings_file
|