kerykeion 4.25.1__tar.gz → 4.25.3__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.25.1 → kerykeion-4.25.3}/PKG-INFO +39 -15
- {kerykeion-4.25.1 → kerykeion-4.25.3}/README.md +38 -14
- {kerykeion-4.25.1 → kerykeion-4.25.3}/kerykeion/charts/kerykeion_chart_svg.py +25 -7
- {kerykeion-4.25.1 → kerykeion-4.25.3}/kerykeion/composite_subject_factory.py +12 -6
- {kerykeion-4.25.1 → kerykeion-4.25.3}/kerykeion/kr_types/settings_models.py +2 -1
- {kerykeion-4.25.1 → kerykeion-4.25.3}/kerykeion/settings/kr.config.json +20 -10
- {kerykeion-4.25.1 → kerykeion-4.25.3}/kerykeion/utilities.py +50 -0
- {kerykeion-4.25.1 → kerykeion-4.25.3}/pyproject.toml +1 -1
- {kerykeion-4.25.1 → kerykeion-4.25.3}/LICENSE +0 -0
- {kerykeion-4.25.1 → kerykeion-4.25.3}/kerykeion/__init__.py +0 -0
- {kerykeion-4.25.1 → kerykeion-4.25.3}/kerykeion/aspects/__init__.py +0 -0
- {kerykeion-4.25.1 → kerykeion-4.25.3}/kerykeion/aspects/aspects_utils.py +0 -0
- {kerykeion-4.25.1 → kerykeion-4.25.3}/kerykeion/aspects/natal_aspects.py +0 -0
- {kerykeion-4.25.1 → kerykeion-4.25.3}/kerykeion/aspects/synastry_aspects.py +0 -0
- {kerykeion-4.25.1 → kerykeion-4.25.3}/kerykeion/astrological_subject.py +0 -0
- {kerykeion-4.25.1 → kerykeion-4.25.3}/kerykeion/charts/__init__.py +0 -0
- {kerykeion-4.25.1 → kerykeion-4.25.3}/kerykeion/charts/charts_utils.py +0 -0
- {kerykeion-4.25.1 → kerykeion-4.25.3}/kerykeion/charts/draw_planets.py +0 -0
- {kerykeion-4.25.1 → kerykeion-4.25.3}/kerykeion/charts/templates/aspect_grid_only.xml +0 -0
- {kerykeion-4.25.1 → kerykeion-4.25.3}/kerykeion/charts/templates/chart.xml +0 -0
- {kerykeion-4.25.1 → kerykeion-4.25.3}/kerykeion/charts/templates/wheel_only.xml +0 -0
- {kerykeion-4.25.1 → kerykeion-4.25.3}/kerykeion/charts/themes/classic.css +0 -0
- {kerykeion-4.25.1 → kerykeion-4.25.3}/kerykeion/charts/themes/dark-high-contrast.css +0 -0
- {kerykeion-4.25.1 → kerykeion-4.25.3}/kerykeion/charts/themes/dark.css +0 -0
- {kerykeion-4.25.1 → kerykeion-4.25.3}/kerykeion/charts/themes/light.css +0 -0
- {kerykeion-4.25.1 → kerykeion-4.25.3}/kerykeion/enums.py +0 -0
- {kerykeion-4.25.1 → kerykeion-4.25.3}/kerykeion/ephemeris_data.py +0 -0
- {kerykeion-4.25.1 → kerykeion-4.25.3}/kerykeion/fetch_geonames.py +0 -0
- {kerykeion-4.25.1 → kerykeion-4.25.3}/kerykeion/kr_types/__init__.py +0 -0
- {kerykeion-4.25.1 → kerykeion-4.25.3}/kerykeion/kr_types/chart_types.py +0 -0
- {kerykeion-4.25.1 → kerykeion-4.25.3}/kerykeion/kr_types/kerykeion_exception.py +0 -0
- {kerykeion-4.25.1 → kerykeion-4.25.3}/kerykeion/kr_types/kr_literals.py +0 -0
- {kerykeion-4.25.1 → kerykeion-4.25.3}/kerykeion/kr_types/kr_models.py +0 -0
- {kerykeion-4.25.1 → kerykeion-4.25.3}/kerykeion/relationship_score/__init__.py +0 -0
- {kerykeion-4.25.1 → kerykeion-4.25.3}/kerykeion/relationship_score/relationship_score.py +0 -0
- {kerykeion-4.25.1 → kerykeion-4.25.3}/kerykeion/relationship_score/relationship_score_factory.py +0 -0
- {kerykeion-4.25.1 → kerykeion-4.25.3}/kerykeion/report.py +0 -0
- {kerykeion-4.25.1 → kerykeion-4.25.3}/kerykeion/settings/__init__.py +0 -0
- {kerykeion-4.25.1 → kerykeion-4.25.3}/kerykeion/settings/config_constants.py +0 -0
- {kerykeion-4.25.1 → kerykeion-4.25.3}/kerykeion/settings/kerykeion_settings.py +0 -0
- {kerykeion-4.25.1 → kerykeion-4.25.3}/kerykeion/sweph/README.md +0 -0
- {kerykeion-4.25.1 → kerykeion-4.25.3}/kerykeion/sweph/seas_18.se1 +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: kerykeion
|
|
3
|
-
Version: 4.25.
|
|
3
|
+
Version: 4.25.3
|
|
4
4
|
Summary: A python library for astrology.
|
|
5
5
|
Home-page: https://www.kerykeion.net/
|
|
6
6
|
License: AGPL-3.0
|
|
@@ -39,24 +39,16 @@ Description-Content-Type: text/markdown
|
|
|
39
39
|
|
|
40
40
|
<h1 align=center>Kerykeion</h1>
|
|
41
41
|
<div align="center">
|
|
42
|
-
<a href="#">
|
|
43
|
-
<img src="https://img.shields.io/github/contributors/g-battaglia/kerykeion?color=blue&logo=github" alt="contributors">
|
|
44
|
-
</a>
|
|
45
|
-
<a href="#">
|
|
46
42
|
<img src="https://img.shields.io/github/stars/g-battaglia/kerykeion.svg?logo=github" alt="stars">
|
|
47
|
-
</a>
|
|
48
|
-
<a href="#">
|
|
49
43
|
<img src="https://img.shields.io/github/forks/g-battaglia/kerykeion.svg?logo=github" alt="forks">
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
44
|
+
|
|
45
|
+
</div>
|
|
46
|
+
<div align="center">
|
|
47
|
+
<img src="https://static.pepy.tech/badge/kerykeion/month" alt="PyPI Downloads">
|
|
48
|
+
<img src="https://static.pepy.tech/badge/kerykeion/week" alt="PyPI Downloads">
|
|
49
|
+
<img src="https://img.shields.io/github/contributors/g-battaglia/kerykeion?color=blue&logo=github" alt="contributors">
|
|
55
50
|
<img src="https://img.shields.io/pypi/v/kerykeion?label=pypi%20package" alt="Package version">
|
|
56
|
-
</a>
|
|
57
|
-
<a href="https://pypi.org/project/kerykeion" target="_blank">
|
|
58
51
|
<img src="https://img.shields.io/pypi/pyversions/kerykeion.svg" alt="Supported Python versions">
|
|
59
|
-
</a>
|
|
60
52
|
</div>
|
|
61
53
|
|
|
62
54
|
|
|
@@ -174,6 +166,38 @@ synastry_chart.makeSVG()
|
|
|
174
166
|
|
|
175
167
|

