aamanlamba commited on
Commit
06b88ae
·
verified ·
1 Parent(s): 995a2fd

Fix dignity calculation: add detriment and fall (Venus in Aries now correctly shows detriment)

Browse files
Files changed (1) hide show
  1. app.py +63 -8
app.py CHANGED
@@ -34,6 +34,28 @@ EXALTATIONS = {
34
  "Capricorn": "Mars", "Aquarius": None, "Pisces": "Venus"
35
  }
36
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  TRIPLICITIES = {
38
  "Fire": {"day": "Sun", "night": "Jupiter", "participating": "Saturn"},
39
  "Earth": {"day": "Venus", "night": "Moon", "participating": "Mars"},
@@ -149,6 +171,7 @@ def assess_planetary_dignity(planet: str, sign: str, is_day_chart: bool) -> str:
149
  """Assess a planet's essential dignity in a given sign"""
150
  dignity_score = 0
151
  dignities = []
 
152
 
153
  # Check domicile (+5)
154
  if DOMICILE_RULERS.get(sign) == planet:
@@ -174,7 +197,28 @@ def assess_planetary_dignity(planet: str, sign: str, is_day_chart: bool) -> str:
174
  dignity_score += 3
175
  dignities.append("Triplicity Ruler - Participating (+3)")
176
 
177
- condition = "Strong" if dignity_score >= 4 else "Moderate" if dignity_score > 0 else "Peregrine"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
178
  chart_type = "Day Chart" if is_day_chart else "Night Chart"
179
 
180
  # Format as readable text
@@ -190,7 +234,12 @@ def assess_planetary_dignity(planet: str, sign: str, is_day_chart: bool) -> str:
190
  for dignity in dignities:
191
  result += f"✓ {dignity}\n"
192
  else:
193
- result += " No essential dignities (Peregrine)\n"
 
 
 
 
 
194
 
195
  result += f"""
196
  **Total Dignity Score:** {dignity_score} points
@@ -198,14 +247,20 @@ def assess_planetary_dignity(planet: str, sign: str, is_day_chart: bool) -> str:
198
 
199
  ### Interpretation:
200
  """
201
- if dignity_score >= 5:
 
 
 
 
 
 
 
 
 
 
202
  result += f"{planet} is very well-placed in {sign}, having its domicile or maximum dignity. The planet can act with full strength and autonomy."
203
- elif dignity_score >= 4:
204
- result += f"{planet} is strong in {sign}, with significant essential dignity. The planet functions well and can express its significations effectively."
205
- elif dignity_score > 0:
206
- result += f"{planet} has moderate dignity in {sign}. The planet has some support but is not at full strength."
207
  else:
208
- result += f"{planet} is peregrine in {sign}, having no essential dignity. The planet is like a stranger in a foreign land and may struggle to act effectively."
209
 
210
  return result
211
 
 
34
  "Capricorn": "Mars", "Aquarius": None, "Pisces": "Venus"
35
  }
36
 
37
+ # Detriments (opposite sign of domicile rulership)
38
+ DETRIMENTS = {
39
+ "Sun": ["Aquarius"],
40
+ "Moon": ["Capricorn"],
41
+ "Mercury": ["Sagittarius", "Pisces"],
42
+ "Venus": ["Aries", "Scorpio"],
43
+ "Mars": ["Taurus", "Libra"],
44
+ "Jupiter": ["Gemini", "Virgo"],
45
+ "Saturn": ["Cancer", "Leo"]
46
+ }
47
+
48
+ # Falls (opposite sign of exaltation)
49
+ FALLS = {
50
+ "Sun": ["Libra"],
51
+ "Moon": ["Scorpio"],
52
+ "Mercury": ["Pisces"],
53
+ "Venus": ["Virgo"],
54
+ "Mars": ["Cancer"],
55
+ "Jupiter": ["Capricorn"],
56
+ "Saturn": ["Aries"]
57
+ }
58
+
59
  TRIPLICITIES = {
60
  "Fire": {"day": "Sun", "night": "Jupiter", "participating": "Saturn"},
61
  "Earth": {"day": "Venus", "night": "Moon", "participating": "Mars"},
 
171
  """Assess a planet's essential dignity in a given sign"""
172
  dignity_score = 0
173
  dignities = []
174
+ debilities = []
175
 
176
  # Check domicile (+5)
177
  if DOMICILE_RULERS.get(sign) == planet:
 
197
  dignity_score += 3
198
  dignities.append("Triplicity Ruler - Participating (+3)")
199
 
200
+ # Check detriment (-5)
201
+ if sign in DETRIMENTS.get(planet, []):
202
+ dignity_score -= 5
203
+ debilities.append("Detriment (-5)")
204
+
205
+ # Check fall (-4)
206
+ if sign in FALLS.get(planet, []):
207
+ dignity_score -= 4
208
+ debilities.append("Fall (-4)")
209
+
210
+ # Determine condition based on score
211
+ if dignity_score <= -4:
212
+ condition = "Debilitated"
213
+ elif dignity_score < 0:
214
+ condition = "Weak"
215
+ elif dignity_score == 0:
216
+ condition = "Peregrine (no essential dignity)"
217
+ elif dignity_score <= 3:
218
+ condition = "Minor Dignity"
219
+ else:
220
+ condition = "Strong"
221
+
222
  chart_type = "Day Chart" if is_day_chart else "Night Chart"
223
 
224
  # Format as readable text
 
234
  for dignity in dignities:
235
  result += f"✓ {dignity}\n"
236
  else:
237
+ result += " No major dignities\n"
238
+
239
+ if debilities:
240
+ result += "\n### Debilities:\n"
241
+ for debility in debilities:
242
+ result += f"✗ {debility}\n"
243
 
244
  result += f"""
245
  **Total Dignity Score:** {dignity_score} points
 
247
 
248
  ### Interpretation:
249
  """
250
+ if dignity_score <= -5:
251
+ result += f"{planet} is severely debilitated in {sign}, being in detriment. The planet struggles to express its nature and may act contrary to its essential significations."
252
+ elif dignity_score == -4:
253
+ result += f"{planet} is in fall in {sign}, a position of weakness. The planet cannot act with full strength and may produce difficult outcomes."
254
+ elif dignity_score < 0:
255
+ result += f"{planet} is weakened in {sign} with mixed conditions. The debilities outweigh any minor dignities present."
256
+ elif dignity_score == 0:
257
+ result += f"{planet} is peregrine in {sign}, having no essential dignity. The planet is like a stranger in a foreign land, neither particularly strong nor weak, but without support."
258
+ elif dignity_score <= 3:
259
+ result += f"{planet} has minor dignity in {sign}. The planet has some support but is not at full strength."
260
+ elif dignity_score >= 5:
261
  result += f"{planet} is very well-placed in {sign}, having its domicile or maximum dignity. The planet can act with full strength and autonomy."
 
 
 
 
262
  else:
263
+ result += f"{planet} is strong in {sign}, with significant essential dignity. The planet functions well and can express its significations effectively."
264
 
265
  return result
266