Commit Graph

88 Commits

Author SHA1 Message Date
Don Cross
520a532531 Test Python demos in Windows also.
Before now, the Python demos were tested in Linux and Mac.
Now they are tested in the Windows environment also.
This will be helpful for any contributors who may wish
to use Windows as a development platform for the Python
version of Astronomy Engine.
2023-10-03 13:41:05 -04:00
Don Cross
9975edc81b Updated star database to HYG v 3.6.1. 2023-09-21 15:41:03 -04:00
Don Cross
f4405e390c Updated star database to HYG v 3.5.1.
This change affects internal unit testing only.
It does not affect developers who use Astronomy Engine.
Upgraded the HYG database used for verification of
constellation calculations to v 3.5.1.

See conversation at:
https://github.com/astronexus/HYG-Database/issues/21
2023-09-19 15:08:49 -04:00
Don Cross
e3fc95a2fb Use fixed version of star data in Windows build. 2023-04-10 21:35:30 -04:00
Don Cross
0bd0df2cfa Use updated version of star database.
The star database file hygdata_v3.csv has been updated.
Updated the expected checksum for it.

Reworked the downloader to check for checksum disagreement.
If checksum doesn't match, delete the file and download,
then try the checksum again.
This change will automatically fix obsolete files that have already
been downloaded on contributor's development systems.
2023-03-22 15:05:00 -04:00
Don Cross
7e196a3c17 Fixed Windows batch files ignoring negative integer failure codes.
In many of my Windows batch files, I used the following
construct to detect failures:

    do_something
    if errorlevel 1 (
        echo.An error occurred in do_something
        exit /b 1
    )

I discovered that it is possible for a Windows program
to exit with a negative integer error code.
This causes the above construct to miss the failure
and the batch file blithely continues.

So I have replaced that construct with

    do_something || (
        echo.An error occurred in do_something
        exit /b 1
    )

This way, if the command exits with any nonzero error,
we correctly detect it as a failure.
2023-02-26 10:26:42 -05:00
Don Cross
62192357ba Updated copyrights for 2023.
Windows build process now updates copyright
years just like the Linux build process does.
Ran it to update the copyright years for 2023.
2023-01-07 17:13:07 -05:00
Don Cross
700a834ffc Finally solved my download problems.
I realize now that the URLs I was using to download stuff
from GitHub Actions were redirects. So I need to use 'curl -L'
to follow the redirects. But I also removed the redirect by
using the ultimate URLs.
2022-12-04 19:42:05 -05:00
Don Cross
eac8582418 Test Kotlin demos in Windows. 2022-05-01 19:48:18 -04:00
Don Cross
e01235a260 Replaced another use of sha256sum with checksum.py. 2022-04-25 03:43:50 -04:00
Don Cross
105e806c4d Check download integrity on all operating systems.
The sha256sum and md5sum utilities are available by
default on Linux, but not Windows or Mac OS.
I created the script `checksum.py` that can perform
sha256 and md5 checksum verification on all 3 systems.

Got rid of the ugly checksum.bat I was using on Windows.
Deleted the md5 checksum files, since I only need sha256
for now.

Before this change, I was always skipping verification
of downloads on Mac systems.
2022-04-25 03:08:29 -04:00
Don Cross
23ed1cda5a Kotlin: added more planet longitude tests.
Generate longitude output files that are tested by
the `generate` program.