|
|
176
168
|
|
|
169
|
+
|
|
170
|
+
### Transit Chart
|
|
171
|
+
|
|
172
|
+
```python
|
|
173
|
+
from kerykeion import AstrologicalSubject
|
|
174
|
+
|
|
175
|
+
transit = AstrologicalSubject("Transit", 2025, 6, 8, 8, 45, "Atlanta", "US")
|
|
176
|
+
subject = AstrologicalSubject("John Lennon", 1940, 10, 9, 18, 30, "Liverpool", "GB")
|
|
177
|
+
|
|
178
|
+
transit_chart = KerykeionChartSVG(subject, "Transit", transit)
|
|
179
|
+
transit_chart.makeSVG()
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+

|
|
183
|
+
|
|
184
|
+
### Composite Chart
|
|
185
|
+
|
|
186
|
+
```python
|
|
187
|
+
from kerykeion import CompositeSubjectFactory, AstrologicalSubject, KerykeionChartSVG
|
|
188
|
+
|
|
189
|
+
angelina = AstrologicalSubject("Angelina Jolie", 1975, 6, 4, 9, 9, "Los Angeles", "US", lng=-118.15, lat=34.03, tz_str="America/Los_Angeles")
|
|
190
|
+
brad = AstrologicalSubject("Brad Pitt", 1963, 12, 18, 6, 31, "Shawnee", "US", lng=-96.56, lat=35.20, tz_str="America/Chicago")
|
|
191
|
+
|
|
192
|
+
composite_subject_factory = CompositeSubjectFactory(angelina, brad)
|
|
193
|
+
composite_subject_model = composite_subject_factory.get_midpoint_composite_subject_model()
|
|
194
|
+
|
|
195
|
+
composite_chart = KerykeionChartSVG(composite_subject_model, "Composite")
|
|
196
|
+
composite_chart.makeSVG()
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+

