kerykeion 4.14.8__tar.gz → 4.14.10__tar.gz
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-4.14.8 → kerykeion-4.14.10}/PKG-INFO +4 -4
- {kerykeion-4.14.8 → kerykeion-4.14.10}/README.md +3 -3
- {kerykeion-4.14.8 → kerykeion-4.14.10}/kerykeion/aspects/aspects_utils.py +2 -1
- {kerykeion-4.14.8 → kerykeion-4.14.10}/kerykeion/aspects/natal_aspects.py +2 -1
- {kerykeion-4.14.8 → kerykeion-4.14.10}/kerykeion/aspects/synastry_aspects.py +4 -2
- {kerykeion-4.14.8 → kerykeion-4.14.10}/kerykeion/astrological_subject.py +119 -172
- {kerykeion-4.14.8 → kerykeion-4.14.10}/kerykeion/charts/charts_utils.py +44 -36
- {kerykeion-4.14.8 → kerykeion-4.14.10}/kerykeion/charts/draw_planets.py +2 -1
- {kerykeion-4.14.8 → kerykeion-4.14.10}/kerykeion/charts/kerykeion_chart_svg.py +27 -24
- {kerykeion-4.14.8 → kerykeion-4.14.10}/kerykeion/ephemeris_data.py +5 -1
- {kerykeion-4.14.8 → kerykeion-4.14.10}/kerykeion/kr_types/kr_literals.py +3 -0
- {kerykeion-4.14.8 → kerykeion-4.14.10}/kerykeion/kr_types/kr_models.py +16 -8
- {kerykeion-4.14.8 → kerykeion-4.14.10}/kerykeion/relationship_score.py +5 -4
- {kerykeion-4.14.8 → kerykeion-4.14.10}/kerykeion/report.py +6 -3
- kerykeion-4.14.10/kerykeion/utilities.py +272 -0
- {kerykeion-4.14.8 → kerykeion-4.14.10}/pyproject.toml +1 -1
- kerykeion-4.14.8/kerykeion/utilities.py +0 -374
- {kerykeion-4.14.8 → kerykeion-4.14.10}/LICENSE +0 -0
- {kerykeion-4.14.8 → kerykeion-4.14.10}/kerykeion/__init__.py +0 -0
- {kerykeion-4.14.8 → kerykeion-4.14.10}/kerykeion/aspects/__init__.py +0 -0
- {kerykeion-4.14.8 → kerykeion-4.14.10}/kerykeion/charts/__init__.py +0 -0
- {kerykeion-4.14.8 → kerykeion-4.14.10}/kerykeion/charts/templates/chart.xml +0 -0
- {kerykeion-4.14.8 → kerykeion-4.14.10}/kerykeion/enums.py +0 -0
- {kerykeion-4.14.8 → kerykeion-4.14.10}/kerykeion/fetch_geonames.py +0 -0
- {kerykeion-4.14.8 → kerykeion-4.14.10}/kerykeion/kr_types/__init__.py +0 -0
- {kerykeion-4.14.8 → kerykeion-4.14.10}/kerykeion/kr_types/chart_types.py +0 -0
- {kerykeion-4.14.8 → kerykeion-4.14.10}/kerykeion/kr_types/kerykeion_exception.py +0 -0
- {kerykeion-4.14.8 → kerykeion-4.14.10}/kerykeion/kr_types/settings_models.py +0 -0
- {kerykeion-4.14.8 → kerykeion-4.14.10}/kerykeion/settings/__init__.py +0 -0
- {kerykeion-4.14.8 → kerykeion-4.14.10}/kerykeion/settings/kerykeion_settings.py +0 -0
- {kerykeion-4.14.8 → kerykeion-4.14.10}/kerykeion/settings/kr.config.json +0 -0
- {kerykeion-4.14.8 → kerykeion-4.14.10}/kerykeion/sweph/README.md +0 -0
- {kerykeion-4.14.8 → kerykeion-4.14.10}/kerykeion/sweph/seas_18.se1 +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: kerykeion
|
|
3
|
-
Version: 4.14.
|
|
3
|
+
Version: 4.14.10
|
|
4
4
|
Summary: A python library for astrology.
|
|
5
5
|
Home-page: https://www.kerykeion.net/
|
|
6
6
|
License: AGPL-3.0
|
|
@@ -69,7 +69,7 @@ The core goal of this project is to provide a simple and easy approach to astrol
|
|
|
69
69
|
|
|
70
70
|
Here's an example of a birthchart:
|
|
71
71
|
|
|
72
|
-

|
|
72
|
+

