The generated code for the Pluto state table in Python
now uses a class `_pstate` for better type checking.
It also makes the code easier to understand.
Moved class _TerseVector higher in the source file to
reduce the need for quoted forward type declarations.
I added the mypy option `--disallow-untyped-defs` to fail
any function lacking complete type hints.
Then I fixed all the resulting errors.
I ended up changing the Python code generator to create
some tuple types instead of list, because it is possible
to write stricter type checks that way. This was in
the Pluto and Jupiter Moon tables.
I still should come back and do the same thing for the VSOP tables.
The type checking revealed a couple of places where I wasn't
checking for a search failure. I fixed those too.
My custom Markdown generator for Python documentation `pydown`
was generating inconsistent function type signatures depending
on the version of Python executing it. This happened for functions
like `Search` that return either Time or None.
On older Pythons we see "Optional[astronomy.Time]".
On newer Pythons we see "Union[astronomy.Time, NoneType]".
This caused unit test failures on GitHub Actions when I check in changes.
I prefer to see Optional[x] over Union[x, NoneType], so I hacked
pydown to replace this using a regex substitution.
We already had a function to search for the next time a body
reaches a certain hour angle. But we didn't have a function
to ask what the current hour angle of a body is.
This will resolve that problem, which will also answer
questions about true solar time: use the Sun as the body,
and add 12 to the hour angle, modulo 24.
Contributor @ris-tip ran into erroneous test failures
due to tiny floating point calculation differences.
I'm adjusting the thresholds slightly so his tests will pass.
Pylint discovered that I was raising Exception,
which was overly general. I didn't mean to do that;
it was supposed to be my custom exception type
astronomy.Error instead. So I fixed that case.
There were also some deprecated settings in the
pylint configuration file, so I fixed those too.
It looks like the C unit tests can use __func__ to avoid
hardcoded function names everywhere. I know this is defined
in C++11 and C99, so it should be fine. If it passes unit
testing across all platforms I exercise in GitHub Actions,
I feel comfortable using it, since it will not affect
production code.
The documentation was missing a mention of
the `time` parameter in the following TypeScript
functions:
* `Rotation_ECT_EQD`
* `Rotation_EQD_ECT`
Likewise, the `time` parameter was not documented in
the corresponding Kotlin functions:
* `rotationEctEqd`
* `rotationEqdEct`
These mistakes have been corrected.
The Windows build does not run the demo tests like
the Linux one does. This resulted in not copying
the updated astronomy.ts to the calendar demo, thus
missing the copyright year update for 2023.