Releases: nseaSeb/green_cal
Release list
v0.1.1 — reworded description
Functionally identical to v0.1.0 — no code changes to the library.
Changed
The package description no longer lists "biodynamic cycles" alongside the astronomy, which read as an endorsement of the tradition rather than a description of what the library computes. It now leads with the verifiable ephemerides and attributes the declination cycle to the calendars that use it, matching the separation the README and the GreenCal moduledoc already draw.
Fixed (tests only)
Three over-constrained assumptions in the property tests, each caught by CI on a real day the library handles correctly:
- The apparent midnight sun starts near 65.7°, not at the Arctic circle (66.56°) — rise and set are defined at h₀ = −0.8333°, refraction plus semidiameter, not at the geometric horizon.
- A UTC civil day can hold two sunrises (
{-65.0, 123.75}on 2038-08-12), so total sunlight exceedsset − rise. - A UTC civil day can hold a sunset that precedes its sunrise (
{65.0, 180.0}on 2000-01-01), whereset − riseis negative and meaningless.
All three are now pinned by their own regression tests. The library was correct in every case; the properties were not. Verified across ten fixed seeds and thirty random ones.
95 tests and 5 properties, green on Elixir 1.15, 1.17 and 1.19.
v0.1.0 — first release
Agricultural sun & moon calendar for Elixir — pure arithmetic, zero runtime dependencies, no time zone database required unless you ask for local times.
From a geolocation, a date or a period and an optional elevation:
- Sun — rise, solar noon, set, time above the horizon, rise/set azimuths, civil / nautical / astronomical twilights
- Moon — rise, transit, set, phase, illuminated fraction, distance, declination
- The three independent lunar cycles agricultural calendars rely on, kept distinct: waxing/waning (illumination), ascending/descending (declination — the one biodynamic sowing calendars use), perigee/apogee (distance)
- Exact instants of everything a printed calendar marks with a symbol: phases (with an eclipse screening flag), perigees/apogees, node crossings, lunar standstills
- Constellations — equal-sector sidereal zodiac (Lahiri) by default, or the real unequal IAU boundaries with
boundaries: :iau, the convention printed biodynamic calendars use
Why it is built this way
Rise/set uses a numeric search, not the closed-form hour-angle formula: the latter assumes a constant declination and can be more than 15 minutes off for the Moon. Crossings shorter than the sampling step are caught by probing the culmination, so a 55-minute polar day is found rather than reported as polar night.
UT and TT are kept apart and converted in one place. ΔT uses observed IERS values over 2000–2026 (the Espenak & Meeus 2005–2050 branch overshoots by ~6 s in 2026), the polynomials before, and a documented extrapolation after.
Degenerate cases are reported, not faked — :always_above / :always_below, and a nil moonrise on the ~1 day per month the Moon does not rise.
Astronomy and tradition are labelled apart. Rise/set times, phases and declination trends are validated against published references; elements, organs and sowing days are presented as the tradition they are.
Validation
- Meeus, Astronomical Algorithms (2nd ed.), examples 7.1, 12.a/b, 22.a, 25.a, 28.b, 47.a — the complete chapter 47 tables reproduce 47.a to 0.13″ in longitude and 0.03 km in distance
- USNO rise/set API for moonrise/moonset at Paris, Sydney and Edinburgh — within 30 s, their own rounding
- Published 2026 phase instants; all four 2026 eclipses found by the screening flag, no false positive over the year
- Property tests and physical invariants
94 tests and 5 properties, green on Elixir 1.15, 1.17 and 1.19.
Not yet on Hex — see CHANGELOG.md for the full entry.