Commit Graph

2245 Commits

Author SHA1 Message Date
Don Cross
43213d293f Try Python 3.12 in yml file. 2024-05-30 10:09:36 -04:00
Don Cross
11b2bcb110 Remove Python version specifier in yml file. Use latest version. 2024-05-30 10:01:18 -04:00
Don Cross
3bd2556a9a More debugging of workflow failure to load mpmath package. 2024-05-30 09:22:43 -04:00
Don Cross
a280e726b4 Added diagnostics to my GitHub Actions workflow to debug why mpmath package is not found. 2024-05-30 09:10:18 -04:00
Don Cross
4a79af69e8 I forgot to install mpmath package for Python. 2024-05-29 21:42:08 -04:00
Don Cross
ad6cc894e0 Replaced my trig functions with mpmath package.
Fascinatingly, I still have discrepancies between a well-tested
high-precision math package 'mpmath' and math.sin, math.cos.
This happens running on my own hardware, which makes me think
there is something wrong with my system, not GitHub's backend.

Here is output comparing mpmath.sin with math.sin,
and mpmath.cos with math.cos.

PY Trigonometry: maxdiff=3.32359e-12, worst angle = 719.9 degrees: PASS

I'm going to commit this to try it on other hardware/OS combinations.
2024-05-29 21:19:20 -04:00
Don Cross
e1d4507c99 dontrig.py: simplified and documented. 2024-05-29 17:34:30 -04:00
Don Cross
7ab277f1b5 PY: refactoring trig tests - work in progress 2024-05-29 17:24:34 -04:00
Don Cross
8511e7e1fd test.py: make trigonometry test run first, because everything else might depend on it working. 2024-05-29 16:07:23 -04:00
Don Cross
755863c5e1 PY: Refactoring trig function replacements. Work in progress. 2024-05-29 16:01:50 -04:00
Don Cross
4f1da6a636 trig.py now creates a "trusted" table of test trig calculations in trig.txt. 2024-05-29 15:07:39 -04:00
Don Cross
5c4df04beb trig.py contains working xsin, xcos functions.
These are replacement trig functions that should work the
same across the platforms I test on. They are much slower
than math.sin and math.cos, but unfortunately I'm having
problems with results that are accurate only to 12 digits,
not the expected 15.
2024-05-29 14:51:29 -04:00
Don Cross
f0052e9520 Yml file apparently needs quotes around '3.10'. 2024-05-29 14:30:18 -04:00
Don Cross
eacf6fdca7 Update GitHub Actions to Python 3.10. 2024-05-29 14:18:05 -04:00
Don Cross
8b326f7f8b Experiment with an updated Python installer (v5). 2024-05-29 14:11:33 -04:00
Don Cross
1becaf2455 Added trig.py to experiment with sin/cos calculation. 2024-05-29 08:37:37 -04:00
Don Cross
4e07eab41f Python: Adding _sin, _cos functions that I can redefine later. 2024-05-28 20:26:36 -04:00
Don Cross
8abc55b4c1 Log environment variables. Looking for something to explain odd Python calculations. 2024-05-28 19:53:45 -04:00
Don Cross
e75bf335c4 Python problem might be in trig functions 2024-05-28 17:25:02 -04:00
Don Cross
5dbede1a4b Looking at _CalcVsop as the possible origin of numeric errors. 2024-05-28 17:10:07 -04:00
Don Cross
f66515deb4 Attempting to diagnose recent changes in Python calculations.
It looks like values returned by VsopModel() are inconsistent
running the same code on different hardware.
On my system, Python and C are producing nearly identical results,
but in GitHub Actions, I'm getting errors on the order of 1e-12.

I'm beginning a series of commits in a separate branch where
I can hack the code to debug my code where it fails, which is
unfortunately only on GitHub Actions.
2024-05-28 16:40:26 -04:00
Don Cross
4153488d13 Removed obsolete entries from .gitignore 2024-05-28 16:26:17 -04:00
Don Cross
20a8459447 C: Resolve cppcheck warnings about const pointers. 2024-05-27 21:12:45 -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
bba1c9ecf1 Upgrade unit tests to use Python 3.9 2024-05-27 18:31:13 -04:00
Don Cross
9c5f98981a Some versions of Python do not allow hypot to have more than 2 arguments. 2024-05-27 18:01:44 -04:00
Don Cross
7c475fcada Expanded the fix for issue #347.
I tried more distant objects like Jupiter ... Neptune.
This revealed that at increasing distances, the convergence
threshold in inverse_terra needed to increased also.
So now I use 1 AU as a baseline, and scale up linearly
for more distant objects.
2024-05-27 17:07:30 -04:00
Don Cross
0309762a64 Fixed #347 - Relaxed convergence criteria for inverse_terra functions.
Asking the latitude and longitude directly beneath
the Sun causes inverse_terra not to converge, because the
convergence increment `W` never got below 1.48e-8, but the
convergence limit was 1.0e-8. I increased the limit to 2.0e-8
in all programming language versions.

