Repository navigation
Astro version 2.7.0
Enhancements
-
Astro.Lunar.date_time_new_moon_before/1anddate_time_new_moon_at_or_after/1evaluate only the two lunations either side of the moment, about five times faster. Results are unchanged, bit for bit. -
Astro.Time.dynamical_from_universal/1anduniversal_from_dynamical/1find the ΔT decimal year with integer day arithmetic, about 1.6 times faster. Results are unchanged on every day of years −9999 to 9999. -
Astro.equinox/3andAstro.solstice/3take:time_zone(:utcby default, or a zone name) and:time_zone_databaseoptions and return the instant in that zone, whose civil date can differ from the UTC date — for Japan's equinox holidays, in about a third of years. A named zone with no time zone database configured returns{:error, :utc_only_time_zone_database}. -
Astro.Supervisor.child_spec/1letsAstro.Supervisor, which starts the tz_world backend, be listed as a child in an application's supervision tree.
Bug Fixes
-
The specs of
Astro.date_time_new_moon_before/1,date_time_new_moon_nearest/1,date_time_new_moon_at_or_after/1,date_time_lunar_phase_at_or_before/2anddate_time_lunar_phase_at_or_after/2were malformed, so their error return was silently dropped and dialyzer took them never to fail. With the fix below they cannot fail, so they declare{:ok, DateTime.t()}and their docs no longer describe an error shape they never returned. -
Astro.Time.date_time_from_moment/1, and so every date-time search above, converts instants before 0000-01-01 instead of returning{:error, :invalid_time}— the day of a negative moment was truncated rather than floored. -
The date-time clause of
Astro.date_time_new_moon_before/1was defined asAstro.date_time_new_moon_at_or_before/1, which carried its documentation. It is now a clause ofdate_time_new_moon_before/1, anddate_time_new_moon_at_or_before/1is deprecated. -
Astro.lunar_phase_emoji/1returns the new moon 🌑 for phases above 337.5°, where it returned the crescent moon 🌙, which is not a phase symbol. -
Astro.Time.hours_and_date_to_date_time/2declares the{:error, reason}it returns for an invalid date or a time of day of 24 hours or more. -
Astro.Time.date_time_from_date_and_minutes/2returns{:error, :invalid_date}for a date that is not valid in its calendar, where it raisedMatchError, and converts a date in another calendar to its ISO date instead of reading its fields as ISO.Astro.solar_noon/2returns the same errors and gives a date in another calendar the solar noon of that same day. -
Astro.sun_azimuth_elevation/2,Astro.Time.local_sidereal_time/2andAstro.Time.greenwich_mean_sidereal_time/1raisedArgumentErrorfor every input in an application with no time zone database configured. They now need none. -
Astro.sunrise/3andAstro.sunset/3return{:error, :invalid_solar_elevation}for an unknown:solar_elevation, where they raisedCaseClauseError, and their docs now list every error they return. -
Astro.moonrise/3andAstro.moonset/3return{:error, :invalid_limb}or{:error, :invalid_interpolation}for an unknown:limbor:interpolation, where they raisedCaseClauseError. Their docs and specs promised:moon_always_below_horizonand:moon_always_above_horizonwhere they return{:error, :no_time}, and now list every error they return. -
Astro.new_visible_crescent/3with the:odehmethod, the default, or the:yallopmethod misclassified many crescents — a crescent 36 hours old at Mecca could be "not visible with optical aid" — because the lunar altitude and semi-diameter it uses were wrong (below). Classifications change on about half of evenings with:odehand a quarter with:yallop, and the two methods now agree on 79% of evenings, where they agreed on 39%. -
Astro.Lunar.lunar_altitude/2,angular_semi_diameter/1,equatorial_horizontal_parallax/1,horizontal_dip/1,topocentric_lunar_parallax/2andtopocentric_lunar_altitude/2returned wrong values, because the arcsine they share treated its ratio argument as degrees.lunar_altitude/2now agrees with the JPL ephemeris to within 0.006°. -
Astro.Time.mean_sidereal_from_moment/1, and through itAstro.sun_azimuth_elevation/2,Astro.Time.greenwich_mean_sidereal_time/1,local_sidereal_time/2andAstro.Lunar.lunar_altitude/2, measured sidereal time from Terrestrial rather than Universal Time, about 0.27° ahead. They now match Meeus's worked examples, and the sun's elevation agrees with the JPL ephemeris to within 0.01°. -
Astro.Time.apparent_sidereal_from_moment/1applied the formula for 0h UT at every time of day. It now returns the apparent sidereal time, asAstro.Coordinates.gast/1does. -
Astro.new_visible_crescent/3with the:schaefermethod modelled the sky as dark while the Sun was less than 1° below the horizon, so it could report a crescent under an hour old as visible to the naked eye. Twilight now brightens the sky from the horizon down. -
Astro.Lunar.lunar_node/1returned the node's distance from the equinoctial point about 9,000 years after the given moment. The doc ofAstro.Lunar.moon_node/1now says it returns the Moon's argument of latitude, which it always has.