flatangle/flatlib

Make 'House._Offset' configurable. It's causing planets late in a house to fall into the next one.

Closed this issue · 2 comments

I'm encountering the issue that the statically defined House._Offset results in retrieving the wrong house position of a planet.

The problem appears, when I'm trying to retrieve the house position of a planet that is in the last degrees of a house. Then getHouse() will apply the _Offset and therefore cause the planet to fall into the next house.

An example (using Placidus house system):

Date: 2023/11/22
Time: 9:28 am
Location: Zurich, Switzerland
utc_offset: +01:00
lat: 47n22
lon: 8n32

Venus is in +15:35:13 Libra, in the 9th house
The 10th house cusp is in +18:00:23 Libra

But chart.getHouse(const.VENUS) will apply the hardcoded _OFFSET of -5.0 and return <House10 Libra +18:00:23 25.095990960970028>.

I've had to monkey patch this variable in my wrapper class, and manually set it to House._OFFSET = -0.0. But would prefer an upstream solution.

I can imagine why you implemented this.. some astrologers interpret planets late in a house as falling into the next house. And that's true but each astrologer defines that offset differently. And -5.0 is actually a lot in my experience.

Can you please make the house's _OFFSET configurable? I think that would serve everybody's needs best.

Hi @StephanRyatt, you're right regarding the use of the 5º for a planet to be considered as being in the next house. This is a traditional astrology library, and the 5º rule is consistent among many traditional astrology sources.

In the future I may add a settings.py file where every setting can be changed in one place, but it will work by monkey-patching the variables in that file, so monkey-patch it is.

You can consider everything in here as "sensible" defaults for traditional astrology. I'm mostly following William Lilly's methods. Everything you need to change, there is no problem with monkey patching the variables before using them. It is perfectly safe. And if you set House._OFFSET = 0, no strange side effects should occur in the functions that use it.

But if you set the offset to zero and you find any error on something that should work with the offset as zero, but assumes other value (hardcoded, for instance) open a new issue, and I'll check it out.

I'll close this issue for now, with the mention that everyone that needs to change the offset value, has to do something like the following (monkey-patch) before executing any other code.

from flatblib.object import House

House._OFFSET = 0.0

Hi @joaoventura. I understand re: traditional astrology. Yeah such a setting file would help and maybe mention it in the documentation. It took me quite a while to figure out what was going on.

I'll continue with setting House._OFFSET = -0.0 for now - it seems to function reliably so far.

Thank you @joaoventura for providing this library - what a tremendous service! I appreciate it.