kerykeion 4.0.6__py3-none-any.whl → 4.12.3__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.

@@ -1,13 +1,16 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  """
3
- This is part of Kerykeion (C) 2023 Giacomo Battaglia
3
+ This is part of Kerykeion (C) 2024 Giacomo Battaglia
4
4
  """
5
5
 
6
6
  from kerykeion import AstrologicalSubject
7
7
  from pathlib import Path
8
8
  from typing import Union
9
+ from functools import cached_property
9
10
 
10
11
  from kerykeion.aspects.natal_aspects import NatalAspects
12
+ from kerykeion.settings.kerykeion_settings import get_settings
13
+ from kerykeion.aspects.aspects_utils import planet_id_decoder, get_aspect_from_two_points, get_active_points_list
11
14
 
12
15
 
13
16
  class SynastryAspects(NatalAspects):
@@ -21,49 +24,65 @@ class SynastryAspects(NatalAspects):
21
24
  kr_object_two: AstrologicalSubject,
22
25
  new_settings_file: Union[Path, None] = None,
23
26
  ):
27
+ # Subjects
24
28
  self.first_user = kr_object_one
25
29
  self.second_user = kr_object_two
26
30
 
31
+ # Settings
27
32
  self.new_settings_file = new_settings_file
28
- self._parse_json_settings()
33
+ self.settings = get_settings(self.new_settings_file)
29
34
 
30
- self.first_init_point_list = self.first_user.planets_list + self.first_user.houses_list
31
- self.second_init_point_list = self.second_user.planets_list + self.second_user.houses_list
35
+ self.celestial_points = self.settings["celestial_points"]
36
+ self.aspects_settings = self.settings["aspects"]
37
+ self.axes_orbit_settings = self.settings["general_settings"]["axes_orbit"]
32
38
 
33
- def get_all_aspects(self):
39
+ # Private variables of the aspects
40
+ self._all_aspects: Union[list, None] = None
41
+ self._relevant_aspects: Union[list, None] = None
42
+
43
+ @cached_property
44
+ def all_aspects(self):
34
45
  """
35
46
  Return all the aspects of the points in the natal chart in a dictionary,
36
47
  first all the individual aspects of each planet, second the aspects
37
48
  whiteout repetitions.
38
49
  """
39
50
 
40
- f_1 = self.filter_by_settings(self.first_init_point_list)
41
- f_2 = self.filter_by_settings(self.second_init_point_list)
51
+ if self._all_aspects is not None:
52
+ return self._all_aspects
53
+
54
+ # Celestial Points Lists
55
+ first_active_points_list = get_active_points_list(self.first_user, self.settings)
56
+ second_active_points_list = get_active_points_list(self.second_user, self.settings)
42
57
 
43
58
  self.all_aspects_list = []
44
59
 
45
- for first in range(len(f_1)):
60
+ for first in range(len(first_active_points_list)):
46
61
  # Generates the aspects list whitout repetitions
47
- for second in range(len(f_2)):
48
- verdict, name, orbit, aspect_degrees, color, aid, diff = self.asp_calc(
49
- f_1[first]["abs_pos"], f_2[second]["abs_pos"]
62
+ for second in range(len(second_active_points_list)):
63
+ verdict, name, orbit, aspect_degrees, aid, diff = get_aspect_from_two_points(
64
+ self.aspects_settings,
65
+ first_active_points_list[first]["abs_pos"],
66
+ second_active_points_list[second]["abs_pos"],
50
67
  )
51
68
 
52
69
  if verdict == True:
53
70
  d_asp = {
54
- "p1_name": f_1[first]["name"],
55
- "p1_abs_pos": f_1[first]["abs_pos"],
56
- "p2_name": f_2[second]["name"],
57
- "p2_abs_pos": f_2[second]["abs_pos"],
71
+ "p1_name": first_active_points_list[first]["name"],
72
+ "p1_abs_pos": first_active_points_list[first]["abs_pos"],
73
+ "p2_name": second_active_points_list[second]["name"],
74
+ "p2_abs_pos": second_active_points_list[second]["abs_pos"],
58
75
  "aspect": name,
59
76
  "orbit": orbit,
60
77
  "aspect_degrees": aspect_degrees,
61
- "color": color,
62
78
  "aid": aid,
63
79
  "diff": diff,
64
- "p1": self.p_id_decoder(f_1[first]["name"]),
65
- "p2": self.p_id_decoder(
66
- f_2[second]["name"],
80
+ "p1": planet_id_decoder(
81
+ self.settings.celestial_points, first_active_points_list[first]["name"]
82
+ ),
83
+ "p2": planet_id_decoder(
84
+ self.settings.celestial_points,
85
+ second_active_points_list[second]["name"],
67
86
  ),
68
87
  }
69
88
 
@@ -73,13 +92,16 @@ class SynastryAspects(NatalAspects):
73
92
 
74
93
 
75
94
  if __name__ == "__main__":
76
- john = AstrologicalSubject("John", 1940, 10, 9, 10, 30, "Liverpool")
77
- yoko = AstrologicalSubject("Yoko", 1933, 2, 18, 10, 30, "Tokyo")
95
+ from kerykeion.utilities import setup_logging
96
+ setup_logging(level="debug")
97
+
98
+ john = AstrologicalSubject("John", 1940, 10, 9, 18, 30, "Liverpool")
99
+ yoko = AstrologicalSubject("Yoko", 1933, 2, 18, 18, 30, "Tokyo")
78
100
 
79
101
  synastry_aspects = SynastryAspects(john, yoko)
80
102
 
81
103
  # All aspects
82
- print(synastry_aspects.get_all_aspects())
104
+ print(synastry_aspects.all_aspects)
83
105
 
84
106
  # Relevant aspects
85
- print(synastry_aspects.get_relevant_aspects())
107
+ print(synastry_aspects.relevant_aspects)