feat(Q5): NOAA sunset calculator (stdlib only)

This commit is contained in:
Aaron D. Lee
2026-04-03 18:42:26 -04:00
parent a5dd15d0a1
commit e75a9a9d71
2 changed files with 49 additions and 0 deletions

18
tests/unit/test_solar.py Normal file
View File

@@ -0,0 +1,18 @@
import datetime
from vigilar.detection.solar import get_sunset
def test_sunset_returns_time():
result = get_sunset(45.0, -85.0, datetime.date(2026, 6, 21))
assert isinstance(result, datetime.time)
def test_sunset_equator():
result = get_sunset(0.0, 0.0, datetime.date(2026, 3, 20))
assert 17 <= result.hour <= 19
def test_sunset_different_dates_vary():
d1 = get_sunset(45.0, -85.0, datetime.date(2026, 3, 1))
d2 = get_sunset(45.0, -85.0, datetime.date(2026, 9, 1))
assert d1 != d2