|
|
73
73
|
|
|
74
74
|
## Web API
|
|
75
75
|
|
|
@@ -154,7 +154,7 @@ birth_chart_svg.makeSVG()
|
|
|
154
154
|
```
|
|
155
155
|
|
|
156
156
|
The SVG file will be saved in the home directory.
|
|
157
|
-

|
|
157
|
+

|
|
158
158
|
|
|
159
159
|
### Synastry Chart
|
|
160
160
|
|
|
@@ -170,7 +170,7 @@ synastry_chart.makeSVG()
|
|
|
170
170
|
|
|
171
171
|
```
|
|
172
172
|
|
|
173
|
-

|
|
173
|
+

|
|
174
174
|
|
|
175
175
|
### Change the output directory
|
|
176
176
|
|
|
@@ -32,7 +32,7 @@ The core goal of this project is to provide a simple and easy approach to astrol
|
|
|
32
32
|
|
|
33
33
|
Here's an example of a birthchart:
|
|
34
34
|
|
|
35
|
-

|
|
35
|
+

|
|
36
36
|
|
|
37
37
|
## Web API
|
|
38
38
|
|
|
@@ -117,7 +117,7 @@ birth_chart_svg.makeSVG()
|
|
|
117
117
|
```
|
|
118
118
|
|
|
119
119
|
The SVG file will be saved in the home directory.
|
|
120
|
-

|
|
120
|
+

|
|
121
121
|
|
|
122
122
|
### Synastry Chart
|
|
123
123
|
|
|
@@ -133,7 +133,7 @@ synastry_chart.makeSVG()
|
|
|
133
133
|
|
|
134
134
|
```
|
|
135
135
|
|
|
136
|
-

|
|
136
|
+