|
|
200
|
+
|
|
177
201
|
### Change the output directory
|
|
178
202
|
|
|
179
203
|
By default the output directory is the home directory, you can change it by passing the new_output_directory parameter to the KerykeionChartSVG class:
|
|
@@ -1,23 +1,15 @@
|
|
|
1
1
|
<h1 align=center>Kerykeion</h1>
|
|
2
2
|
<div align="center">
|
|
3
|
-
<a href="#">
|
|
4
|
-
<img src="https://img.shields.io/github/contributors/g-battaglia/kerykeion?color=blue&logo=github" alt="contributors">
|
|
5
|
-
</a>
|
|
6
|
-
<a href="#">
|
|
7
3
|
<img src="https://img.shields.io/github/stars/g-battaglia/kerykeion.svg?logo=github" alt="stars">
|
|
8
|
-
</a>
|
|
9
|
-
<a href="#">
|
|
10
4
|
<img src="https://img.shields.io/github/forks/g-battaglia/kerykeion.svg?logo=github" alt="forks">
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
5
|
+
|
|
6
|
+
</div>
|
|
7
|
+
<div align="center">
|
|
8
|
+
<img src="https://static.pepy.tech/badge/kerykeion/month" alt="PyPI Downloads">
|
|
9
|
+
<img src="https://static.pepy.tech/badge/kerykeion/week" alt="PyPI Downloads">
|
|
10
|
+
<img src="https://img.shields.io/github/contributors/g-battaglia/kerykeion?color=blue&logo=github" alt="contributors">
|
|
16
11
|
<img src="https://img.shields.io/pypi/v/kerykeion?label=pypi%20package" alt="Package version">
|
|
17
|
-
</a>
|
|
18
|
-
<a href="https://pypi.org/project/kerykeion" target="_blank">
|
|
19
12
|
<img src="https://img.shields.io/pypi/pyversions/kerykeion.svg" alt="Supported Python versions">
|
|
20
|
-
</a>
|
|
21
13
|
</div>
|
|
22
14
|
|
|
23
15
|
|
|
@@ -135,6 +127,38 @@ synastry_chart.makeSVG()
|
|
|
135
127
|
|
|
136
128
|