I'm hoping that is a big enough tolerance for all cases now,
but I will do more testing to see if further fixes are required
for even more distant bodies than the Sun.
2024-05-27 16:20:45 -04:00
Don Cross
1c6a11c03d Merge branch 'tostt-patch-1' 2024-05-26 16:43:58 -04:00
Don Cross
898276e130 Update copyrights, move AstroTime notes to correct file, copyediting. 2024-05-26 16:30:43 -04:00
tostt
64415eba28 Date usage in README.md
I propose to add some helpful information so users can easily create correct Date objects, as the JavaScript Date class can be confusing. This class contains a timestamp (the number of milliseconds since Jan 1st 1970 at midnight), which is timezone-agnostic, but the methods to interact with this number do involve timezones.
2024-05-26 09:40:09 +02:00
Don Cross
61dc07020a Version : official release to test #330. v2.1.19 2023-12-14 12:48:22 -05:00
Don Cross
63ee6f5f14 Merge pull request #330 from vpctorr/master
Fix npm warnings
2023-12-14 12:33:02 -05:00
Victor
f60fe9dae2 Update package.json 2023-12-14 14:01:50 +01:00
Don Cross
21330a781a Merge branch 'vpctorr-patch-1' v2.1.18 2023-12-13 16:03:00 -05:00
Don Cross
6d6d6adb69 Version 2.1.18: Accepted PR #329.
Include TypeScript type definitions in the exported files.
This might be a fix for #294, but I'm not sure.
The only real way to test is to publish on npm and see what happens!
2023-12-13 16:00:30 -05:00
Victor
1736b62525 Add types field to package.json exports – fixes ts(7016) 2023-12-13 20:09:45 +01:00
Don Cross
e9f2be3b16 Fixed documentation typos regarding ECT. 2023-11-10 12:25:52 -05:00
Don Cross
a4ebd60031 Oops. Fixed bad path in yml. 2023-10-27 16:41:12 -04:00
Don Cross
b7f7615ec0 Moved GitHub Actions script logic into generate/commit_hook. 2023-10-27 16:37:52 -04:00
dependabot[bot]
06659d1e54 Bump browserify-sign from 4.2.1 to 4.2.2 in /generate
Bumps [browserify-sign](https://github.com/crypto-browserify/browserify-sign) from 4.2.1 to 4.2.2.
- [Changelog](https://github.com/browserify/browserify-sign/blob/main/CHANGELOG.md)
- [Commits](https://github.com/crypto-browserify/browserify-sign/compare/v4.2.1...v4.2.2)

---
updated-dependencies:
- dependency-name: browserify-sign
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-27 15:32:15 +00:00
Don Cross
1d19e211c3 Fixed #323 - checks time pointers for NULL.
Prevents crashes due to dereferencing NULL time pointers.
Passing in NULL for a `time` pointer will no longer cause
a crash in an Astronomy Engine function.

Wherever possible, a NULL time pointer will result in a
status code `ASTRO_INVALID_PARAMETER`.

`Astronomy_Horizon` has no way to report a status code,
so a null pointer causes it to return all NAN values.
Perhaps it should return a status code (considering for separate commit).

Thanks to [Steven Booth](https://github.com/sbooth) for suggesting this!
2023-10-23 19:50:01 -04:00
Don Cross
04a575c153 Merge pull request #321 from cosinekitty/dependabot/npm_and_yarn/generate/babel/traverse-7.23.2
Bump @babel/traverse from 7.12.13 to 7.23.2 in /generate
2023-10-16 20:00:03 -04:00
dependabot[bot]
940d273e57 Bump @babel/traverse from 7.12.13 to 7.23.2 in /generate
Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.12.13 to 7.23.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-16 23:11:32 +00:00
Don Cross
2915cd9118 Improved contributor source editing experience by improved code generator markers.
I suddenly realized today that I could eliminate lots of red wavy
lines in the source editor when working on generate/template/astronomy.*
files, by tweaking the $ASTRO_... tokens to look like comments.
For some reason, I didn't think of doing this before now.
I was motivated by the Go language support, where the tokens were
breaking `go fmt`.
2023-10-04 21:03:21 -04:00
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
871c26abde Enforce strict type checking in all Python demo programs.
Use mypy to check all Python demo programs.
Updated the demos to pass type checking.
There were a couple of small mistakes found, so this was worth the effort.
2023-10-03 11:49:04 -04:00
Don Cross
bbaf5bf544 Added Python demo: solar_eclipse.py
This demo calculates the next 10 solar eclipses that are
visible from a given location on the Earth, after a given date.
2023-10-03 11:17:32 -04:00
Don Cross
c7095c5038 Added Python demo ecliptic_of_date.
The demo program ecliptic_of_date.py shows how to
calculate the true ecliptic of date (ECT) angular coordinates
of the Sun, Moon, and planets for an observer somewhere on the Earth.
It calculates the equatorial of date (EQD) coordinates, then uses
a rotation matrix to convert the vector to ECT, then converts
the vector to spherical coordinates: latitude, longitude, and distance.
2023-10-02 16:36:56 -04:00
Don Cross
3cf4065126 Minor C code style suggestion from cppcheck. 2023-09-21 17:42:53 -04:00