Skip to content

Commit

Permalink
Fix for #136 and better Ayanamsa names
Browse files Browse the repository at this point in the history
  • Loading branch information
g-battaglia committed Dec 21, 2024
1 parent 545bcb5 commit a327aa4
Show file tree
Hide file tree
Showing 33 changed files with 748 additions and 90 deletions.
4 changes: 2 additions & 2 deletions kerykeion/astrological_subject.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def __init__(
#---------------#

# Geonames username
if geonames_username is None and online:
if geonames_username is None and online and (not lat or not lng or not tz_str):
logging.warning(GEONAMES_DEFAULT_USERNAME_WARNING)
self.geonames_username = DEFAULT_GEONAMES_USERNAME
else:
Expand Down Expand Up @@ -835,5 +835,5 @@ def get_from_iso_utc_time(
print(johnny.mean_lilith)

# Offline mode
johnny = AstrologicalSubject("Johnny Depp", 1963, 6, 9, 0, 0, "Owensboro", "US", online=False, tz_str="America/New_York", lng=-87.1111, lat=37.7711)
johnny = AstrologicalSubject("Johnny Depp", 1963, 6, 9, 0, 0, "Owensboro", "US", online=False, tz_str="America/New_York", lng=-87.1111, lat=37.7711, sidereal_mode="FAGAN_BRADLEY", zodiac_type="Sidereal")
print(johnny.json(dump=True, indent=2))
17 changes: 13 additions & 4 deletions kerykeion/charts/kerykeion_chart_svg.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@


import logging
import swisseph as swe
from typing import get_args

from kerykeion.settings.kerykeion_settings import get_settings
Expand Down Expand Up @@ -408,11 +409,19 @@ def _create_template_dictionary(self) -> ChartTemplateDictionary:
else:
template_dict["stringTitle"] = self.user.name

# Set bottom left corner information
template_dict["bottomLeft0"] = f"{self.user.zodiac_type if self.user.zodiac_type == 'Tropic' else str(self.user.zodiac_type) + ' ' + str(self.user.sidereal_mode)}"
template_dict["bottomLeft1"] = f"{self.user.houses_system_name}"
if self.user.zodiac_type == 'Tropic':
zodiac_info = "Tropical Zodiac"

else:
mode_const = "SIDM_" + self.user.sidereal_mode # type: ignore
mode_name = swe.get_ayanamsa_name(getattr(swe, mode_const))
zodiac_info = f"Ayanamsa: {mode_name}"

template_dict["bottomLeft0"] = f"{self.user.houses_system_name} Houses"
template_dict["bottomLeft1"] = zodiac_info

if self.chart_type in ["Natal", "ExternalNatal", "Synastry"]:
template_dict["bottomLeft2"] = f'{self.language_settings.get("lunar_phase", "Lunar Phase")}: {self.language_settings.get("day", "Day")} {self.user.lunar_phase.get("moon_phase", "")}'
template_dict["bottomLeft2"] = f'{self.language_settings.get("lunar_phase", "Lunar Phase")} {self.language_settings.get("day", "Day").lower()}: {self.user.lunar_phase.get("moon_phase", "")}'
template_dict["bottomLeft3"] = f'{self.language_settings.get("lunar_phase", "Lunar Phase")}: {self.user.lunar_phase.moon_phase_name}'
template_dict["bottomLeft4"] = f'{self.user.perspective_type}'
else:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "kerykeion"
version = "4.19.0"
version = "4.20.0"
authors = ["Giacomo Battaglia <[email protected]>"]
description = "A python library for astrology."
license = "AGPL-3.0"
Expand Down
6 changes: 3 additions & 3 deletions tests/charts/Albert Einstein - Natal Chart.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions tests/charts/Amitabh Bachchan - Natal Chart.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions tests/charts/Antonio Banderas - Natal Chart.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions tests/charts/Cristiano Ronaldo - Natal Chart.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions tests/charts/Hua Chenyu - Natal Chart.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions tests/charts/Jeanne Moreau - Natal Chart.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions tests/charts/John Lennon - DTS - Synastry Chart.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions tests/charts/John Lennon - Dark Theme - Natal Chart.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions tests/charts/John Lennon - ExternalNatal Chart.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions tests/charts/John Lennon - Heliocentric - Natal Chart.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit a327aa4

Please sign in to comment.