|
|
137
129
|
|
|
130
|
+
|
|
131
|
+
### Transit Chart
|
|
132
|
+
|
|
133
|
+
```python
|
|
134
|
+
from kerykeion import AstrologicalSubject
|
|
135
|
+
|
|
136
|
+
transit = AstrologicalSubject("Transit", 2025, 6, 8, 8, 45, "Atlanta", "US")
|
|
137
|
+
subject = AstrologicalSubject("John Lennon", 1940, 10, 9, 18, 30, "Liverpool", "GB")
|
|
138
|
+
|
|
139
|
+
transit_chart = KerykeionChartSVG(subject, "Transit", transit)
|
|
140
|
+
transit_chart.makeSVG()
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+

|
|
144
|
+
|
|
145
|
+
### Composite Chart
|
|
146
|
+
|
|
147
|
+
```python
|
|
148
|
+
from kerykeion import CompositeSubjectFactory, AstrologicalSubject, KerykeionChartSVG
|
|
149
|
+
|
|
150
|
+
angelina = AstrologicalSubject("Angelina Jolie", 1975, 6, 4, 9, 9, "Los Angeles", "US", lng=-118.15, lat=34.03, tz_str="America/Los_Angeles")
|
|
151
|
+
brad = AstrologicalSubject("Brad Pitt", 1963, 12, 18, 6, 31, "Shawnee", "US", lng=-96.56, lat=35.20, tz_str="America/Chicago")
|
|
152
|
+
|
|
153
|
+
composite_subject_factory = CompositeSubjectFactory(angelina, brad)
|
|
154
|
+
composite_subject_model = composite_subject_factory.get_midpoint_composite_subject_model()
|
|
155
|
+
|
|
156
|
+
composite_chart = KerykeionChartSVG(composite_subject_model, "Composite")
|
|
157
|
+
composite_chart.makeSVG()
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+

