Spaces:
Sleeping
Sleeping
Update astro_core.py
Browse files- astro_core.py +4 -10
astro_core.py
CHANGED
|
@@ -1,9 +1,3 @@
|
|
| 1 |
-
# astro_core.py
|
| 2 |
-
"""
|
| 3 |
-
Core astrology calculation module.
|
| 4 |
-
Handles birth chart calculations using flatlib.
|
| 5 |
-
"""
|
| 6 |
-
|
| 7 |
from datetime import datetime, timedelta
|
| 8 |
import zoneinfo # Use zoneinfo instead of pytz
|
| 9 |
from typing import Dict, Any
|
|
@@ -69,15 +63,15 @@ class ChartCalculator:
|
|
| 69 |
birth_datetime = birth_datetime.replace(tzinfo=tz)
|
| 70 |
|
| 71 |
# Get UTC offset in hours
|
| 72 |
-
utc_offset = birth_datetime.utcoffset().total_seconds() / 3600
|
| 73 |
|
| 74 |
# Extract date and time components (adjust time for UTC)
|
| 75 |
adjusted_datetime = birth_datetime - timedelta(hours=utc_offset)
|
| 76 |
date_str = adjusted_datetime.strftime('%Y/%m/%d')
|
| 77 |
time_str = adjusted_datetime.strftime('%H:%M')
|
| 78 |
|
| 79 |
-
# Convert to flatlib datetime (using UTC)
|
| 80 |
-
date = Datetime(date_str, time_str,
|
| 81 |
pos = GeoPos(latitude, longitude)
|
| 82 |
|
| 83 |
# Calculate chart
|
|
@@ -156,4 +150,4 @@ class ChartCalculator:
|
|
| 156 |
def get_planet_aspects(self, chart_data: Dict[str, Any]) -> Dict[str, list]:
|
| 157 |
"""Calculate major aspects between planets"""
|
| 158 |
# TODO: Implement aspect calculation using flatlib
|
| 159 |
-
return {}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
from datetime import datetime, timedelta
|
| 2 |
import zoneinfo # Use zoneinfo instead of pytz
|
| 3 |
from typing import Dict, Any
|
|
|
|
| 63 |
birth_datetime = birth_datetime.replace(tzinfo=tz)
|
| 64 |
|
| 65 |
# Get UTC offset in hours
|
| 66 |
+
utc_offset = int(birth_datetime.utcoffset().total_seconds() / 3600)
|
| 67 |
|
| 68 |
# Extract date and time components (adjust time for UTC)
|
| 69 |
adjusted_datetime = birth_datetime - timedelta(hours=utc_offset)
|
| 70 |
date_str = adjusted_datetime.strftime('%Y/%m/%d')
|
| 71 |
time_str = adjusted_datetime.strftime('%H:%M')
|
| 72 |
|
| 73 |
+
# Convert to flatlib datetime (using UTC offset)
|
| 74 |
+
date = Datetime(date_str, time_str, utc_offset) # Pass numeric UTC offset here
|
| 75 |
pos = GeoPos(latitude, longitude)
|
| 76 |
|
| 77 |
# Calculate chart
|
|
|
|
| 150 |
def get_planet_aspects(self, chart_data: Dict[str, Any]) -> Dict[str, list]:
|
| 151 |
"""Calculate major aspects between planets"""
|
| 152 |
# TODO: Implement aspect calculation using flatlib
|
| 153 |
+
return {}
|