kerykeion 4.18.3__py3-none-any.whl → 5.1.9__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 +56 -11
- kerykeion/aspects/__init__.py +7 -4
- kerykeion/aspects/aspects_factory.py +568 -0
- kerykeion/aspects/aspects_utils.py +86 -13
- kerykeion/astrological_subject_factory.py +1901 -0
- kerykeion/backword.py +820 -0
- kerykeion/chart_data_factory.py +552 -0
- kerykeion/charts/__init__.py +2 -2
- kerykeion/charts/chart_drawer.py +2794 -0
- kerykeion/charts/charts_utils.py +1066 -309
- kerykeion/charts/draw_planets.py +602 -351
- kerykeion/charts/templates/aspect_grid_only.xml +337 -193
- kerykeion/charts/templates/chart.xml +441 -240
- kerykeion/charts/templates/wheel_only.xml +365 -211
- kerykeion/charts/themes/black-and-white.css +148 -0
- kerykeion/charts/themes/classic.css +107 -76
- kerykeion/charts/themes/dark-high-contrast.css +145 -107
- kerykeion/charts/themes/dark.css +146 -107
- kerykeion/charts/themes/light.css +146 -103
- kerykeion/charts/themes/strawberry.css +158 -0
- kerykeion/composite_subject_factory.py +408 -0
- kerykeion/ephemeris_data_factory.py +443 -0
- kerykeion/fetch_geonames.py +81 -21
- kerykeion/house_comparison/__init__.py +6 -0
- kerykeion/house_comparison/house_comparison_factory.py +103 -0
- kerykeion/house_comparison/house_comparison_utils.py +126 -0
- kerykeion/kr_types/__init__.py +66 -6
- kerykeion/kr_types/chart_template_model.py +20 -0
- kerykeion/kr_types/kerykeion_exception.py +15 -9
- kerykeion/kr_types/kr_literals.py +14 -106
- kerykeion/kr_types/kr_models.py +14 -179
- kerykeion/kr_types/settings_models.py +15 -152
- kerykeion/planetary_return_factory.py +805 -0
- kerykeion/relationship_score_factory.py +301 -0
- kerykeion/report.py +750 -65
- kerykeion/schemas/__init__.py +106 -0
- kerykeion/schemas/chart_template_model.py +367 -0
- kerykeion/schemas/kerykeion_exception.py +20 -0
- kerykeion/schemas/kr_literals.py +181 -0
- kerykeion/schemas/kr_models.py +603 -0
- kerykeion/schemas/settings_models.py +188 -0
- kerykeion/settings/__init__.py +20 -1
- kerykeion/settings/chart_defaults.py +444 -0
- kerykeion/settings/config_constants.py +152 -0
- kerykeion/settings/kerykeion_settings.py +36 -61
- kerykeion/settings/translation_strings.py +1499 -0
- kerykeion/settings/translations.py +74 -0
- kerykeion/sweph/ast136/s136108s.se1 +0 -0
- kerykeion/sweph/ast136/s136199s.se1 +0 -0
- kerykeion/sweph/ast136/s136472s.se1 +0 -0
- kerykeion/sweph/ast28/se28978s.se1 +0 -0
- kerykeion/sweph/ast50/se50000s.se1 +0 -0
- kerykeion/sweph/ast90/se90377s.se1 +0 -0
- kerykeion/sweph/ast90/se90482s.se1 +0 -0
- kerykeion/sweph/sefstars.txt +1602 -0
- kerykeion/transits_time_range_factory.py +302 -0
- kerykeion/utilities.py +626 -125
- kerykeion-5.1.9.dist-info/METADATA +1793 -0
- kerykeion-5.1.9.dist-info/RECORD +63 -0
- {kerykeion-4.18.3.dist-info → kerykeion-5.1.9.dist-info}/WHEEL +1 -1
- kerykeion/aspects/natal_aspects.py +0 -143
- kerykeion/aspects/synastry_aspects.py +0 -113
- kerykeion/astrological_subject.py +0 -818
- kerykeion/charts/kerykeion_chart_svg.py +0 -894
- kerykeion/enums.py +0 -51
- kerykeion/ephemeris_data.py +0 -178
- kerykeion/kr_types/chart_types.py +0 -88
- kerykeion/relationship_score/__init__.py +0 -2
- kerykeion/relationship_score/relationship_score.py +0 -175
- kerykeion/relationship_score/relationship_score_factory.py +0 -275
- kerykeion/settings/kr.config.json +0 -721
- kerykeion-4.18.3.dist-info/LICENSE +0 -661
- kerykeion-4.18.3.dist-info/METADATA +0 -396
- kerykeion-4.18.3.dist-info/RECORD +0 -42
- kerykeion-4.18.3.dist-info/entry_points.txt +0 -3
- /LICENSE → /kerykeion-5.1.9.dist-info/licenses/LICENSE +0 -0
kerykeion/enums.py
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
from enum import Enum
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class Planets(Enum):
|
|
5
|
-
SUN = "Sun"
|
|
6
|
-
MOON = "Moon"
|
|
7
|
-
MERCURY = "Mercury"
|
|
8
|
-
VENUS = "Venus"
|
|
9
|
-
MARS = "Mars"
|
|
10
|
-
JUPITER = "Jupiter"
|
|
11
|
-
SATURN = "Saturn"
|
|
12
|
-
URANUS = "Uranus"
|
|
13
|
-
NEPTUNE = "Neptune"
|
|
14
|
-
PLUTO = "Pluto"
|
|
15
|
-
CHIRON = "Chiron"
|
|
16
|
-
TRUE_NODE = "True_Node"
|
|
17
|
-
MEAN_NODE = "Mean_Node"
|
|
18
|
-
MEAN_LILITH = "Mean_Lilith"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
class Aspects(Enum):
|
|
22
|
-
CONJUNCTION = "Conjunction"
|
|
23
|
-
SEXTILE = "Sextile"
|
|
24
|
-
SEMI_SEXTILE = "Semi-Sextile"
|
|
25
|
-
SQUARE = "Square"
|
|
26
|
-
TRINE = "Trine"
|
|
27
|
-
OPPOSITION = "Opposition"
|
|
28
|
-
QUINCUNX = "Quincunx"
|
|
29
|
-
NONE = None
|
|
30
|
-
QUINTILE = "Quintile"
|
|
31
|
-
BIQUINTILE = "Biquintile"
|
|
32
|
-
OCTILE = "Octile"
|
|
33
|
-
TRIOCTILE = "Trioctile"
|
|
34
|
-
DECILE = "Decile"
|
|
35
|
-
TRIDECILE = "Tridecile"
|
|
36
|
-
SESQUIQUADRATE = "Sesquiquadrate"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
class Signs(Enum):
|
|
40
|
-
ARI = "Ari"
|
|
41
|
-
TAU = "Tau"
|
|
42
|
-
GEM = "Gem"
|
|
43
|
-
CAN = "Can"
|
|
44
|
-
LEO = "Leo"
|
|
45
|
-
VIR = "Vir"
|
|
46
|
-
LIB = "Lib"
|
|
47
|
-
SCO = "Sco"
|
|
48
|
-
SAG = "Sag"
|
|
49
|
-
CAP = "Cap"
|
|
50
|
-
AQU = "Aqu"
|
|
51
|
-
PIS = "Pis"
|
kerykeion/ephemeris_data.py
DELETED
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
from kerykeion import AstrologicalSubject
|
|
2
|
-
from kerykeion.utilities import get_houses_list, get_available_planets_list
|
|
3
|
-
from kerykeion.astrological_subject import DEFAULT_HOUSES_SYSTEM_IDENTIFIER, DEFAULT_PERSPECTIVE_TYPE, DEFAULT_ZODIAC_TYPE
|
|
4
|
-
from kerykeion.kr_types import EphemerisDictModel
|
|
5
|
-
from kerykeion.kr_types import SiderealMode, HousesSystemIdentifier, PerspectiveType, ZodiacType
|
|
6
|
-
from datetime import datetime, timedelta
|
|
7
|
-
from typing import Literal, Union
|
|
8
|
-
import logging
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
class EphemerisDataFactory:
|
|
12
|
-
"""
|
|
13
|
-
This class is used to generate ephemeris data for a given date range.
|
|
14
|
-
|
|
15
|
-
Parameters:
|
|
16
|
-
- start_datetime: datetime object representing the start date and time.
|
|
17
|
-
- end_datetime: datetime object representing the end date and time.
|
|
18
|
-
- step_type: string representing the step type. It can be "days", "hours", or "minutes". Default is "days".
|
|
19
|
-
- step: integer representing the step value. Default is 1.
|
|
20
|
-
- lat: float representing the latitude. Default is 51.4769 (Greenwich).
|
|
21
|
-
- lng: float representing the longitude. Default is 0.0005 (Greenwich).
|
|
22
|
-
- tz_str: string representing the timezone. Default is "Etc/UTC".
|
|
23
|
-
- is_dst: boolean representing if daylight saving time is active. Default is False.
|
|
24
|
-
- disable_chiron_and_lilith: boolean representing if Chiron and Lilith should be disabled. Default is False.
|
|
25
|
-
- zodiac_type: ZodiacType object representing the zodiac type. Default is DEFAULT_ZODIAC_TYPE.
|
|
26
|
-
- sidereal_mode: SiderealMode object representing the sidereal mode. Default is None.
|
|
27
|
-
- houses_system_identifier: HousesSystemIdentifier object representing the houses system identifier. Default is DEFAULT_HOUSES_SYSTEM_IDENTIFIER.
|
|
28
|
-
- perspective_type: PerspectiveType object representing the perspective type. Default is DEFAULT_PERSPECTIVE_TYPE.
|
|
29
|
-
- max_days: integer representing the maximum number of days.
|
|
30
|
-
Set it to None to disable the check. Default is 730.
|
|
31
|
-
- max_hours: integer representing the maximum number of hours.
|
|
32
|
-
Set it to None to disable the check. Default is 8760.
|
|
33
|
-
- max_minutes: integer representing the maximum number of minutes.
|
|
34
|
-
Set it to None to disable the check. Default is 525600.
|
|
35
|
-
|
|
36
|
-
Raises:
|
|
37
|
-
- ValueError: if the step type is invalid.
|
|
38
|
-
- ValueError: if the number of days, hours, or minutes is greater than the maximum allowed.
|
|
39
|
-
"""
|
|
40
|
-
|
|
41
|
-
def __init__(
|
|
42
|
-
self,
|
|
43
|
-
start_datetime: datetime,
|
|
44
|
-
end_datetime: datetime,
|
|
45
|
-
step_type: Literal["days", "hours", "minutes"] = "days",
|
|
46
|
-
step: int = 1,
|
|
47
|
-
lat: float = 51.4769,
|
|
48
|
-
lng: float = 0.0005,
|
|
49
|
-
tz_str: str = "Etc/UTC",
|
|
50
|
-
is_dst: bool = False,
|
|
51
|
-
disable_chiron_and_lilith: bool = False,
|
|
52
|
-
zodiac_type: ZodiacType = DEFAULT_ZODIAC_TYPE,
|
|
53
|
-
sidereal_mode: Union[SiderealMode, None] = None,
|
|
54
|
-
houses_system_identifier: HousesSystemIdentifier = DEFAULT_HOUSES_SYSTEM_IDENTIFIER,
|
|
55
|
-
perspective_type: PerspectiveType = DEFAULT_PERSPECTIVE_TYPE,
|
|
56
|
-
max_days: Union[int, None] = 730,
|
|
57
|
-
max_hours: Union[int, None] = 8760,
|
|
58
|
-
max_minutes: Union[int, None] = 525600,
|
|
59
|
-
):
|
|
60
|
-
self.start_datetime = start_datetime
|
|
61
|
-
self.end_datetime = end_datetime
|
|
62
|
-
self.step_type = step_type
|
|
63
|
-
self.step = step
|
|
64
|
-
self.lat = lat
|
|
65
|
-
self.lng = lng
|
|
66
|
-
self.tz_str = tz_str
|
|
67
|
-
self.is_dst = is_dst
|
|
68
|
-
self.disable_chiron_and_lilith = disable_chiron_and_lilith
|
|
69
|
-
self.zodiac_type = zodiac_type
|
|
70
|
-
self.sidereal_mode = sidereal_mode
|
|
71
|
-
self.houses_system_identifier = houses_system_identifier
|
|
72
|
-
self.perspective_type = perspective_type
|
|
73
|
-
self.max_days = max_days
|
|
74
|
-
self.max_hours = max_hours
|
|
75
|
-
self.max_minutes = max_minutes
|
|
76
|
-
|
|
77
|
-
self.dates_list = []
|
|
78
|
-
if self.step_type == "days":
|
|
79
|
-
self.dates_list = [self.start_datetime + timedelta(days=i) for i in range((self.end_datetime - self.start_datetime).days)]
|
|
80
|
-
if max_days and (len(self.dates_list) > max_days):
|
|
81
|
-
raise ValueError(f"Too many days: {len(self.dates_list)} > {self.max_days}. To prevent this error, set max_days to a higher value or reduce the date range.")
|
|
82
|
-
|
|
83
|
-
elif self.step_type == "hours":
|
|
84
|
-
self.dates_list = [self.start_datetime + timedelta(hours=i) for i in range((self.end_datetime - self.start_datetime).days * 24)]
|
|
85
|
-
if max_hours and (len(self.dates_list) > max_hours):
|
|
86
|
-
raise ValueError(f"Too many hours: {len(self.dates_list)} > {self.max_hours}. To prevent this error, set max_hours to a higher value or reduce the date range.")
|
|
87
|
-
|
|
88
|
-
elif self.step_type == "minutes":
|
|
89
|
-
self.dates_list = [self.start_datetime + timedelta(minutes=i) for i in range((self.end_datetime - self.start_datetime).days * 24 * 60)]
|
|
90
|
-
if max_minutes and (len(self.dates_list) > max_minutes):
|
|
91
|
-
raise ValueError(f"Too many minutes: {len(self.dates_list)} > {self.max_minutes}. To prevent this error, set max_minutes to a higher value or reduce the date range.")
|
|
92
|
-
|
|
93
|
-
else:
|
|
94
|
-
raise ValueError(f"Invalid step type: {self.step_type}")
|
|
95
|
-
|
|
96
|
-
if not self.dates_list:
|
|
97
|
-
raise ValueError("No dates found. Check the date range and step values.")
|
|
98
|
-
|
|
99
|
-
if len(self.dates_list) > 1000:
|
|
100
|
-
logging.warning(f"Large number of dates: {len(self.dates_list)}. The calculation may take a while.")
|
|
101
|
-
|
|
102
|
-
def get_ephemeris_data(self, as_model: bool = False) -> list:
|
|
103
|
-
"""
|
|
104
|
-
Generate ephemeris data for the specified date range.
|
|
105
|
-
The data is structured as a list of dictionaries, where each dictionary contains the date, planets, and houses data.
|
|
106
|
-
Example:
|
|
107
|
-
[
|
|
108
|
-
{
|
|
109
|
-
"date": "2020-01-01T00:00:00",
|
|
110
|
-
"planets": [{...}, {...}, ...],
|
|
111
|
-
"houses": [{...}, {...}, ...]
|
|
112
|
-
},
|
|
113
|
-
...
|
|
114
|
-
]
|
|
115
|
-
|
|
116
|
-
Args:
|
|
117
|
-
- as_model (bool): If True, the ephemeris data will be returned as model instances. Default is False.
|
|
118
|
-
|
|
119
|
-
Returns:
|
|
120
|
-
- list: A list of dictionaries representing the ephemeris data. If as_model is True, a list of EphemerisDictModel instances is returned.
|
|
121
|
-
"""
|
|
122
|
-
ephemeris_data_list = []
|
|
123
|
-
for date in self.dates_list:
|
|
124
|
-
subject = AstrologicalSubject(
|
|
125
|
-
year=date.year,
|
|
126
|
-
month=date.month,
|
|
127
|
-
day=date.day,
|
|
128
|
-
hour=date.hour,
|
|
129
|
-
minute=date.minute,
|
|
130
|
-
lng=self.lng,
|
|
131
|
-
lat=self.lat,
|
|
132
|
-
tz_str=self.tz_str,
|
|
133
|
-
city="Placeholder",
|
|
134
|
-
nation="Placeholder",
|
|
135
|
-
online=False,
|
|
136
|
-
disable_chiron_and_lilith=self.disable_chiron_and_lilith,
|
|
137
|
-
zodiac_type=self.zodiac_type,
|
|
138
|
-
sidereal_mode=self.sidereal_mode,
|
|
139
|
-
houses_system_identifier=self.houses_system_identifier,
|
|
140
|
-
perspective_type=self.perspective_type,
|
|
141
|
-
is_dst=self.is_dst,
|
|
142
|
-
)
|
|
143
|
-
|
|
144
|
-
houses_list = get_houses_list(subject)
|
|
145
|
-
available_planets = get_available_planets_list(subject)
|
|
146
|
-
|
|
147
|
-
ephemeris_data_list.append({"date": date.isoformat(), "planets": available_planets, "houses": houses_list})
|
|
148
|
-
|
|
149
|
-
if as_model:
|
|
150
|
-
return [EphemerisDictModel(**data) for data in ephemeris_data_list]
|
|
151
|
-
|
|
152
|
-
return ephemeris_data_list
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
if "__main__" == __name__:
|
|
156
|
-
start_date = datetime.fromisoformat("2020-01-01")
|
|
157
|
-
end_date = datetime.fromisoformat("2020-01-03")
|
|
158
|
-
|
|
159
|
-
factory = EphemerisDataFactory(
|
|
160
|
-
start_datetime=start_date,
|
|
161
|
-
end_datetime=end_date,
|
|
162
|
-
step_type="minutes",
|
|
163
|
-
step=1,
|
|
164
|
-
lat=37.9838,
|
|
165
|
-
lng=23.7275,
|
|
166
|
-
tz_str="Europe/Athens",
|
|
167
|
-
is_dst=False,
|
|
168
|
-
max_hours=None,
|
|
169
|
-
max_minutes=None,
|
|
170
|
-
max_days=None,
|
|
171
|
-
)
|
|
172
|
-
|
|
173
|
-
ephemeris_data = factory.get_ephemeris_data(as_model=True)
|
|
174
|
-
print(ephemeris_data[0])
|
|
175
|
-
print(len(ephemeris_data))
|
|
176
|
-
|
|
177
|
-
for ephe in ephemeris_data:
|
|
178
|
-
print(ephe.planets[0]["abs_pos"])
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
from typing import TypedDict
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class ChartTemplateDictionary(TypedDict):
|
|
5
|
-
transitRing: str
|
|
6
|
-
degreeRing: str
|
|
7
|
-
first_circle: str
|
|
8
|
-
second_circle: str
|
|
9
|
-
third_circle: str
|
|
10
|
-
makeAspects: str
|
|
11
|
-
makeAspectGrid: str
|
|
12
|
-
chart_height: float
|
|
13
|
-
chart_width: float
|
|
14
|
-
viewbox: str
|
|
15
|
-
stringTitle: str
|
|
16
|
-
stringName: str
|
|
17
|
-
bottomLeft0: str
|
|
18
|
-
bottomLeft1: str
|
|
19
|
-
bottomLeft2: str
|
|
20
|
-
bottomLeft3: str
|
|
21
|
-
bottomLeft4: str
|
|
22
|
-
moon_phase: str
|
|
23
|
-
stringLocation: str
|
|
24
|
-
stringDateTime: str
|
|
25
|
-
stringLat: str
|
|
26
|
-
stringLon: str
|
|
27
|
-
stringPosition: str
|
|
28
|
-
|
|
29
|
-
# Font color
|
|
30
|
-
paper_color_0: str
|
|
31
|
-
# Background color of the chart
|
|
32
|
-
paper_color_1: str
|
|
33
|
-
|
|
34
|
-
# Planets colors, from 0 to 16 (0 is the Sun)
|
|
35
|
-
planets_color_0: str
|
|
36
|
-
planets_color_1: str
|
|
37
|
-
planets_color_2: str
|
|
38
|
-
planets_color_3: str
|
|
39
|
-
planets_color_4: str
|
|
40
|
-
planets_color_5: str
|
|
41
|
-
planets_color_6: str
|
|
42
|
-
planets_color_7: str
|
|
43
|
-
planets_color_8: str
|
|
44
|
-
planets_color_9: str
|
|
45
|
-
planets_color_10: str
|
|
46
|
-
planets_color_11: str
|
|
47
|
-
planets_color_12: str
|
|
48
|
-
planets_color_13: str
|
|
49
|
-
planets_color_14: str
|
|
50
|
-
planets_color_15: str
|
|
51
|
-
planets_color_16: str
|
|
52
|
-
|
|
53
|
-
# Zodiac colors, from 0 to 11 (0 is Aries)
|
|
54
|
-
zodiac_color_0: str
|
|
55
|
-
zodiac_color_1: str
|
|
56
|
-
zodiac_color_2: str
|
|
57
|
-
zodiac_color_3: str
|
|
58
|
-
zodiac_color_4: str
|
|
59
|
-
zodiac_color_5: str
|
|
60
|
-
zodiac_color_6: str
|
|
61
|
-
zodiac_color_7: str
|
|
62
|
-
zodiac_color_8: str
|
|
63
|
-
zodiac_color_9: str
|
|
64
|
-
zodiac_color_10: str
|
|
65
|
-
zodiac_color_11: str
|
|
66
|
-
|
|
67
|
-
# Aspects colors, from 0 to 9 (0 is conjunction)
|
|
68
|
-
orb_color_0: str
|
|
69
|
-
orb_color_30: str
|
|
70
|
-
orb_color_45: str
|
|
71
|
-
orb_color_60: str
|
|
72
|
-
orb_color_72: str
|
|
73
|
-
orb_color_90: str
|
|
74
|
-
orb_color_120: str
|
|
75
|
-
orb_color_135: str
|
|
76
|
-
orb_color_144: str
|
|
77
|
-
orb_color_150: str
|
|
78
|
-
orb_color_180: str
|
|
79
|
-
|
|
80
|
-
cfgTranslate: str
|
|
81
|
-
makeZodiac: str
|
|
82
|
-
makeHouses: str
|
|
83
|
-
makePlanets: str
|
|
84
|
-
elements_percentages: str
|
|
85
|
-
makePlanetGrid: str
|
|
86
|
-
makeHousesGrid: str
|
|
87
|
-
|
|
88
|
-
color_style_tag: str
|
|
@@ -1,175 +0,0 @@
|
|
|
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)
|