klio 1.4.3 → 1.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "klio",
3
- "version": "1.4.3",
3
+ "version": "1.4.4",
4
4
  "description": "A CLI for astrological calculations",
5
5
  "main": "src/main.js",
6
6
  "bin": {
@@ -2544,19 +2544,16 @@ function calculateNextPlanetIngress(planetName, startDate = null, count = 1) {
2544
2544
  isMediumSlowPlanet ? 6 :
2545
2545
  1; // Daily for very slow, 6-hourly for medium, hourly for fast
2546
2546
 
2547
- // Maximum search window (in days)
2548
- // For very slow planets, we need to search much further ahead
2549
- // Saturn: ~2.5 years per sign, so for multiple ingresses we need ~5-10 years
2550
- // Jupiter: ~1 year per sign, so for multiple ingresses we need ~3-5 years
2551
- // Uranus: ~7 years per sign, so we need ~15-20 years
2552
- // Neptune: ~13.75 years per sign, so we need ~25-30 years
2553
- // Pluto: ~20.7 years per sign, so we need ~35-40 years
2554
- // For fast planets (Moon, Mercury, Venus, Mars, Sun), we need a reasonable window per ingress
2555
- const fastPlanets = ['moon', 'mercury', 'venus', 'mars', 'sun'];
2547
+ // Maximum search window (in days) - calculate based on planet and requested count
2548
+ // Mars: ~2 months per sign, so for multiple ingresses we need ~count * 60 days
2549
+ // Other fast planets (Moon, Mercury, Venus, Sun): 90 days is sufficient
2550
+ const fastPlanets = ['moon', 'mercury', 'venus', 'sun'];
2556
2551
  const isFastPlanet = fastPlanets.includes(planetName);
2552
+ const isMars = planetName === 'mars';
2557
2553
 
2558
2554
  const maxDays = isVerySlowPlanet ? 365 * 90 :
2559
2555
  isMediumSlowPlanet ? 365 * 90 :
2556
+ isMars ? Math.min(365 * 5, 90 * count) : // Mars: up to 5 years or count * 3 months
2560
2557
  isFastPlanet ? 90 : // 30 days for fast planets (enough for multiple moon ingresses)
2561
2558
  365 * 90; // Default for other planets
2562
2559
  const maxAttempts = maxDays * 24 / timeStepHours;
@@ -2599,15 +2596,18 @@ function calculateNextPlanetIngress(planetName, startDate = null, count = 1) {
2599
2596
  currentDate.setHours(currentDate.getHours() + 6); // Start 6 hours after ingress
2600
2597
  }
2601
2598
  } else {
2602
- const daysLimit = isVerySlowPlanet ? 365 * 40 :
2603
- isMediumSlowPlanet ? 365 * 5 :
2604
- isFastPlanet ? 30 :
2605
- 60;
2599
+ const daysLimit = isVerySlowPlanet ? 365 * 90 :
2600
+ isMediumSlowPlanet ? 365 * 90 :
2601
+ isMars ? Math.min(365 * 5, 90 * count) :
2602
+ isFastPlanet ? 90 :
2603
+ 365 * 90;
2606
2604
  console.log(`Could not find ${planetName} ingress to ${signs[targetSignIndex]} within ${daysLimit} days`);
2607
2605
  if (isVerySlowPlanet) {
2608
2606
  console.log(`💡 Note: For very slow planets like ${planetName}, the ephemeris data may not extend far enough into the future.`);
2609
2607
  } else if (isMediumSlowPlanet) {
2610
2608
  console.log(`💡 Note: For medium-slow planets like ${planetName}, the ephemeris data may not extend far enough into the future.`);
2609
+ } else if (isMars) {
2610
+ console.log(`💡 Note: For Mars, the requested number of ingresses may be too high for the current search window.`);
2611
2611
  } else {
2612
2612
  console.log(`💡 Note: For ${planetName}, the requested number of ingresses may be too high.`);
2613
2613
  }