Bump astronomy-engine from 2.1.12 to 2.1.16
Bumps astronomy-engine from 2.1.12 to 2.1.16.
Release notes
Sourced from astronomy-engine's releases.
Support for extreme year values, string helpers for C#.
Extreme year values
When converting Gregorian calendar dates to day values and back, I have been using an algorithm by Fliegel and Van Flandern that was published in October 1968. It is a wonderful formula because it doesn't use any conditional logic to handle all the leap year rules. Rather, it uses simple integer arithmetic to work in an almost magic way.
However, I recently discovered a few problems for extreme year values, especially years before 4317 BC, the Julian Day epoch. These caused the formulas to fail due to quirks of negative numbers in the calculations. I also had concerns about using 32-bit integers to do the calculations.
So I decided to write unit tests that require year values to work over a nearly 2-million year span: the range of years from β999999 to +999999. I did this for all languages except JavaScript, where I don't use Fliegel / Van Flandern formulas because the built-in type
Dateeffortlessly supports years from β199999 to +199999:> new Date('+199999-01-01T00:00:00Z') +199999-01-01T00:00:00.000Z > new Date('-199999-01-01T00:00:00Z') -199999-01-01T00:00:00.000ZThen I worked until I got all the tests to pass. This work mainly consisted of
- Adjusting Fliegel / Van Flandern to avoid negative values over the wider year range.
- In other parts of the code, handling Python's different idea of integer division when numbers are negative. In Python,
10 // 3 == 3, but-10 // 3 == -4.- In C, casting a floating point number to an integer causes it to be rounded toward zero, when I needed it to be rounded down, whether positive or negative. So I had to change
(long)xto(long)floor(x).Now all the languages except JavaScript have consistent logic for handling calendar dates that passes all the tests.
String helpers for C#
In the C# version of Astronomy Engine, I added
ToStringmethods for the types AstroVector, StateVector, and Observer. These are not only helpful for easy printing of values, but are handy while using the debugger. Just hover your mouse over a variable and you can see what's in it!I added
TryParsefunctions for AstroTime andAstroVectorto parse the string representations back into a time or vector.Python type hints
This release adds type hints to the Python version of Astronomy Engine.
Type hints provide better documentation to developers about all the function parameter types and return values. They also enable static type-checking of the Python code using the mypy tool. The automated test suite now requires passing
mypy --strictwhen each change is pushed to GitHub. This extra step will help maintain a high standard of code quality for future development. The intention is to prevent bugs before they happen, both inside Astronomy Engine and in code that uses it.Many thanks to
@βris-tlpfor volunteering to help in this effort!Hour Angle
This release of Astronomy Engine includes a new function HourAngle. It calculates the hour angle of a solar system body for a given geographic location at a given time.
This release also includes demo programs to calculate true solar time from the Sun's hour angle.
True ecliptic coordinates of date
This release changes the
Eclipticfunctions to return true ecliptic coordinates of date instead of coordinates referenced to the mean equinox of J2000. This matters because ecliptic coordinates are often significant for physical phenomena such as eclipses, transits, lunar phases, etc.So-called "true" coordinates correct for the following 3 variables in the orientation system:
- Large scale precession of the Earth's axis. This is a gyrating movement over a period of approximately 26000 years.
- Small scale nutation of the Earth's axis. This small wobbling movement has a primary periodic component of 18.6 years.
- Obliquity drift. This is a slow change of the angle between the Earth's orbital plane and the Earth's equatorial plane. Currently the angle between the planes is decreasing at a rate of 47 arcseconds per century.
... (truncated)
Commits
543ffa3Version 2.1.161de31cfC#: Implemented Observer.ToString().2fcaf27Python: verify several thousand calendar dates.ce0acf6Kotlin: support calendar dates for years -999999 to +999999.16727b8C: force use of 64-bit integers in calendar functions.7e196a3Fixed Windows batch files ignoring negative integer failure codes.503538dPY: Fixed calendar/time conversion functions for extreme year values.e7d48c6C#: Fixed bugs with calendar dates with extreme year values.1ac4ab2C: Fixed more problems with calendar date calculations.7e17705PY: Fixed calendar calculations for extreme year values.- Additional commits viewable in compare view
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
-
@dependabot rebasewill rebase this PR -
@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it -
@dependabot mergewill merge this PR after your CI passes on it -
@dependabot squash and mergewill squash and merge this PR after your CI passes on it -
@dependabot cancel mergewill cancel a previously requested merge and block automerging -
@dependabot reopenwill reopen this PR if it is closed -
@dependabot closewill close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually -
@dependabot ignore this major versionwill close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) -
@dependabot ignore this minor versionwill close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) -
@dependabot ignore this dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)