kerykeion 4.5.1__tar.gz → 4.6.0__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.5.1 → kerykeion-4.6.0}/PKG-INFO +1 -1
- {kerykeion-4.5.1 → kerykeion-4.6.0}/kerykeion/__init__.py +1 -1
- {kerykeion-4.5.1 → kerykeion-4.6.0}/kerykeion/aspects/__init__.py +1 -1
- {kerykeion-4.5.1 → kerykeion-4.6.0}/kerykeion/aspects/aspects_utils.py +1 -1
- {kerykeion-4.5.1 → kerykeion-4.6.0}/kerykeion/aspects/natal_aspects.py +1 -1
- {kerykeion-4.5.1 → kerykeion-4.6.0}/kerykeion/aspects/synastry_aspects.py +1 -1
- {kerykeion-4.5.1 → kerykeion-4.6.0}/kerykeion/astrological_subject.py +23 -82
- {kerykeion-4.5.1 → kerykeion-4.6.0}/kerykeion/charts/__init__.py +1 -1
- {kerykeion-4.5.1 → kerykeion-4.6.0}/kerykeion/charts/kerykeion_chart_svg.py +1 -1
- {kerykeion-4.5.1 → kerykeion-4.6.0}/kerykeion/fetch_geonames.py +1 -1
- {kerykeion-4.5.1 → kerykeion-4.6.0}/kerykeion/kr_types/__init__.py +5 -0
- {kerykeion-4.5.1 → kerykeion-4.6.0}/kerykeion/kr_types/kerykeion_exception.py +1 -1
- {kerykeion-4.5.1 → kerykeion-4.6.0}/kerykeion/kr_types/kr_literals.py +11 -1
- {kerykeion-4.5.1 → kerykeion-4.6.0}/kerykeion/kr_types/kr_models.py +8 -6
- {kerykeion-4.5.1 → kerykeion-4.6.0}/kerykeion/kr_types/settings_models.py +2 -2
- {kerykeion-4.5.1 → kerykeion-4.6.0}/kerykeion/relationship_score.py +1 -1
- {kerykeion-4.5.1 → kerykeion-4.6.0}/kerykeion/settings/kerykeion_settings.py +2 -2
- {kerykeion-4.5.1 → kerykeion-4.6.0}/kerykeion/utilities.py +135 -0
- {kerykeion-4.5.1 → kerykeion-4.6.0}/pyproject.toml +1 -1
- {kerykeion-4.5.1 → kerykeion-4.6.0}/LICENSE +0 -0
- {kerykeion-4.5.1 → kerykeion-4.6.0}/README.md +0 -0
- {kerykeion-4.5.1 → kerykeion-4.6.0}/kerykeion/charts/charts_utils.py +0 -0
- {kerykeion-4.5.1 → kerykeion-4.6.0}/kerykeion/charts/templates/chart.xml +0 -0
- {kerykeion-4.5.1 → kerykeion-4.6.0}/kerykeion/enums.py +0 -0
- {kerykeion-4.5.1 → kerykeion-4.6.0}/kerykeion/kr_types/chart_types.py +0 -0
- {kerykeion-4.5.1 → kerykeion-4.6.0}/kerykeion/report.py +0 -0
- {kerykeion-4.5.1 → kerykeion-4.6.0}/kerykeion/settings/__init__.py +0 -0
- {kerykeion-4.5.1 → kerykeion-4.6.0}/kerykeion/settings/kr.config.json +0 -0
- {kerykeion-4.5.1 → kerykeion-4.6.0}/kerykeion/sweph/README.md +0 -0
- {kerykeion-4.5.1 → kerykeion-4.6.0}/kerykeion/sweph/seas_18.se1 +0 -0
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
2
|
"""
|
|
3
|
-
This is part of Kerykeion (C)
|
|
3
|
+
This is part of Kerykeion (C) 2024 Giacomo Battaglia
|
|
4
4
|
"""
|
|
5
5
|
|
|
6
|
-
import math
|
|
7
6
|
import pytz
|
|
8
7
|
import swisseph as swe
|
|
9
8
|
import logging
|
|
@@ -17,7 +16,13 @@ from kerykeion.kr_types import (
|
|
|
17
16
|
LunarPhaseModel,
|
|
18
17
|
KerykeionPointModel,
|
|
19
18
|
)
|
|
20
|
-
from kerykeion.utilities import
|
|
19
|
+
from kerykeion.utilities import (
|
|
20
|
+
get_number_from_name,
|
|
21
|
+
calculate_position,
|
|
22
|
+
get_planet_house,
|
|
23
|
+
get_moon_emoji_from_phase_int,
|
|
24
|
+
get_moon_phase_name_from_phase_int,
|
|
25
|
+
)
|
|
21
26
|
from pathlib import Path
|
|
22
27
|
from typing import Union, Literal
|
|
23
28
|
|
|
@@ -431,64 +436,21 @@ class AstrologicalSubject:
|
|
|
431
436
|
"""Calculates the house of the planet and updates
|
|
432
437
|
the planets dictionary."""
|
|
433
438
|
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
return False
|
|
447
|
-
|
|
448
|
-
if point_between(self.houses_degree_ut[0], self.houses_degree_ut[1], planet_deg) == True:
|
|
449
|
-
planet["house"] = "First_House"
|
|
450
|
-
elif point_between(self.houses_degree_ut[1], self.houses_degree_ut[2], planet_deg) == True:
|
|
451
|
-
planet["house"] = "Second_House"
|
|
452
|
-
elif point_between(self.houses_degree_ut[2], self.houses_degree_ut[3], planet_deg) == True:
|
|
453
|
-
planet["house"] = "Third_House"
|
|
454
|
-
elif point_between(self.houses_degree_ut[3], self.houses_degree_ut[4], planet_deg) == True:
|
|
455
|
-
planet["house"] = "Fourth_House"
|
|
456
|
-
elif point_between(self.houses_degree_ut[4], self.houses_degree_ut[5], planet_deg) == True:
|
|
457
|
-
planet["house"] = "Fifth_House"
|
|
458
|
-
elif point_between(self.houses_degree_ut[5], self.houses_degree_ut[6], planet_deg) == True:
|
|
459
|
-
planet["house"] = "Sixth_House"
|
|
460
|
-
elif point_between(self.houses_degree_ut[6], self.houses_degree_ut[7], planet_deg) == True:
|
|
461
|
-
planet["house"] = "Seventh_House"
|
|
462
|
-
elif point_between(self.houses_degree_ut[7], self.houses_degree_ut[8], planet_deg) == True:
|
|
463
|
-
planet["house"] = "Eighth_House"
|
|
464
|
-
elif point_between(self.houses_degree_ut[8], self.houses_degree_ut[9], planet_deg) == True:
|
|
465
|
-
planet["house"] = "Ninth_House"
|
|
466
|
-
elif point_between(self.houses_degree_ut[9], self.houses_degree_ut[10], planet_deg) == True:
|
|
467
|
-
planet["house"] = "Tenth_House"
|
|
468
|
-
elif point_between(self.houses_degree_ut[10], self.houses_degree_ut[11], planet_deg) == True:
|
|
469
|
-
planet["house"] = "Eleventh_House"
|
|
470
|
-
elif point_between(self.houses_degree_ut[11], self.houses_degree_ut[0], planet_deg) == True:
|
|
471
|
-
planet["house"] = "Twelfth_House"
|
|
472
|
-
else:
|
|
473
|
-
planet["house"] = "error!"
|
|
474
|
-
|
|
475
|
-
return planet
|
|
476
|
-
|
|
477
|
-
self.sun = for_every_planet(self.sun, self.planets_degrees_ut[0])
|
|
478
|
-
self.moon = for_every_planet(self.moon, self.planets_degrees_ut[1])
|
|
479
|
-
self.mercury = for_every_planet(self.mercury, self.planets_degrees_ut[2])
|
|
480
|
-
self.venus = for_every_planet(self.venus, self.planets_degrees_ut[3])
|
|
481
|
-
self.mars = for_every_planet(self.mars, self.planets_degrees_ut[4])
|
|
482
|
-
self.jupiter = for_every_planet(self.jupiter, self.planets_degrees_ut[5])
|
|
483
|
-
self.saturn = for_every_planet(self.saturn, self.planets_degrees_ut[6])
|
|
484
|
-
self.uranus = for_every_planet(self.uranus, self.planets_degrees_ut[7])
|
|
485
|
-
self.neptune = for_every_planet(self.neptune, self.planets_degrees_ut[8])
|
|
486
|
-
self.pluto = for_every_planet(self.pluto, self.planets_degrees_ut[9])
|
|
487
|
-
self.mean_node = for_every_planet(self.mean_node, self.planets_degrees_ut[10])
|
|
488
|
-
self.true_node = for_every_planet(self.true_node, self.planets_degrees_ut[11])
|
|
439
|
+
self.sun.house = get_planet_house(self.planets_degrees_ut[0], self.houses_degree_ut)
|
|
440
|
+
self.moon.house = get_planet_house(self.planets_degrees_ut[1], self.houses_degree_ut)
|
|
441
|
+
self.mercury.house = get_planet_house(self.planets_degrees_ut[2], self.houses_degree_ut)
|
|
442
|
+
self.venus.house = get_planet_house(self.planets_degrees_ut[3], self.houses_degree_ut)
|
|
443
|
+
self.mars.house = get_planet_house(self.planets_degrees_ut[4], self.houses_degree_ut)
|
|
444
|
+
self.jupiter.house = get_planet_house(self.planets_degrees_ut[5], self.houses_degree_ut)
|
|
445
|
+
self.saturn.house = get_planet_house(self.planets_degrees_ut[6], self.houses_degree_ut)
|
|
446
|
+
self.uranus.house = get_planet_house(self.planets_degrees_ut[7], self.houses_degree_ut)
|
|
447
|
+
self.neptune.house = get_planet_house(self.planets_degrees_ut[8], self.houses_degree_ut)
|
|
448
|
+
self.pluto.house = get_planet_house(self.planets_degrees_ut[9], self.houses_degree_ut)
|
|
449
|
+
self.mean_node.house = get_planet_house(self.planets_degrees_ut[10], self.houses_degree_ut)
|
|
450
|
+
self.true_node.house = get_planet_house(self.planets_degrees_ut[11], self.houses_degree_ut)
|
|
489
451
|
|
|
490
452
|
if not self.disable_chiron:
|
|
491
|
-
self.chiron =
|
|
453
|
+
self.chiron.house = get_planet_house(self.planets_degrees_ut[12], self.houses_degree_ut)
|
|
492
454
|
else:
|
|
493
455
|
self.chiron = None
|
|
494
456
|
|
|
@@ -583,33 +545,12 @@ class AstrologicalSubject:
|
|
|
583
545
|
if degrees_between >= low and degrees_between < high:
|
|
584
546
|
sun_phase = x + 1
|
|
585
547
|
|
|
586
|
-
def moon_emoji(phase):
|
|
587
|
-
if phase == 1:
|
|
588
|
-
result = "🌑"
|
|
589
|
-
elif phase < 7:
|
|
590
|
-
result = "🌒"
|
|
591
|
-
elif 7 <= phase <= 9:
|
|
592
|
-
result = "🌓"
|
|
593
|
-
elif phase < 14:
|
|
594
|
-
result = "🌔"
|
|
595
|
-
elif phase == 14:
|
|
596
|
-
result = "🌕"
|
|
597
|
-
elif phase < 20:
|
|
598
|
-
result = "🌖"
|
|
599
|
-
elif 20 <= phase <= 22:
|
|
600
|
-
result = "🌗"
|
|
601
|
-
elif phase <= 28:
|
|
602
|
-
result = "🌘"
|
|
603
|
-
else:
|
|
604
|
-
result = phase
|
|
605
|
-
|
|
606
|
-
return result
|
|
607
|
-
|
|
608
548
|
lunar_phase_dictionary = {
|
|
609
549
|
"degrees_between_s_m": degrees_between,
|
|
610
550
|
"moon_phase": moon_phase,
|
|
611
551
|
"sun_phase": sun_phase,
|
|
612
|
-
"moon_emoji":
|
|
552
|
+
"moon_emoji": get_moon_emoji_from_phase_int(moon_phase),
|
|
553
|
+
"moon_phase_name": get_moon_phase_name_from_phase_int(moon_phase)
|
|
613
554
|
}
|
|
614
555
|
|
|
615
556
|
self.lunar_phase = LunarPhaseModel(**lunar_phase_dictionary)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
2
|
"""
|
|
3
|
-
This is part of Kerykeion (C)
|
|
3
|
+
This is part of Kerykeion (C) 2024 Giacomo Battaglia
|
|
4
4
|
"""
|
|
5
5
|
|
|
6
6
|
|
|
@@ -56,3 +56,13 @@ Quality = Literal[
|
|
|
56
56
|
ChartType = Literal["Natal", "ExternalNatal", "Synastry", "Transit"]
|
|
57
57
|
|
|
58
58
|
LunarPhaseEmoji = Literal["🌑", "🌒", "🌓", "🌔", "🌕", "🌖", "🌗", "🌘"]
|
|
59
|
+
LunarPhaseName = Literal[
|
|
60
|
+
"New Moon",
|
|
61
|
+
"Waxing Crescent",
|
|
62
|
+
"First Quarter",
|
|
63
|
+
"Waxing Gibbous",
|
|
64
|
+
"Full Moon",
|
|
65
|
+
"Waning Gibbous",
|
|
66
|
+
"Last Quarter",
|
|
67
|
+
"Waning Crescent"
|
|
68
|
+
]
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
2
|
"""
|
|
3
|
-
This is part of Kerykeion (C)
|
|
3
|
+
This is part of Kerykeion (C) 2024 Giacomo Battaglia
|
|
4
4
|
"""
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
from typing import Literal, Union, Optional
|
|
8
8
|
from pydantic import BaseModel
|
|
9
9
|
|
|
10
|
-
from .
|
|
10
|
+
from kerykeion.kr_types import LunarPhaseEmoji, LunarPhaseName, Planet, Houses, Quality, Element, Sign, ZodiacType
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
class LunarPhaseModel(BaseModel):
|
|
@@ -15,11 +15,12 @@ class LunarPhaseModel(BaseModel):
|
|
|
15
15
|
moon_phase: int
|
|
16
16
|
sun_phase: int
|
|
17
17
|
moon_emoji: LunarPhaseEmoji
|
|
18
|
+
moon_phase_name: LunarPhaseName
|
|
18
19
|
|
|
19
20
|
def __str__(self):
|
|
20
21
|
return (
|
|
21
22
|
super()
|
|
22
|
-
.
|
|
23
|
+
.model_dump(
|
|
23
24
|
exclude_none=True,
|
|
24
25
|
exclude_unset=True,
|
|
25
26
|
exclude_defaults=True,
|
|
@@ -73,7 +74,7 @@ class KerykeionPointModel(BaseModel):
|
|
|
73
74
|
def __str__(self):
|
|
74
75
|
return (
|
|
75
76
|
super()
|
|
76
|
-
.
|
|
77
|
+
.model_dump(
|
|
77
78
|
exclude_none=True,
|
|
78
79
|
exclude_unset=True,
|
|
79
80
|
exclude_defaults=True,
|
|
@@ -85,7 +86,7 @@ class KerykeionPointModel(BaseModel):
|
|
|
85
86
|
def __repr__(self):
|
|
86
87
|
return (
|
|
87
88
|
super()
|
|
88
|
-
.
|
|
89
|
+
.model_dump(
|
|
89
90
|
exclude_none=True,
|
|
90
91
|
exclude_unset=True,
|
|
91
92
|
exclude_defaults=True,
|
|
@@ -162,6 +163,7 @@ class AstrologicalSubjectModel(BaseModel):
|
|
|
162
163
|
|
|
163
164
|
if __name__ == "__main__":
|
|
164
165
|
from kerykeion.utilities import setup_logging
|
|
166
|
+
|
|
165
167
|
setup_logging(level="debug")
|
|
166
168
|
|
|
167
169
|
sun = KerykeionPointModel(
|
|
@@ -176,5 +178,5 @@ if __name__ == "__main__":
|
|
|
176
178
|
point_type="Planet",
|
|
177
179
|
)
|
|
178
180
|
|
|
179
|
-
print(sun.
|
|
181
|
+
print(sun.model_dump_json())
|
|
180
182
|
print(sun)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
2
|
"""
|
|
3
|
-
This is part of Kerykeion (C)
|
|
3
|
+
This is part of Kerykeion (C) 2024 Giacomo Battaglia
|
|
4
4
|
"""
|
|
5
5
|
|
|
6
6
|
|
|
@@ -22,7 +22,7 @@ class CustomBaseModel(BaseModel):
|
|
|
22
22
|
return getattr(self, item)
|
|
23
23
|
|
|
24
24
|
def __str__(self) -> str:
|
|
25
|
-
return str(self.
|
|
25
|
+
return str(self.model_dump())
|
|
26
26
|
|
|
27
27
|
def get(self, item, default=None):
|
|
28
28
|
return getattr(self, item, default)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
2
|
"""
|
|
3
|
-
This is part of Kerykeion (C)
|
|
3
|
+
This is part of Kerykeion (C) 2024 Giacomo Battaglia
|
|
4
4
|
"""
|
|
5
5
|
|
|
6
6
|
|
|
@@ -60,7 +60,7 @@ def merge_settings(settings: KerykeionSettingsModel, new_settings: Dict) -> Kery
|
|
|
60
60
|
Returns:
|
|
61
61
|
KerykeionSettingsModel: The new settings
|
|
62
62
|
"""
|
|
63
|
-
new_settings_dict = settings.
|
|
63
|
+
new_settings_dict = settings.model_dump() | new_settings
|
|
64
64
|
return KerykeionSettingsModel(**new_settings_dict)
|
|
65
65
|
|
|
66
66
|
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
from kerykeion.kr_types import KerykeionPointModel, KerykeionException, KerykeionSettingsModel, AstrologicalSubjectModel
|
|
2
|
+
from kerykeion.kr_types.kr_literals import LunarPhaseEmoji, LunarPhaseName
|
|
2
3
|
from typing import Union, Literal
|
|
3
4
|
import logging
|
|
5
|
+
import math
|
|
6
|
+
|
|
4
7
|
|
|
5
8
|
|
|
6
9
|
def get_number_from_name(name: str) -> int:
|
|
@@ -220,3 +223,135 @@ def setup_logging(level: str) -> None:
|
|
|
220
223
|
format: str = "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
|
|
221
224
|
loglevel: int = logopt.get(level, logging.INFO)
|
|
222
225
|
logging.basicConfig(format=format, level=loglevel)
|
|
226
|
+
|
|
227
|
+
def check_if_point_between(
|
|
228
|
+
start_point: Union[int, float], end_point: Union[int, float], evaluated_point: Union[int, float]
|
|
229
|
+
) -> bool:
|
|
230
|
+
"""
|
|
231
|
+
Finds if a point is between two other in a circle.
|
|
232
|
+
|
|
233
|
+
Args:
|
|
234
|
+
- start_point: The first point
|
|
235
|
+
- end_point: The second point
|
|
236
|
+
- point: The point to check if it is between start_point and end_point
|
|
237
|
+
|
|
238
|
+
Returns:
|
|
239
|
+
- True if point is between start_point and end_point, False otherwise
|
|
240
|
+
"""
|
|
241
|
+
|
|
242
|
+
p1_p2 = math.fmod(end_point - start_point + 360, 360)
|
|
243
|
+
p1_p3 = math.fmod(evaluated_point - start_point + 360, 360)
|
|
244
|
+
|
|
245
|
+
if (p1_p2 <= 180) != (p1_p3 > p1_p2):
|
|
246
|
+
return True
|
|
247
|
+
else:
|
|
248
|
+
return False
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
def get_planet_house(planet_position_degree: Union[int, float], houses_degree_ut_list: list) -> str:
|
|
252
|
+
"""
|
|
253
|
+
Returns the house in which a planet is located.
|
|
254
|
+
|
|
255
|
+
Args:
|
|
256
|
+
- planet_position_degree: The position of the planet in degrees
|
|
257
|
+
- houses_degree_ut_list: A list of the houses in degrees (0-360)
|
|
258
|
+
|
|
259
|
+
Returns:
|
|
260
|
+
- The house in which the planet is located
|
|
261
|
+
"""
|
|
262
|
+
|
|
263
|
+
house = None
|
|
264
|
+
if check_if_point_between(houses_degree_ut_list[0], houses_degree_ut_list[1], planet_position_degree) == True:
|
|
265
|
+
house = "First_House"
|
|
266
|
+
elif check_if_point_between(houses_degree_ut_list[1], houses_degree_ut_list[2], planet_position_degree) == True:
|
|
267
|
+
house = "Second_House"
|
|
268
|
+
elif check_if_point_between(houses_degree_ut_list[2], houses_degree_ut_list[3], planet_position_degree) == True:
|
|
269
|
+
house = "Third_House"
|
|
270
|
+
elif check_if_point_between(houses_degree_ut_list[3], houses_degree_ut_list[4], planet_position_degree) == True:
|
|
271
|
+
house = "Fourth_House"
|
|
272
|
+
elif check_if_point_between(houses_degree_ut_list[4], houses_degree_ut_list[5], planet_position_degree) == True:
|
|
273
|
+
house = "Fifth_House"
|
|
274
|
+
elif check_if_point_between(houses_degree_ut_list[5], houses_degree_ut_list[6], planet_position_degree) == True:
|
|
275
|
+
house = "Sixth_House"
|
|
276
|
+
elif check_if_point_between(houses_degree_ut_list[6], houses_degree_ut_list[7], planet_position_degree) == True:
|
|
277
|
+
house = "Seventh_House"
|
|
278
|
+
elif check_if_point_between(houses_degree_ut_list[7], houses_degree_ut_list[8], planet_position_degree) == True:
|
|
279
|
+
house = "Eighth_House"
|
|
280
|
+
elif check_if_point_between(houses_degree_ut_list[8], houses_degree_ut_list[9], planet_position_degree) == True:
|
|
281
|
+
house = "Ninth_House"
|
|
282
|
+
elif check_if_point_between(houses_degree_ut_list[9], houses_degree_ut_list[10], planet_position_degree) == True:
|
|
283
|
+
house = "Tenth_House"
|
|
284
|
+
elif check_if_point_between(houses_degree_ut_list[10], houses_degree_ut_list[11], planet_position_degree) == True:
|
|
285
|
+
house = "Eleventh_House"
|
|
286
|
+
elif check_if_point_between(houses_degree_ut_list[11], houses_degree_ut_list[0], planet_position_degree) == True:
|
|
287
|
+
house = "Twelfth_House"
|
|
288
|
+
else:
|
|
289
|
+
raise ValueError("Error in house calculation, planet: ", planet_position_degree)
|
|
290
|
+
|
|
291
|
+
return house
|
|
292
|
+
|
|
293
|
+
def get_moon_emoji_from_phase_int(phase: int) -> LunarPhaseEmoji:
|
|
294
|
+
"""
|
|
295
|
+
Returns the emoji of the moon phase.
|
|
296
|
+
|
|
297
|
+
Args:
|
|
298
|
+
- phase: The phase of the moon (0-28)
|
|
299
|
+
|
|
300
|
+
Returns:
|
|
301
|
+
- The emoji of the moon phase
|
|
302
|
+
"""
|
|
303
|
+
|
|
304
|
+
if phase == 1:
|
|
305
|
+
result = "🌑"
|
|
306
|
+
elif phase < 7:
|
|
307
|
+
result = "🌒"
|
|
308
|
+
elif 7 <= phase <= 9:
|
|
309
|
+
result = "🌓"
|
|
310
|
+
elif phase < 14:
|
|
311
|
+
result = "🌔"
|
|
312
|
+
elif phase == 14:
|
|
313
|
+
result = "🌕"
|
|
314
|
+
elif phase < 20:
|
|
315
|
+
result = "🌖"
|
|
316
|
+
elif 20 <= phase <= 22:
|
|
317
|
+
result = "🌗"
|
|
318
|
+
elif phase <= 28:
|
|
319
|
+
result = "🌘"
|
|
320
|
+
|
|
321
|
+
else:
|
|
322
|
+
raise KerykeionException(f"Error in moon emoji calculation! Phase: {phase}")
|
|
323
|
+
|
|
324
|
+
return result
|
|
325
|
+
|
|
326
|
+
def get_moon_phase_name_from_phase_int(phase: int) -> LunarPhaseName:
|
|
327
|
+
"""
|
|
328
|
+
Returns the name of the moon phase.
|
|
329
|
+
|
|
330
|
+
Args:
|
|
331
|
+
- phase: The phase of the moon (0-28)
|
|
332
|
+
|
|
333
|
+
Returns:
|
|
334
|
+
- The name of the moon phase
|
|
335
|
+
"""
|
|
336
|
+
|
|
337
|
+
if phase == 1:
|
|
338
|
+
result = "New Moon"
|
|
339
|
+
elif phase < 7:
|
|
340
|
+
result = "Waxing Crescent"
|
|
341
|
+
elif 7 <= phase <= 9:
|
|
342
|
+
result = "First Quarter"
|
|
343
|
+
elif phase < 14:
|
|
344
|
+
result = "Waxing Gibbous"
|
|
345
|
+
elif phase == 14:
|
|
346
|
+
result = "Full Moon"
|
|
347
|
+
elif phase < 20:
|
|
348
|
+
result = "Waning Gibbous"
|
|
349
|
+
elif 20 <= phase <= 22:
|
|
350
|
+
result = "Last Quarter"
|
|
351
|
+
elif phase <= 28:
|
|
352
|
+
result = "Waning Crescent"
|
|
353
|
+
|
|
354
|
+
else:
|
|
355
|
+
raise KerykeionException(f"Error in moon name calculation! Phase: {phase}")
|
|
356
|
+
|
|
357
|
+
return result
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|