|
|
161
|
+
|
|
138
162
|
### Change the output directory
|
|
139
163
|
|
|
140
164
|
By default the output directory is the home directory, you can change it by passing the new_output_directory parameter to the KerykeionChartSVG class:
|
|
@@ -185,12 +185,24 @@ class KerykeionChartSVG:
|
|
|
185
185
|
self.t_user = second_obj
|
|
186
186
|
|
|
187
187
|
# Aspects
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
188
|
+
if self.chart_type == "Transit":
|
|
189
|
+
synastry_aspects_instance = SynastryAspects(
|
|
190
|
+
self.t_user,
|
|
191
|
+
self.user,
|
|
192
|
+
new_settings_file=self.new_settings_file,
|
|
193
|
+
active_points=active_points,
|
|
194
|
+
active_aspects=active_aspects,
|
|
195
|
+
)
|
|
196
|
+
|
|
197
|
+
else:
|
|
198
|
+
synastry_aspects_instance = SynastryAspects(
|
|
199
|
+
self.user,
|
|
200
|
+
self.t_user,
|
|
201
|
+
new_settings_file=self.new_settings_file,
|
|
202
|
+
active_points=active_points,
|
|
203
|
+
active_aspects=active_aspects,
|
|
204
|
+
)
|
|
205
|
+
|
|
194
206
|
self.aspects_list = synastry_aspects_instance.relevant_aspects
|
|
195
207
|
|
|
196
208
|
self.t_available_kerykeion_celestial_points = []
|
|
@@ -432,7 +444,13 @@ class KerykeionChartSVG:
|
|
|
432
444
|
template_dict['third_circle'] = draw_third_circle(self.main_radius, self.chart_colors_settings['zodiac_transit_ring_0'], self.chart_colors_settings['paper_1'], self.chart_type, self.third_circle_radius)
|
|
433
445
|
|
|
434
446
|
if self.double_chart_aspect_grid_type == "list":
|
|
435
|
-
|
|
447
|
+
title = ""
|
|
448
|
+
if self.chart_type == "Synastry":
|
|
449
|
+
title = self.language_settings.get("couple_aspects", "Couple Aspects")
|
|
450
|
+
else:
|
|
451
|
+
title = self.language_settings.get("transit_aspects", "Transit Aspects")
|
|
452
|
+
|
|
453
|
+
template_dict["makeAspectGrid"] = draw_transit_aspect_list(title, self.aspects_list, self.planets_settings, self.aspects_settings)
|
|
436
454
|
else:
|
|
437
455
|
template_dict["makeAspectGrid"] = draw_transit_aspect_grid(self.chart_colors_settings['paper_0'], self.available_planets_setting, self.aspects_list, 550, 450)
|
|
438
456
|
|
|
@@ -8,7 +8,8 @@ from kerykeion.utilities import (
|
|
|
8
8
|
get_kerykeion_point_from_degree,
|
|
9
9
|
get_planet_house,
|
|
10
10
|
circular_mean,
|
|
11
|
-
calculate_moon_phase
|
|
11
|
+
calculate_moon_phase,
|
|
12
|
+
circular_sort
|
|
12
13
|
)
|
|
13
14
|
|
|
14
15
|
|
|
@@ -132,17 +133,22 @@ class CompositeSubjectFactory:
|
|
|
132
133
|
house_degree_list_ut = []
|
|
133
134
|
for house in self.first_subject.houses_names_list:
|
|
134
135
|
house_lower = house.lower()
|
|
135
|
-
|
|
136
|
+
house_degree_list_ut.append(
|
|
136
137
|
circular_mean(
|
|
137
138
|
self.first_subject[house_lower]["abs_pos"],
|
|
138
139
|
self.second_subject[house_lower]["abs_pos"]
|
|
139
|
-
)
|
|
140
|
-
|
|
140
|
+
)
|
|
141
|
+
)
|
|
142
|
+
house_degree_list_ut = circular_sort(house_degree_list_ut)
|
|
143
|
+
|
|
144
|
+
for house_index, house_name in enumerate(self.first_subject.houses_names_list):
|
|
145
|
+
house_lower = house_name.lower()
|
|
146
|
+
self[house_lower] = get_kerykeion_point_from_degree(
|
|
147
|
+
house_degree_list_ut[house_index],
|
|
148
|
+
house_name,
|
|
141
149
|
"House"
|
|
142
150
|
)
|
|
143
|
-
house_degree_list_ut.append(self[house_lower]["abs_pos"])
|
|
144
151
|
|
|
145
|
-
house_degree_list_ut = sorted(house_degree_list_ut)
|
|
146
152
|
|
|
147
153
|
# Planets
|
|
148
154
|
common_planets = []
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
"and_word": "and",
|
|
17
17
|
"transits": "Transits for",
|
|
18
18
|
"type": "Type",
|
|
19
|
-
"
|
|
19
|
+
"couple_aspects": "Couple aspects",
|
|
20
|
+
"transit_aspects": "Transit aspects",
|
|
20
21
|
"planets_and_house": "Points for",
|
|
21
22
|
"transit_name": "At the time of the transit",
|
|
22
23
|
"lunar_phase": "Lunar phase",
|
|
@@ -111,7 +112,8 @@
|
|
|
111
112
|
"and_word": "et",
|
|
112
113
|
"transits": "Transites pour",
|
|
113
114
|
"type": "Type",
|
|
114
|
-
"
|
|
115
|
+
"couple_aspects": "Les aspects",
|
|
116
|
+
"transit_aspects": "Les aspects de transit",
|
|
115
117
|
"planets_and_house": "Points pour",
|
|
116
118
|
"transit_name": "Au moment de la transition",
|
|
117
119
|
"lunar_phase": "Phase Lunaire",
|
|
@@ -206,7 +208,8 @@
|
|
|
206
208
|
"and_word": "e",
|
|
207
209
|
"transits": "Trânsitos para",
|
|
208
210
|
"type": "Tipo",
|
|
209
|
-
"
|
|
211
|
+
"couple_aspects": "Aspectos do casal",
|
|
212
|
+
"transit_aspects": "Aspectos do trânsito",
|
|
210
213
|
"planets_and_house": "Pontos para",
|
|
211
214
|
"transit_name": "No momento do trânsito",
|
|
212
215
|
"lunar_phase": "Fase lunar",
|
|
@@ -301,7 +304,8 @@
|
|
|
301
304
|
"and_word": "e",
|
|
302
305
|
"transits": "Transiti per",
|
|
303
306
|
"type": "Tipo",
|
|
304
|
-
"
|
|
307
|
+
"couple_aspects": "Aspetti di coppia",
|
|
308
|
+
"transit_aspects": "Aspetti di transito",
|
|
305
309
|
"planets_and_house": "Punti per",
|
|
306
310
|
"transit_name": "Al momento del transito",
|
|
307
311
|
"lunar_phase": "Fase lunare",
|
|
@@ -396,7 +400,8 @@
|
|
|
396
400
|
"and_word": "與",
|
|
397
401
|
"transits": "流年合盤",
|
|
398
402
|
"type": "盤型",
|
|
399
|
-
"
|
|
403
|
+
"couple_aspects": "相位",
|
|
404
|
+
"transit_aspects": "流年相位",
|
|
400
405
|
"planets_and_house": "行星 與 宫位",
|
|
401
406
|
"transit_name": "流年名稱",
|
|
402
407
|
"lunar_phase": "月相",
|
|
@@ -491,7 +496,8 @@
|
|
|
491
496
|
"and_word": "y",
|
|
492
497
|
"transits": "Tránsitos para",
|
|
493
498
|
"type": "Tipo",
|
|
494
|
-
"
|
|
499
|
+
"couple_aspects": "Aspectos de la pareja",
|
|
500
|
+
"transit_aspects": "Aspectos de tránsito",
|
|
495
501
|
"planets_and_house": "Puntos para",
|
|
496
502
|
"transit_name": "En el momento del tránsito",
|
|
497
503
|
"lunar_phase": "Fase lunar",
|
|
@@ -586,7 +592,8 @@
|
|
|
586
592
|
"and_word": "и",
|
|
587
593
|
"transits": "Транзиты для",
|
|
588
594
|
"type": "Тип",
|
|
589
|
-
"
|
|
595
|
+
"couple_aspects": "Аспекты пары",
|
|
596
|
+
"transit_aspects": "Транзитные аспекты",
|
|
590
597
|
"planets_and_house": "Пункты для",
|
|
591
598
|
"transit_name": "В момент транзита",
|
|
592
599
|
"lunar_phase": "Лунная фаза",
|
|
@@ -681,7 +688,8 @@
|
|
|
681
688
|
"and_word": "ve",
|
|
682
689
|
"transits": "Geçişler için",
|
|
683
690
|
"type": "Tür",
|
|
684
|
-
"
|
|
691
|
+
"couple_aspects": "Çiftin Açılar",
|
|
692
|
+
"transit_aspects": "Geçiş Açıları",
|
|
685
693
|
"planets_and_house": "Puanlar için",
|
|
686
694
|
"transit_name": "Geçiş anında",
|
|
687
695
|
"lunar_phase": "Ay Aşaması",
|
|
@@ -776,7 +784,8 @@
|
|
|
776
784
|
"and_word": "und",
|
|
777
785
|
"transits": "Transite für",
|
|
778
786
|
"type": "Typ",
|
|
779
|
-
"
|
|
787
|
+
"couple_aspects": "Aspekte des Paares",
|
|
788
|
+
"transit_aspects": "Transitaspekte",
|
|
780
789
|
"planets_and_house": "Punkte für",
|
|
781
790
|
"transit_name": "Zum Zeitpunkt des Transits",
|
|
782
791
|
"lunar_phase": "Mondphase",
|
|
@@ -871,7 +880,8 @@
|
|
|
871
880
|
"and_word": "और",
|
|
872
881
|
"transits": "गोचर के लिए",
|
|
873
882
|
"type": "प्रकार",
|
|
874
|
-
"
|
|
883
|
+
"couple_aspects": "जोड़ी के पहलू",
|
|
884
|
+
"transit_aspects": "गोचर के पहलू",
|
|
875
885
|
"planets_and_house": "अंक के लिए",
|
|
876
886
|
"transit_name": "गोचर के समय",
|
|
877
887
|
"lunar_phase": "चंद्र चरण",
|
|
@@ -390,3 +390,53 @@ def calculate_moon_phase(moon_abs_pos: float, sun_abs_pos: float) -> LunarPhaseM
|
|
|
390
390
|
}
|
|
391
391
|
|
|
392
392
|
return LunarPhaseModel(**lunar_phase_dictionary)
|
|
393
|
+
|
|
394
|
+
|
|
395
|
+
def circular_sort(degrees: list[Union[int, float]]) -> list[Union[int, float]]:
|
|
396
|
+
"""
|
|
397
|
+
Sort a list of degrees in a circular manner, starting from the first element
|
|
398
|
+
and progressing clockwise around the circle.
|
|
399
|
+
|
|
400
|
+
Args:
|
|
401
|
+
degrees: A list of numeric values representing degrees
|
|
402
|
+
|
|
403
|
+
Returns:
|
|
404
|
+
A list sorted based on circular clockwise progression from the first element
|
|
405
|
+
|
|
406
|
+
Raises:
|
|
407
|
+
ValueError: If the list is empty or contains non-numeric values
|
|
408
|
+
"""
|
|
409
|
+
# Input validation
|
|
410
|
+
if not degrees:
|
|
411
|
+
raise ValueError("Input list cannot be empty")
|
|
412
|
+
|
|
413
|
+
if not all(isinstance(degree, (int, float)) for degree in degrees):
|
|
414
|
+
invalid = next(d for d in degrees if not isinstance(d, (int, float)))
|
|
415
|
+
raise ValueError(f"All elements must be numeric, found: {invalid} of type {type(invalid).__name__}")
|
|
416
|
+
|
|
417
|
+
# If list has 0 or 1 element, return it as is
|
|
418
|
+
if len(degrees) <= 1:
|
|
419
|
+
return degrees.copy()
|
|
420
|
+
|
|
421
|
+
# Save the first element as the reference
|
|
422
|
+
reference = degrees[0]
|
|
423
|
+
|
|
424
|
+
# Define a function to calculate clockwise distance from reference
|
|
425
|
+
def clockwise_distance(angle: Union[int, float]) -> Union[int, float]:
|
|
426
|
+
# Normalize angles to 0-360 range
|
|
427
|
+
ref_norm = reference % 360
|
|
428
|
+
angle_norm = angle % 360
|
|
429
|
+
|
|
430
|
+
# Calculate clockwise distance
|
|
431
|
+
distance = angle_norm - ref_norm
|
|
432
|
+
if distance < 0:
|
|
433
|
+
distance += 360
|
|
434
|
+
|
|
435
|
+
return distance
|
|
436
|
+
|
|
437
|
+
# Sort the rest of the elements based on circular distance
|
|
438
|
+
remaining = degrees[1:]
|
|
439
|
+
sorted_remaining = sorted(remaining, key=clockwise_distance)
|
|
440
|
+
|
|
441
|
+
# Return the reference followed by the sorted remaining elements
|
|
442
|
+
return [reference] + sorted_remaining
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{kerykeion-4.25.1 → kerykeion-4.25.3}/kerykeion/relationship_score/relationship_score_factory.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|