You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 12cf1ec
Browse filesBrowse the repository at this point in the historyBrowse files
Return sunrise and sunset at the observer's element type
transit_sunrise_sunset rounds the event times to a whole second in order to
build a DateTime. That discards the sub-second part, and with it anything the
element type carries beyond a value. The solve already runs at the observer's
element type, so the information exists right up to that final conversion and
is then thrown away.
transit_sunrise_sunset_seconds returns the same events as seconds since
midnight UTC, keeping the element type. A Measurement observer therefore yields
event times with an uncertainty, and a dual-valued observer yields
differentiable ones. Neither was possible before, and the DateTime variant could
not even be finite-differenced, since a step small enough to be a derivative is
swamped by the rounding.
The conversion now dispatches on the requested type, so the DateTime and
ZonedDateTime paths are untouched, including the polar day and night branch.
TransitSunriseSunset needed no change, having been made generic when TimeZones
moved to an extension.
Covered from both directions: the propagated uncertainty is checked against a
finite-difference gradient, the ForwardDiff derivative against the same, and the
two variants are asserted to describe the same instant for a Float64 observer.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NQ9zmXUHQtA5suiMB8UdA7
0 commit comments