Discovered that Windows `run.bat` was not correctly testing
the longitude output test files generated by the JavaScript
code. Fixed that.
2022-04-17 13:30:09 -04:00
Ebrahim Byagowi
7ad9487c3e kotlin: Upgrade Android example to use the new namings 2022-04-12 23:29:09 +04:30
Don Cross
a2fe6c4c38 Kotlin/Windows: fix markdown docs, just like Linux/mac. 2022-04-12 11:17:22 -04:00
Don Cross
55b5287eef Kotlin/Windows: build markdown, not html.
I discovered that the build process on Windows
was still using Dokka to make html, not markdown.
Fixed this to maintain compatibility with the
build process for Linux and Mac OS.
2022-04-12 10:55:20 -04:00
Don Cross
79ff7b2805 Kotlin: Create fatJar during initial build.
Moved the step that creates the fatJar into
the main build process for Kotlin. This is
needed to run the Java demos, and it is good
to fail early if it cannot be built.
2022-04-12 10:37:02 -04:00
Don Cross
79ddc105fb Kotlin: Added NOVAS C 3.1 check for Windows builds.
The previous commit added the NOVAS check for
Kotlin output to the bash script unit_test_kotlin,
which is executed in Linux and Mac OS.
This commit adds the same check to run.bat,
which is executed on Windows.
2022-04-03 16:36:58 -04:00
Don Cross
cb54c32e79 Delete source/kotlin/build dir before build on Windows.
Just like in Linux and Mac OS, nuke the 'build'
directory before running gradlew. This ensures
no stale content leaks in from previous builds.
2022-03-24 11:20:09 -04:00
Don Cross
57ab910abb Automate validation of Java demos in Windows. 2022-03-22 16:04:36 -04:00
Don Cross
ff16ae0a90 Windows Kotlin build: need to call gradlew.bat.
Because the 'gradlew' command is a batch file in
Windows, I need to use the 'call' command to invoke
it from run.bat, or it does not return to run.bat.
2022-03-18 07:31:46 -04:00
Don Cross
a0723c7406 Kotlin build/test integrated with 'run' scripts.
Instead of being executed directly by the GitHub Actions
yml file, the Kotlin build now has been integrated with
the build/test steps for the other 4 languages in the
bash script `generate/run` and the Windows batch file
`generate/run.bat`. This will be necessary to control the
order of execution, because the Kotlin source code will have
to be written by the code generator before it is built
and executed.

I also added hints for myself and other contributors about
how to set up Kotlin/JDK tools on a new developement machine.
These instructions are not needed by most users of Astronomy Engine,
just contributors.
2022-03-17 20:52:32 -04:00
Don Cross
c668ea81e5 Windows: use certutil.exe to validate files.
In Windows builds, I was checking for the existence
of md5sum.exe, and if present, I used it for verifying
downloaded files. However, this is not a standard
utility that comes built into Windows 10.

I found there is a standard utility certutil.exe
that can calculate md5, sha256, etc, checksums.
However, it does not verify files created by the
Linux utilities md5sum, sha256sum, etc.

So I created a batch file checksum.bat that invokes
certutil.exe to process one of those listing files.
Reworked run.bat to call checksum.bat instead of
using md5sum.exe.
2022-01-19 17:49:10 -05:00
Don Cross
57a71af403 Windows CI: try using 'py' command to run Python programs.
Weirdly, the python program for generating constellation
data did not seem to run, but that failure did not break
the build directly. I am adding an explicity 'py' command
to run each Python program. Also added a check for missing
output constellation test data.
2022-01-09 22:06:28 -05:00
Don Cross
e9922a48bb Windows CI: put quotes around executables.
In the GitHub Actions CI environment, the program md5sum.exe
resides in "C:\Program Files\Git\usr\bin\md5sum.exe".
Therefore, to execute it, I need quotes around the executable.
2022-01-09 17:43:46 -05:00
Don Cross
f95316c113 Fixes for the Windows build process. 2021-11-24 21:33:06 -05:00
Don Cross
3e870d6a99 Updated Windows build for testing galactic coordinates. 2021-06-08 16:40:36 -04:00
Don Cross
1e2c24208c Fixed #103 - Scale body vector differences by orbital radius.
When comparing calculations of body vectors, scale
the size of the difference by the minimum orbital
radius (or typical radius in the case of the Solar
System Barycenter).

This concludes my investigations of discrepancies between
the various language calculations. I have done as much
as I can without implementing my own trig functions,
which is not worth the effort (or the loss of efficiency
in JavaScript).

Scaling the errors relative the measurement units reveals
that the discrepancies are reasonable for the 16-digit
precision one expects from 64-bit floating point numbers.
The worst case is C vs JavaScript, with a scaled error
of about 7.2e-15. I can live with that.
2021-04-20 17:23:29 -04:00
Don Cross
ce0290b7f6 diffcalc: Divide angular errors by their range of values.
A given amount of error in an angle measured in
sidereal hours is 15 times more important than the
same numeric error in an angle measured in degrees.
Scale angular errors by the range of values they
could take on. Longitude-like angles in degrees
have a range of 360, while latitude-like angles
range over 180 degrees (-90 to +90).