|
|
137
137
|
|
|
138
138
|
### Change the output directory
|
|
139
139
|
|
|
@@ -8,6 +8,7 @@ from kerykeion import AstrologicalSubject
|
|
|
8
8
|
from kerykeion.settings import KerykeionSettingsModel
|
|
9
9
|
from swisseph import difdeg2n
|
|
10
10
|
from typing import Union
|
|
11
|
+
from kerykeion.kr_types.kr_models import AstrologicalSubjectModel
|
|
11
12
|
|
|
12
13
|
|
|
13
14
|
def get_aspect_from_two_points(aspects_settings: dict, point_one: Union[float, int], point_two: Union[float, int]):
|
|
@@ -157,7 +158,7 @@ def planet_id_decoder(planets_settings: dict, name: str):
|
|
|
157
158
|
return result
|
|
158
159
|
|
|
159
160
|
|
|
160
|
-
def get_active_points_list(subject: AstrologicalSubject, settings: Union[KerykeionSettingsModel, dict]) -> list:
|
|
161
|
+
def get_active_points_list(subject: Union[AstrologicalSubject, AstrologicalSubjectModel], settings: Union[KerykeionSettingsModel, dict]) -> list:
|
|
161
162
|
"""
|
|
162
163
|
Given an astrological subject and the settings, return a list of the active points.
|
|
163
164
|
Args:
|
|
@@ -11,6 +11,7 @@ from kerykeion.settings.kerykeion_settings import get_settings
|
|
|
11
11
|
from dataclasses import dataclass
|
|
12
12
|
from functools import cached_property
|
|
13
13
|
from kerykeion.aspects.aspects_utils import planet_id_decoder, get_aspect_from_two_points, get_active_points_list
|
|
14
|
+
from kerykeion.kr_types.kr_models import AstrologicalSubjectModel
|
|
14
15
|
|
|
15
16
|
|
|
16
17
|
AXES_LIST = [
|
|
@@ -27,7 +28,7 @@ class NatalAspects:
|
|
|
27
28
|
Generates an object with all the aspects of a birthcart.
|
|
28
29
|
"""
|
|
29
30
|
|
|
30
|
-
user: AstrologicalSubject
|
|
31
|
+
user: Union[AstrologicalSubject, AstrologicalSubjectModel]
|
|
31
32
|
new_settings_file: Union[Path, None] = None
|
|
32
33
|
|
|
33
34
|
def __post_init__(self):
|
|
@@ -11,6 +11,8 @@ from functools import cached_property
|
|
|
11
11
|
from kerykeion.aspects.natal_aspects import NatalAspects
|
|
12
12
|
from kerykeion.settings.kerykeion_settings import get_settings
|
|
13
13
|
from kerykeion.aspects.aspects_utils import planet_id_decoder, get_aspect_from_two_points, get_active_points_list
|
|
14
|
+
from kerykeion.kr_types.kr_models import AstrologicalSubjectModel
|
|
15
|
+
from typing import Union
|
|
14
16
|
|
|
15
17
|
|
|
16
18
|
class SynastryAspects(NatalAspects):
|
|
@@ -20,8 +22,8 @@ class SynastryAspects(NatalAspects):
|
|
|
20
22
|
|
|
21
23
|
def __init__(
|
|
22
24
|
self,
|
|
23
|
-
kr_object_one: AstrologicalSubject,
|
|
24
|
-
kr_object_two: AstrologicalSubject,
|
|
25
|
+
kr_object_one: Union[AstrologicalSubject, AstrologicalSubjectModel],
|
|
26
|
+
kr_object_two: Union[AstrologicalSubject, AstrologicalSubjectModel],
|
|
25
27
|
new_settings_file: Union[Path, None] = None,
|
|
26
28
|
):
|
|
27
29
|
# Subjects
|
|
@@ -20,11 +20,13 @@ from kerykeion.kr_types import (
|
|
|
20
20
|
PointType,
|
|
21
21
|
SiderealMode,
|
|
22
22
|
HousesSystemIdentifier,
|
|
23
|
-
PerspectiveType
|
|
23
|
+
PerspectiveType,
|
|
24
|
+
Planet,
|
|
25
|
+
Houses
|
|
24
26
|
)
|
|
25
27
|
from kerykeion.utilities import (
|
|
26
28
|
get_number_from_name,
|
|
27
|
-
|
|
29
|
+
get_kerykeion_point_from_degree,
|
|
28
30
|
get_planet_house,
|
|
29
31
|
get_moon_emoji_from_phase_int,
|
|
30
32
|
get_moon_phase_name_from_phase_int,
|
|
@@ -136,7 +138,7 @@ class AstrologicalSubject:
|
|
|
136
138
|
true_node: KerykeionPointModel
|
|
137
139
|
mean_node: KerykeionPointModel
|
|
138
140
|
chiron: Union[KerykeionPointModel, None]
|
|
139
|
-
|
|
141
|
+
mean_lilith: Union[KerykeionPointModel, None]
|
|
140
142
|
|
|
141
143
|
# Houses
|
|
142
144
|
first_house: KerykeionPointModel
|
|
@@ -153,15 +155,16 @@ class AstrologicalSubject:
|
|
|
153
155
|
twelfth_house: KerykeionPointModel
|
|
154
156
|
|
|
155
157
|
# Lists
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
planets_degrees_ut: list[float]
|
|
159
|
-
houses_degree_ut: list[float]
|
|
158
|
+
_houses_list: list[KerykeionPointModel]
|
|
159
|
+
_houses_degree_ut: list[float]
|
|
160
160
|
|
|
161
161
|
# Enable or disable features
|
|
162
|
-
disable_chiron: bool
|
|
162
|
+
disable_chiron: Union[None, bool]
|
|
163
163
|
disable_chiron_and_lilith: bool
|
|
164
164
|
|
|
165
|
+
planets_names_list: list[Planet]
|
|
166
|
+
houses_names_list: list[Houses]
|
|
167
|
+
|
|
165
168
|
def __init__(
|
|
166
169
|
self,
|
|
167
170
|
name="Now",
|
|
@@ -178,7 +181,7 @@ class AstrologicalSubject:
|
|
|
178
181
|
geonames_username: Union[str, None] = None,
|
|
179
182
|
zodiac_type: ZodiacType = DEFAULT_ZODIAC_TYPE,
|
|
180
183
|
online: bool = True,
|
|
181
|
-
disable_chiron: bool =
|
|
184
|
+
disable_chiron: Union[None, bool] = None, # Deprecated
|
|
182
185
|
sidereal_mode: Union[SiderealMode, None] = None,
|
|
183
186
|
houses_system_identifier: HousesSystemIdentifier = DEFAULT_HOUSES_SYSTEM_IDENTIFIER,
|
|
184
187
|
perspective_type: PerspectiveType = DEFAULT_PERSPECTIVE_TYPE,
|
|
@@ -221,41 +224,46 @@ class AstrologicalSubject:
|
|
|
221
224
|
# General setup #
|
|
222
225
|
#---------------#
|
|
223
226
|
|
|
224
|
-
#
|
|
227
|
+
# Geonames username
|
|
225
228
|
if geonames_username is None and online:
|
|
226
229
|
logging.warning(GEONAMES_DEFAULT_USERNAME_WARNING)
|
|
227
230
|
self.geonames_username = DEFAULT_GEONAMES_USERNAME
|
|
228
231
|
else:
|
|
229
|
-
self.geonames_username = geonames_username
|
|
232
|
+
self.geonames_username = geonames_username # type: ignore
|
|
230
233
|
|
|
234
|
+
# City
|
|
231
235
|
if not city:
|
|
232
236
|
self.city = "London"
|
|
233
237
|
logging.info("No city specified, using London as default")
|
|
234
238
|
else:
|
|
235
239
|
self.city = city
|
|
236
240
|
|
|
241
|
+
# Nation
|
|
237
242
|
if not nation:
|
|
238
243
|
self.nation = "GB"
|
|
239
244
|
logging.info("No nation specified, using GB as default")
|
|
240
245
|
else:
|
|
241
246
|
self.nation = nation
|
|
242
247
|
|
|
248
|
+
# Latitude
|
|
243
249
|
if not lat and not self.online:
|
|
244
250
|
self.lat = 51.5074
|
|
245
251
|
logging.info("No latitude specified, using London as default")
|
|
246
252
|
else:
|
|
247
|
-
self.lat = lat
|
|
248
|
-
|
|
253
|
+
self.lat = lat # type: ignore
|
|
254
|
+
|
|
255
|
+
# Longitude
|
|
249
256
|
if not lng and not self.online:
|
|
250
257
|
self.lng = 0
|
|
251
258
|
logging.info("No longitude specified, using London as default")
|
|
252
259
|
else:
|
|
253
|
-
self.lng = lng
|
|
260
|
+
self.lng = lng # type: ignore
|
|
254
261
|
|
|
262
|
+
# Timezone
|
|
255
263
|
if (not self.online) and (not tz_str):
|
|
256
264
|
raise KerykeionException("You need to set the coordinates and timezone if you want to use the offline mode!")
|
|
257
265
|
else:
|
|
258
|
-
self.tz_str = tz_str
|
|
266
|
+
self.tz_str = tz_str # type: ignore
|
|
259
267
|
|
|
260
268
|
#-----------------------#
|
|
261
269
|
# Swiss Ephemeris setup #
|
|
@@ -303,7 +311,8 @@ class AstrologicalSubject:
|
|
|
303
311
|
|
|
304
312
|
if self.zodiac_type == "Sidereal":
|
|
305
313
|
# Check if the sidereal mode is valid
|
|
306
|
-
|
|
314
|
+
|
|
315
|
+
if not self.sidereal_mode or not self.sidereal_mode in get_args(SiderealMode):
|
|
307
316
|
raise KerykeionException(f"\n* ERROR: '{self.sidereal_mode}' is NOT a valid sidereal mode! Available modes are: *" + "\n" + str(get_args(SiderealMode)))
|
|
308
317
|
|
|
309
318
|
self._iflag += swe.FLG_SIDEREAL
|
|
@@ -342,11 +351,9 @@ class AstrologicalSubject:
|
|
|
342
351
|
self.julian_day = float(swe.julday(utc_object.year, utc_object.month, utc_object.day, utc_float_hour_with_minutes))
|
|
343
352
|
# <--- UTC, julian day and local time setup
|
|
344
353
|
|
|
345
|
-
self.
|
|
346
|
-
self.
|
|
347
|
-
self.
|
|
348
|
-
self._planets_in_houses()
|
|
349
|
-
self._lunar_phase_calc()
|
|
354
|
+
self._initialize_houses()
|
|
355
|
+
self._initialize_planets()
|
|
356
|
+
self._initialize_moon_phase()
|
|
350
357
|
|
|
351
358
|
# Deprecated properties
|
|
352
359
|
self.utc_time
|
|
@@ -388,7 +395,7 @@ class AstrologicalSubject:
|
|
|
388
395
|
self.lat = float(self.city_data["lat"])
|
|
389
396
|
self.tz_str = self.city_data["timezonestr"]
|
|
390
397
|
|
|
391
|
-
def
|
|
398
|
+
def _initialize_houses(self) -> None:
|
|
392
399
|
"""
|
|
393
400
|
Calculate positions and store them in dictionaries
|
|
394
401
|
|
|
@@ -423,7 +430,7 @@ class AstrologicalSubject:
|
|
|
423
430
|
"""
|
|
424
431
|
|
|
425
432
|
if self.zodiac_type == "Sidereal":
|
|
426
|
-
self.
|
|
433
|
+
self._houses_degree_ut = swe.houses_ex(
|
|
427
434
|
tjdut=self.julian_day,
|
|
428
435
|
lat=self.lat, lon=self.lng,
|
|
429
436
|
hsys=str.encode(self.houses_system_identifier),
|
|
@@ -431,7 +438,7 @@ class AstrologicalSubject:
|
|
|
431
438
|
)[0]
|
|
432
439
|
|
|
433
440
|
elif self.zodiac_type == "Tropic":
|
|
434
|
-
self.
|
|
441
|
+
self._houses_degree_ut = swe.houses(
|
|
435
442
|
tjdut=self.julian_day, lat=self.lat,
|
|
436
443
|
lon=self.lng,
|
|
437
444
|
hsys=str.encode(self.houses_system_identifier)
|
|
@@ -440,20 +447,23 @@ class AstrologicalSubject:
|
|
|
440
447
|
point_type: PointType = "House"
|
|
441
448
|
|
|
442
449
|
# stores the house in singular dictionaries.
|
|
443
|
-
self.first_house =
|
|
444
|
-
self.second_house =
|
|
445
|
-
self.third_house =
|
|
446
|
-
self.fourth_house =
|
|
447
|
-
self.fifth_house =
|
|
448
|
-
self.sixth_house =
|
|
449
|
-
self.seventh_house =
|
|
450
|
-
self.eighth_house =
|
|
451
|
-
self.ninth_house =
|
|
452
|
-
self.tenth_house =
|
|
453
|
-
self.eleventh_house =
|
|
454
|
-
self.twelfth_house =
|
|
455
|
-
|
|
456
|
-
self.
|
|
450
|
+
self.first_house = get_kerykeion_point_from_degree(self._houses_degree_ut[0], "First_House", point_type=point_type)
|
|
451
|
+
self.second_house = get_kerykeion_point_from_degree(self._houses_degree_ut[1], "Second_House", point_type=point_type)
|
|
452
|
+
self.third_house = get_kerykeion_point_from_degree(self._houses_degree_ut[2], "Third_House", point_type=point_type)
|
|
453
|
+
self.fourth_house = get_kerykeion_point_from_degree(self._houses_degree_ut[3], "Fourth_House", point_type=point_type)
|
|
454
|
+
self.fifth_house = get_kerykeion_point_from_degree(self._houses_degree_ut[4], "Fifth_House", point_type=point_type)
|
|
455
|
+
self.sixth_house = get_kerykeion_point_from_degree(self._houses_degree_ut[5], "Sixth_House", point_type=point_type)
|
|
456
|
+
self.seventh_house = get_kerykeion_point_from_degree(self._houses_degree_ut[6], "Seventh_House", point_type=point_type)
|
|
457
|
+
self.eighth_house = get_kerykeion_point_from_degree(self._houses_degree_ut[7], "Eighth_House", point_type=point_type)
|
|
458
|
+
self.ninth_house = get_kerykeion_point_from_degree(self._houses_degree_ut[8], "Ninth_House", point_type=point_type)
|
|
459
|
+
self.tenth_house = get_kerykeion_point_from_degree(self._houses_degree_ut[9], "Tenth_House", point_type=point_type)
|
|
460
|
+
self.eleventh_house = get_kerykeion_point_from_degree(self._houses_degree_ut[10], "Eleventh_House", point_type=point_type)
|
|
461
|
+
self.twelfth_house = get_kerykeion_point_from_degree(self._houses_degree_ut[11], "Twelfth_House", point_type=point_type)
|
|
462
|
+
|
|
463
|
+
self.houses_names_list = list(get_args(Houses))
|
|
464
|
+
|
|
465
|
+
# Deprecated
|
|
466
|
+
self._houses_list = [
|
|
457
467
|
self.first_house,
|
|
458
468
|
self.second_house,
|
|
459
469
|
self.third_house,
|
|
@@ -468,10 +478,12 @@ class AstrologicalSubject:
|
|
|
468
478
|
self.twelfth_house,
|
|
469
479
|
]
|
|
470
480
|
|
|
471
|
-
def
|
|
472
|
-
"""
|
|
481
|
+
def _initialize_planets(self) -> None:
|
|
482
|
+
"""Defines body positon in signs and information and
|
|
483
|
+
stores them in dictionaries"""
|
|
484
|
+
|
|
485
|
+
point_type: PointType = "Planet"
|
|
473
486
|
|
|
474
|
-
# Calculates the position of the planets and stores it in a list.
|
|
475
487
|
sun_deg = swe.calc(self.julian_day, 0, self._iflag)[0][0]
|
|
476
488
|
moon_deg = swe.calc(self.julian_day, 1, self._iflag)[0][0]
|
|
477
489
|
mercury_deg = swe.calc(self.julian_day, 2, self._iflag)[0][0]
|
|
@@ -485,79 +497,34 @@ class AstrologicalSubject:
|
|
|
485
497
|
mean_node_deg = swe.calc(self.julian_day, 10, self._iflag)[0][0]
|
|
486
498
|
true_node_deg = swe.calc(self.julian_day, 11, self._iflag)[0][0]
|
|
487
499
|
|
|
488
|
-
self.
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
"""Defines body positon in signs and information and
|
|
517
|
-
stores them in dictionaries"""
|
|
518
|
-
|
|
519
|
-
point_type: PointType = "Planet"
|
|
520
|
-
# stores the planets in singular dictionaries.
|
|
521
|
-
self.sun = calculate_position(self.planets_degrees_ut[0], "Sun", point_type=point_type)
|
|
522
|
-
self.moon = calculate_position(self.planets_degrees_ut[1], "Moon", point_type=point_type)
|
|
523
|
-
self.mercury = calculate_position(self.planets_degrees_ut[2], "Mercury", point_type=point_type)
|
|
524
|
-
self.venus = calculate_position(self.planets_degrees_ut[3], "Venus", point_type=point_type)
|
|
525
|
-
self.mars = calculate_position(self.planets_degrees_ut[4], "Mars", point_type=point_type)
|
|
526
|
-
self.jupiter = calculate_position(self.planets_degrees_ut[5], "Jupiter", point_type=point_type)
|
|
527
|
-
self.saturn = calculate_position(self.planets_degrees_ut[6], "Saturn", point_type=point_type)
|
|
528
|
-
self.uranus = calculate_position(self.planets_degrees_ut[7], "Uranus", point_type=point_type)
|
|
529
|
-
self.neptune = calculate_position(self.planets_degrees_ut[8], "Neptune", point_type=point_type)
|
|
530
|
-
self.pluto = calculate_position(self.planets_degrees_ut[9], "Pluto", point_type=point_type)
|
|
531
|
-
self.mean_node = calculate_position(self.planets_degrees_ut[10], "Mean_Node", point_type=point_type)
|
|
532
|
-
self.true_node = calculate_position(self.planets_degrees_ut[11], "True_Node", point_type=point_type)
|
|
533
|
-
|
|
534
|
-
if not self.disable_chiron_and_lilith:
|
|
535
|
-
self.chiron = calculate_position(self.planets_degrees_ut[12], "Chiron", point_type=point_type)
|
|
536
|
-
self.mean_lilith = calculate_position(self.planets_degrees_ut[13], "Mean_Lilith", point_type=point_type)
|
|
537
|
-
|
|
538
|
-
else:
|
|
539
|
-
self.chiron = None
|
|
540
|
-
self.mean_lilith = None
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
def _planets_in_houses(self) -> None:
|
|
544
|
-
"""Calculates the house of the planet and updates
|
|
545
|
-
the planets dictionary."""
|
|
546
|
-
|
|
547
|
-
self.sun.house = get_planet_house(self.planets_degrees_ut[0], self.houses_degree_ut)
|
|
548
|
-
self.moon.house = get_planet_house(self.planets_degrees_ut[1], self.houses_degree_ut)
|
|
549
|
-
self.mercury.house = get_planet_house(self.planets_degrees_ut[2], self.houses_degree_ut)
|
|
550
|
-
self.venus.house = get_planet_house(self.planets_degrees_ut[3], self.houses_degree_ut)
|
|
551
|
-
self.mars.house = get_planet_house(self.planets_degrees_ut[4], self.houses_degree_ut)
|
|
552
|
-
self.jupiter.house = get_planet_house(self.planets_degrees_ut[5], self.houses_degree_ut)
|
|
553
|
-
self.saturn.house = get_planet_house(self.planets_degrees_ut[6], self.houses_degree_ut)
|
|
554
|
-
self.uranus.house = get_planet_house(self.planets_degrees_ut[7], self.houses_degree_ut)
|
|
555
|
-
self.neptune.house = get_planet_house(self.planets_degrees_ut[8], self.houses_degree_ut)
|
|
556
|
-
self.pluto.house = get_planet_house(self.planets_degrees_ut[9], self.houses_degree_ut)
|
|
557
|
-
self.mean_node.house = get_planet_house(self.planets_degrees_ut[10], self.houses_degree_ut)
|
|
558
|
-
self.true_node.house = get_planet_house(self.planets_degrees_ut[11], self.houses_degree_ut)
|
|
559
|
-
|
|
560
|
-
self.planets_list = [
|
|
500
|
+
self.sun = get_kerykeion_point_from_degree(sun_deg, "Sun", point_type=point_type)
|
|
501
|
+
self.moon = get_kerykeion_point_from_degree(moon_deg, "Moon", point_type=point_type)
|
|
502
|
+
self.mercury = get_kerykeion_point_from_degree(mercury_deg, "Mercury", point_type=point_type)
|
|
503
|
+
self.venus = get_kerykeion_point_from_degree(venus_deg, "Venus", point_type=point_type)
|
|
504
|
+
self.mars = get_kerykeion_point_from_degree(mars_deg, "Mars", point_type=point_type)
|
|
505
|
+
self.jupiter = get_kerykeion_point_from_degree(jupiter_deg, "Jupiter", point_type=point_type)
|
|
506
|
+
self.saturn = get_kerykeion_point_from_degree(saturn_deg, "Saturn", point_type=point_type)
|
|
507
|
+
self.uranus = get_kerykeion_point_from_degree(uranus_deg, "Uranus", point_type=point_type)
|
|
508
|
+
self.neptune = get_kerykeion_point_from_degree(neptune_deg, "Neptune", point_type=point_type)
|
|
509
|
+
self.pluto = get_kerykeion_point_from_degree(pluto_deg, "Pluto", point_type=point_type)
|
|
510
|
+
self.mean_node = get_kerykeion_point_from_degree(mean_node_deg, "Mean_Node", point_type=point_type)
|
|
511
|
+
self.true_node = get_kerykeion_point_from_degree(true_node_deg, "True_Node", point_type=point_type)
|
|
512
|
+
|
|
513
|
+
self.sun.house = get_planet_house(sun_deg, self._houses_degree_ut)
|
|
514
|
+
self.moon.house = get_planet_house(moon_deg, self._houses_degree_ut)
|
|
515
|
+
self.mercury.house = get_planet_house(mercury_deg, self._houses_degree_ut)
|
|
516
|
+
self.venus.house = get_planet_house(venus_deg, self._houses_degree_ut)
|
|
517
|
+
self.mars.house = get_planet_house(mars_deg, self._houses_degree_ut)
|
|
518
|
+
self.jupiter.house = get_planet_house(jupiter_deg, self._houses_degree_ut)
|
|
519
|
+
self.saturn.house = get_planet_house(saturn_deg, self._houses_degree_ut)
|
|
520
|
+
self.uranus.house = get_planet_house(uranus_deg, self._houses_degree_ut)
|
|
521
|
+
self.neptune.house = get_planet_house(neptune_deg, self._houses_degree_ut)
|
|
522
|
+
self.pluto.house = get_planet_house(pluto_deg, self._houses_degree_ut)
|
|
523
|
+
self.mean_node.house = get_planet_house(mean_node_deg, self._houses_degree_ut)
|
|
524
|
+
self.true_node.house = get_planet_house(true_node_deg, self._houses_degree_ut)
|
|
525
|
+
|
|
526
|
+
# Deprecated
|
|
527
|
+
planets_list = [
|
|
561
528
|
self.sun,
|
|
562
529
|
self.moon,
|
|
563
530
|
self.mercury,
|
|
@@ -571,91 +538,70 @@ class AstrologicalSubject:
|
|
|
571
538
|
self.mean_node,
|
|
572
539
|
self.true_node,
|
|
573
540
|
]
|
|
574
|
-
|
|
541
|
+
|
|
575
542
|
if not self.disable_chiron_and_lilith:
|
|
576
|
-
|
|
577
|
-
|
|
543
|
+
chiron_deg = swe.calc(self.julian_day, 15, self._iflag)[0][0]
|
|
544
|
+
mean_lilith_deg = swe.calc(self.julian_day, 12, self._iflag)[0][0]
|
|
578
545
|
|
|
579
|
-
self.
|
|
580
|
-
self.
|
|
546
|
+
self.chiron = get_kerykeion_point_from_degree(chiron_deg, "Chiron", point_type=point_type)
|
|
547
|
+
self.mean_lilith = get_kerykeion_point_from_degree(mean_lilith_deg, "Mean_Lilith", point_type=point_type)
|
|
548
|
+
|
|
549
|
+
self.chiron.house = get_planet_house(chiron_deg, self._houses_degree_ut)
|
|
550
|
+
self.mean_lilith.house = get_planet_house(mean_lilith_deg, self._houses_degree_ut)
|
|
551
|
+
|
|
552
|
+
# Deprecated
|
|
553
|
+
planets_list.append(self.chiron)
|
|
554
|
+
planets_list.append(self.mean_lilith)
|
|
581
555
|
|
|
582
556
|
else:
|
|
583
557
|
self.chiron = None
|
|
584
558
|
self.mean_lilith = None
|
|
585
559
|
|
|
560
|
+
# FIXME: Update after removing planets_list
|
|
561
|
+
self.planets_names_list = [planet["name"] for planet in planets_list]
|
|
562
|
+
|
|
586
563
|
# Check in retrograde or not:
|
|
587
|
-
|
|
588
|
-
for planet in self.planets_list:
|
|
564
|
+
for planet in planets_list:
|
|
589
565
|
planet_number = get_number_from_name(planet["name"])
|
|
590
566
|
if swe.calc(self.julian_day, planet_number, self._iflag)[0][3] < 0:
|
|
591
567
|
planet["retrograde"] = True
|
|
592
568
|
else:
|
|
593
569
|
planet["retrograde"] = False
|
|
594
|
-
planets_ret.append(planet)
|
|
595
570
|
|
|
596
|
-
def _lunar_phase_calc(self) -> None:
|
|
597
|
-
"""Function to calculate the lunar phase"""
|
|
598
571
|
|
|
599
|
-
|
|
600
|
-
|
|
572
|
+
def _initialize_moon_phase(self) -> None:
|
|
573
|
+
"""
|
|
574
|
+
Calculate and initialize the lunar phase based on the positions of the moon and sun.
|
|
601
575
|
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
576
|
+
This function calculates the degrees between the moon and the sun, determines the moon phase
|
|
577
|
+
and sun phase, and initializes the lunar phase model with the calculated values.
|
|
578
|
+
"""
|
|
579
|
+
# Initialize moon_phase and sun_phase to None in case of an error
|
|
580
|
+
moon_phase, sun_phase = None, None
|
|
605
581
|
|
|
606
|
-
|
|
607
|
-
|
|
582
|
+
# Calculate the anti-clockwise degrees between the sun and moon
|
|
583
|
+
moon, sun = self.moon.abs_pos, self.sun.abs_pos
|
|
584
|
+
degrees_between = (moon - sun) % 360
|
|
608
585
|
|
|
586
|
+
# Calculate the moon phase (1-28) based on the degrees between the sun and moon
|
|
609
587
|
step = 360.0 / 28.0
|
|
588
|
+
moon_phase = int(degrees_between // step) + 1
|
|
610
589
|
|
|
611
|
-
|
|
612
|
-
low = x * step
|
|
613
|
-
high = (x + 1) * step
|
|
614
|
-
|
|
615
|
-
if degrees_between >= low and degrees_between < high:
|
|
616
|
-
moon_phase = x + 1
|
|
617
|
-
|
|
590
|
+
# Define the sun phase steps
|
|
618
591
|
sunstep = [
|
|
619
|
-
0,
|
|
620
|
-
|
|
621
|
-
40,
|
|
622
|
-
50,
|
|
623
|
-
60,
|
|
624
|
-
70,
|
|
625
|
-
80,
|
|
626
|
-
90,
|
|
627
|
-
120,
|
|
628
|
-
130,
|
|
629
|
-
140,
|
|
630
|
-
150,
|
|
631
|
-
160,
|
|
632
|
-
170,
|
|
633
|
-
180,
|
|
634
|
-
210,
|
|
635
|
-
220,
|
|
636
|
-
230,
|
|
637
|
-
240,
|
|
638
|
-
250,
|
|
639
|
-
260,
|
|
640
|
-
270,
|
|
641
|
-
300,
|
|
642
|
-
310,
|
|
643
|
-
320,
|
|
644
|
-
330,
|
|
645
|
-
340,
|
|
646
|
-
350,
|
|
592
|
+
0, 30, 40, 50, 60, 70, 80, 90, 120, 130, 140, 150, 160, 170, 180,
|
|
593
|
+
210, 220, 230, 240, 250, 260, 270, 300, 310, 320, 330, 340, 350
|
|
647
594
|
]
|
|
648
595
|
|
|
596
|
+
# Calculate the sun phase (1-28) based on the degrees between the sun and moon
|
|
649
597
|
for x in range(len(sunstep)):
|
|
650
598
|
low = sunstep[x]
|
|
651
|
-
|
|
652
|
-
if
|
|
653
|
-
high = 360
|
|
654
|
-
else:
|
|
655
|
-
high = sunstep[x + 1]
|
|
656
|
-
if degrees_between >= low and degrees_between < high:
|
|
599
|
+
high = sunstep[x + 1] if x < len(sunstep) - 1 else 360
|
|
600
|
+
if low <= degrees_between < high:
|
|
657
601
|
sun_phase = x + 1
|
|
602
|
+
break
|
|
658
603
|
|
|
604
|
+
# Create a dictionary with the lunar phase information
|
|
659
605
|
lunar_phase_dictionary = {
|
|
660
606
|
"degrees_between_s_m": degrees_between,
|
|
661
607
|
"moon_phase": moon_phase,
|
|
@@ -664,6 +610,7 @@ class AstrologicalSubject:
|
|
|
664
610
|
"moon_phase_name": get_moon_phase_name_from_phase_int(moon_phase)
|
|
665
611
|
}
|
|
666
612
|
|
|
613
|
+
# Initialize the lunar phase model with the calculated values
|
|
667
614
|
self.lunar_phase = LunarPhaseModel(**lunar_phase_dictionary)
|
|
668
615
|
|
|
669
616
|
def json(self, dump=False, destination_folder: Union[str, None] = None, indent: Union[int, None] = None) -> str:
|