Ascendant

Configuration

Choose Ascendant's ayanamsa and house system with explicit, typed, reproducible defaults.

ascendant.configuration owns the process-wide defaults used when a new Ascendant instance does not receive an explicit ayanamsa or house system. The configuration is one frozen AscendantConfig; calling configure() replaces that complete value.

Configure new instances

from ascendant import (
    AscendantConfig,
    Ayanamsa,
    HouseSystem,
    configure,
)

config = AscendantConfig(
    ayanamsa=Ayanamsa.RAMAN,
    house_system=HouseSystem.PORPHYRY,
)
configure(config)

AscendantConfig is frozen and slotted. Its fields accept enum members, not arbitrary strings. Passing a dictionary or another object to configure() raises TypeError; passing strings into AscendantConfig also raises TypeError.

The built-in value is equivalent to:

AscendantConfig(
    ayanamsa=Ayanamsa.LAHIRI,
    house_system=HouseSystem.WHOLE_SIGN,
)

Read and reset the configuration

from ascendant import get_config, reset_config

current = get_config()
print(current.ayanamsa)
print(current.house_system)

reset_config()

get_config() returns the current immutable object. reset_config() replaces it with a new default AscendantConfig, restoring Lahiri and Whole Sign. Reads and replacements are protected by a lock, so callers do not observe a partially changed configuration.

How an instance resolves its settings

When you construct a chart without explicit calculation settings, it reads the current application configuration:

from ascendant import Ascendant

astro = Ascendant(
    year=1990,
    month=1,
    day=1,
    hour=12,
    minute=0,
    second=0,
    latitude=28.6139,
    longitude=77.2090,
    utc="+5:30",
)

The effective precedence is:

  1. Explicit Ascendant(...) arguments
  2. The current value installed by configure()
  3. AscendantConfig() defaults

An existing instance keeps the resolved values stored in its horoscope_data. Later calls to configure() affect only instances created after the replacement.

Override one instance

The Ascendant constructor accepts enum members:

from ascendant import Ascendant, Ayanamsa, HouseSystem

astro = Ascendant(
    year=1990,
    month=1,
    day=1,
    hour=12,
    minute=0,
    second=0,
    latitude=28.6139,
    longitude=77.2090,
    utc="+5:30",
    ayanamsa=Ayanamsa.KRISHNAMURTI,
    house_system=HouseSystem.PLACIDUS,
)

It also accepts supported strings at this constructor boundary:

astro = Ascendant(
    year=1990,
    month=1,
    day=1,
    hour=12,
    minute=0,
    second=0,
    latitude=28.6139,
    longitude=77.2090,
    utc="+5:30",
    ayanamsa="raman",
    house_system="equal_2",
)

Ayanamsa strings are matched case-insensitively against their exact values. House-system strings are stripped, underscores become spaces, and comparison is case-insensitive. For example, "equal_2" resolves to HouseSystem.EQUAL_2. Unsupported strings raise ValueError while the instance is being constructed.

Ayanamsa

MemberValue
Ayanamsa.LAHIRILahiri
Ayanamsa.LAHIRI_1940Lahiri_1940
Ayanamsa.LAHIRI_VP285Lahiri_VP285
Ayanamsa.LAHIRI_ICRCLahiri_ICRC
Ayanamsa.RAMANRaman
Ayanamsa.KRISHNAMURTIKrishnamurti
Ayanamsa.KRISHNAMURTI_SENTHILATHIBANKrishnamurti_Senthilathiban

HouseSystem

MemberValueSwiss Ephemeris code
HouseSystem.WHOLE_SIGNWhole SignW
HouseSystem.PLACIDUSPlacidusP
HouseSystem.EQUALEqualA
HouseSystem.EQUAL_2Equal 2E
HouseSystem.PORPHYRYPorphyryO

Ascendant maps these enums to Swiss Ephemeris in horoscope.py. Swiss Ephemeris documents its sidereal modes and house methods.

Current chart-output boundary

The selected house-system code is used when Swiss Ephemeris calculates cusps and angles. The current public get_chart() result still places one complete sign in each numbered house from the rising sign and does not expose cusp longitudes. In this release, a non-Whole-Sign setting changes the underlying cusp calculation but not public get_chart() planet-to-house membership.

Reproducibility

Store the resolved enum values with the birth timezone, coordinates, and software version. When comparing two results, confirm those values before investigating a difference in the calculated chart.

On this page