Split out separate Windows batch file diffcalc.bat,
just like I already split out bash script diffcalc.
2021-04-20 16:25:02 -04:00
Don Cross
ebade6c4c2 Updated Windows build to run diff checker with tolerance passed in.
Now that the Linux build process passes in a different
tolerance value for each of the diff checks, I updated
the Windows build accordingly.
2021-04-20 15:30:54 -04:00
Don Cross
f879bc51a6 Skip Jupiter Moon model optimization if already calculated.
This will save a lot of time in my local unit tests, but
will verify it isn't broken when I push to GitHub.
2021-04-11 19:27:09 -04:00
Don Cross
43d05b25bd Jupiter Moons: stubbed the idea of a model optimizer.
I want to experiment with truncating the L1.2 series to
sacrifice some accuracy for smaller generated code.
To that end, I implemented the ability to save the
Jupiter moons model after loading it. I added a 'jmopt'
command to the 'generate' program that will do this
optimization. For now, it just loads the model and
saves it back to a different file. Then the code generator
loads from the saved file instead of the original.
This commit verifies that everything is still working,
before I start truncating the series.
2021-04-11 13:42:23 -04:00
Don Cross
427fb8ed3a Purged obsolete code from generate.c.
Now that I no longer need to generate Chebyshev models
or TOP2013 models for Pluto, I got rid of all the
code in generate.c that is no longer needed.
This whacked about 1000 lines of code.
2020-08-25 17:39:22 -04:00
Don Cross
34a5d48e9c TOP2013: Froze Pluto model at 24816 bytes.
Instead of randomly searching for a good Pluto model, just use
the one I have so far. If I find a better one, I will replace it
in the Git repo.
2020-07-04 20:02:13 -04:00
Don Cross
03cfecea39 Starting to work TOP2013 Pluto model into the build/test process.
Generating an embryonic TOP2013 Pluto model, along with the old
Chebyshev resampling model of Pluto, into the Linux and Windows
build processes.

The TOP2013 Pluto model isn't used for anything, and it isn't
optimized properly yet, but at least this helps validate my code
automatically as I go forward.
2020-07-03 15:19:21 -04:00
Don Cross
5079896ad5 Ported validation of TOP2013 code to Windows run.bat. 2020-07-02 10:31:28 -04:00
Don Cross
9a11828265 Windows run.bat: factored out download logic as a subroutine.
Reduced the size of the Windows batch file 'run.bat' by factoring
out the logic for downloading an external file into a subroutine.
I had already done this in the Linux bash script 'run'.
2020-07-02 10:18:04 -04:00
Don Cross
bf5a390d88 Fixed bug in Windows run.bat running new C# unit tests. 2020-06-14 13:45:56 -04:00
Don Cross
9cdaaa8761 Starting to work on planetary transit calculations.
Wrote stub C functions for finding transits.
Updated html files containing Espenak test data for Mercury, Venus.
Updated norm.py to convert the html files to easy-to-use text files.
2020-06-11 22:17:01 -04:00
Don Cross
a6c9526389 Eliminate extraneous blank lines in run.bat output. 2020-06-03 14:04:56 -04:00
Don Cross
4636c6d0e0 Refactored C unit tests for easier maintenance. 2020-06-03 13:09:39 -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
6b56bf0cfd Finished refactoring JavaScript unit tests.
From now on, it will be simpler to add new JavaScript unit tests.
In most cases, it should no longer be necessary to update the
bash script unit_test_js or the batch file run.bat when new
JavaScript tests are added.
2020-06-03 10:20:52 -04:00
Don Cross
b03914393e Added local solar eclipse test to Windows build. 2020-05-25 17:48:07 -04:00
Don Cross
2dcdf3bd8a Updated Windows build to test global solar eclipse prediction. 2020-05-20 11:20:49 -04:00
Don Cross
d926c51cce Added lunar eclipse tests to Windows build. 2020-05-17 15:11:44 -04:00
Don Cross
d6b9967bd1 Updated error thresholds to make Windows unit tests pass. 2020-05-17 14:59:28 -04:00
Don Cross
4b4c637468 Added missing constellation test runs in Windows. 2020-05-04 16:10:28 -04:00
Don Cross
bcb97d8a19 Windows run.bat now downloads star database and builds constellation test data. 2020-05-04 16:02:08 -04:00
Don Cross
2a1a25cd29 Fixed problems with building/testing on Windows. 2020-01-07 16:00:17 -05:00