30 Commits

Author SHA1 Message Date
Don Cross
67dd5dc691 Attempt to make GitHub Actions run the same python I told it to install.
It looks like I have been running an unintended version of Python
from GitHub Actions.  In Linux/Mac I used `python3`, and in Windows
I used `py`. It appears that I should be executing `python` in
all 3 operating systems.

This is an experiment to see if I can get everyone on the same page.
2024-05-30 12:57:43 -04:00
Don Cross
d2b7621f66 No longer use pylint - mypy works better for my needs. 2024-05-27 18:43:49 -04:00
Don Cross
b686b6185c Escalated mypy to use --strict option.
Use --strict in mypy to perform maximum type checking.
Fixed the remaining errors.
2023-02-21 15:34:52 -05:00
Don Cross
f849c11258 Require type hints for all Python functions.
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.
2023-02-20 20:04:10 -05:00
Don Cross
740ef86d31 Run mypy to verify Python data types. 2023-02-13 12:30:16 -05:00
Don Cross
74044b39d3 More Python/pip package cleanup : version 2.0.17.
Generate astronomy.py directly in the package directory.
I realized it doesn't make sense to generate it in the
parent directory and then copy it; just generate it where
it will end up anyway.

Updated documentation so people know they can just do

    pip install astronomy-engine

to install Astronomy Engine in their Python project.

Removed the GitHub Actions status badge because it is redundant with
the checkmark/X indicator.

Now that private symbols are no longer exported, I had to
fix a couple of places where the unit tests still accessed them.
2022-03-20 16:47:29 -04:00
Don Cross
9c4b6e9f87 Fixed pylint problems on Raspberry Pi.
The current Raspbian uses an older version of pylint
that suffers from a recursion overflow. Hacked a deeper
recursion limit to work around this issue.
Also directly calling 'pylint' does not work in Raspbian.
Instead of trying to figure out why, I just use 'python3 -m'
to invoke pylint.
2021-09-26 19:30:55 -04:00
Don Cross
25cba04356 Added pylint to unit tests. Fixed warnings. 2021-09-25 19:51:48 -04:00
Don Cross
cd058ccd89 Refactored Python unit tests to be table driven.
Now I can run any Python unit test by name, or specify 'all'
to run them all. This way I don't have to update scripts
every time I add a new Python unit test.
2020-06-03 12:27:20 -04:00
Don Cross
6b0bc73b0b Reworking Python unit tests to be table-driven.
I like what I did to the JavaScript tests, where I no longer
need to update scripts when I add a new unit test.
So I have decided to do the same for the other languages,
starting with Python.
2020-06-03 11:57:30 -04:00
Don Cross
e9503bc202 Made 'generate check' output less verbose unless -v is specified.
This completes my initial pass for making unit test less verbose.
2020-05-26 12:23:40 -04:00
Don Cross
75e26ccac2 Changed verbosity option from -d to more standard -v. 2020-05-26 11:58:02 -04:00
Don Cross
0787b88ddd Python unit tests are less verbose unless -d option is specified. 2020-05-26 11:14:12 -04:00
Don Cross
fe18eb81e4 Implemented Python version of lunar eclipse predictor. 2020-05-16 17:38:00 -04:00
Don Cross
b7c59f6628 Include extrapolated DeltaT values for the years 2030..2200.
I had to increase certain error tolerances in the unit tests.
Reworked the unit tests to make more sense by waiting until
each language step is done to check against each other.
That way I can run a single language step independently.
2020-05-14 20:24:34 -04:00
Don Cross
540d9d7cef Added constellation function to Python code. 2020-05-03 21:37:28 -04:00
Don Cross
7892b797ba Python: planet apsis search is working. 2020-01-06 20:49:49 -05:00
Don Cross
92cc2d9783 Python: starting to implement rotation functions and associated unit tests. 2019-12-15 19:51:30 -05:00
Don Cross
62163ed509 Compare Python output to C output (not JavaScript).
I'm going to define the C output as the "most correct", and
compare all other languages to it.
2019-07-02 19:39:51 -04:00
Don Cross
9359b80c42 Fixed #46 - Python calculations exactly match C calculations.
The problem was that the Python "%" operator does not behave
exactly like the C function fmod().  However, there is a Python
function math.fmod() that does act just like its counterpart in C.
Now astro_check output is *identical* between Python and C,
at least on my Windows 10 laptop.

Reinstated "ctest diff" in unit tests to make sure the
two implementations stay in sync.
2019-07-02 19:19:36 -04:00
Don Cross
eb2a8c14d0 Python: finished all unit tests -- LunarApsis was the last one. 2019-07-02 14:13:31 -04:00
Don Cross
d01c4fd0a5 Python: Added tests for astronomy.Illumination().
I still need to add a test for SearchPeakMagnitude().
2019-07-01 17:00:28 -04:00
Don Cross
86674e3c73 Python: implemented rise/set tests and fixed associated bugs. 2019-06-30 18:58:04 -04:00
Don Cross
fa1ce83a00 Python testing: elongation test in progress. 2019-06-30 13:34:51 -04:00
Don Cross
0ab44ede69 Python: Added MoonPhase test. Fixed errors. 2019-06-29 23:43:38 -04:00
Don Cross
9d304850df Python: Added seasons test and fixed errors uncovered by it. 2019-06-29 23:02:27 -04:00
Don Cross
f85025da31 Implemented astro_check in Python. Exercises major parts of the code.
There is still a slight discrepancy in calculations of altitude,azimuth
that is larger than between JS and C.
2019-06-26 21:12:27 -04:00
Don Cross
6d0ee59c1f Python: starting to implement astro_check. 2019-06-26 19:12:59 -04:00
Don Cross
787812287c Python: calling GeoMoon() without errors, but calculations not yet validated. 2019-06-24 15:25:28 -04:00
Don Cross
35017483cb Fixed problem in Python MakeTime() function.y 2019-06-23 17:10:58 -04:00