Commit Graph

1235 Commits

Author SHA1 Message Date
Don Cross
d321ed695c Version 2.1.15: Python type hints. 2023-02-21 17:24:25 -05: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
8963ef9b1a Python docs: show arrow character instead of -> for return types. 2023-02-21 14:19:44 -05:00
Don Cross
102e7e7dc7 Python docs: better formatting of type hints in function signatures. 2023-02-21 14:07:55 -05:00
Don Cross
513d1f0f17 Python: reordered things to reduce forward type declarations. 2023-02-21 13:17:43 -05:00
Don Cross
cd8f9e9f4c Improved Python table for Jupiter moon models.
Updated the code generator so the Python version of
the Jupiter moon tables has better type checking
and is easier to understand.
2023-02-21 12:17:35 -05:00
Don Cross
23b45dd075 Improved Pluto state table in Python code.
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.
2023-02-21 10:56:05 -05:00
Don Cross
a530069e99 Improved Python VSOP table generation.
The VSOP table generator for Python now is now
better type-checked using classes and tuples.
This also makes the code easier to understand.
2023-02-21 10:12:45 -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
fc408501c5 Fix for dotnet command no longer allowing --output on solution files.
The `dotnet` command no longer allows using `--output` to specify the
output directory for building a solution file:
https://github.com/dotnet/sdk/issues/15607

This broke my GitHub Actions tests for C#.

I used the following workaround, because in my case I
know merging multiple builds into one directory is safe:
https://github.com/dotnet/sdk/issues/30624#issuecomment-1432118204
2023-02-19 17:13:05 -05:00
ris-tlp
66c3ebbc33 Fix PR reviews 2023-02-18 15:45:06 -05:00
ris-tlp
43be952eb2 Python: Type Hints Integration - 6 2023-02-18 03:58:01 -05:00
ris-tlp
e7f8f2b8e2 Python: Type Hints Integration - 5 2023-02-18 03:26:35 -05:00
ris-tlp
0d4c438c2b Python: Type Hints Integration - 4 2023-02-18 02:46:04 -05:00
ris-tlp
d055cb9fe8 Python: Type Hints Integration - 3 2023-02-16 01:12:09 -05:00
ris-tlp
92d266fc3a Python: Type Hints Integration - 2 2023-02-15 02:07:43 -05:00
ris-tlp
6bb781146b Python: Type Hints Integration - 1 2023-02-13 22:56:10 -05:00
ris-tlp
6c1523038d Testing if setting branch upstream was successful 2023-02-13 19:33:21 -05:00
Don Cross
d73d271a4f Fixed pydown to understand imported symbols.
In order to import typing.Union into the module namespace,
I had to fix pydown to recognize Union as a defined symbol.
2023-02-13 13:19:13 -05:00
ris-tlp
4ea28c6d88 Python: Few typehints for initial review 2023-02-13 02:11:37 -05:00
Don Cross
97c4d2f8f0 Version 2.1.14: added HourAngle function. 2023-02-12 21:34:10 -05:00
Don Cross
632d059972 Kotlin: implemented hourAngle function. 2023-02-12 18:13:36 -05:00
Don Cross
9e98d0fb17 PY: Implemented HourAngle function. 2023-02-12 16:20:33 -05:00
Don Cross
f11e2e8c6d JS: Implemented HourAngle function. 2023-02-12 14:22:41 -05:00
Don Cross
43c37c9038 C#: Implemented HourAngle function. 2023-02-12 13:05:29 -05:00
Don Cross
6a8a905aa5 C: Implemented Astronomy_HourAngle function.
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.
2023-02-12 10:52:42 -05:00
Don Cross
8bf48d0681 Slight relaxation of test tolerances.
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.
2023-02-09 08:37:39 -05:00
Don Cross
341a4bbaec Fixed overly general exception in Python code.
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.
2023-02-07 14:27:06 -05:00
Don Cross
667dcf5c9c Fixed #285 - added missing time parameter to docs.
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.
2023-01-28 12:33:12 -05:00
Don Cross
4256903060 Fixed #280 - corrected typo in documentation. 2023-01-23 17:50:13 -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
1a4f842764 Updated Ecliptic to return ECL in all languages. 2022-12-10 19:35:42 -05:00
Don Cross
d4660de2a7 JS: Ecliptic function returns ECT instead of ECL. 2022-12-10 03:55:17 -05:00
Don Cross
47ce0ac34e C#: EquatorialToEcliptic now returns ECT instead of ECL. 2022-12-09 21:03:05 -05:00
Don Cross
f811b6f55b C: Ecliptic function returns ECT instead of ECL.
Now the C function Astronomy_Ecliptic returns ecliptic
coordinates in true equinox of date instead of the
J2000 mean equinox. I'm doing this because it is a
better fit for physical phenomena that ecliptic
coordinates are often used for. For example, lunar nodes,
eclipses, phase angles, and oppositions make more sense
with true latitude and longitude of date.

I will port these changes to the other languages also.
2022-12-09 20:00:52 -05:00
Don Cross
f959599497 Completed EQJ/ECT, ECT/EQJ rotations. 2022-12-09 13:12:42 -05:00
Don Cross
1864fa8539 Orientation nomenclature. C: EQJ/ECT rotations.
More work standardizing the nomenclature of the
orientation systems across all language documents.

Added C functions to calculate rotation matrices
for EQJ/ECT and ECT/EQJ.
2022-12-08 22:03:43 -05:00
Don Cross
281180db24 Use consistent descriptions of EQJ, ECL.
Use consistent wording for these two orientation systems:
EQJ = J2000 mean equator
ECL = J2000 mean ecliptic
2022-12-08 16:16:41 -05:00
Don Cross
b4c36e7188 Merge branch 'master' into ecliptic 2022-12-08 13:44:53 -05:00
Don Cross
30a9b0b757 Fixed warnings from gcc 12.2.
I'm taking gcc 12.2 for a test drive today.
It reports a few warnings that slipped through earlier versions.
None of the warnings concern me for actual code safety,
but I went ahead and resolved them to keep the build clean.

Also provide a hook for a CPP environment variable to override
the C++ compiler to use, instead of forcing g++.
2022-12-08 13:41:12 -05:00
Don Cross
dfbd268aa3 JS: Added rotation ECT/EQD. 2022-12-07 13:48:24 -05:00
Don Cross
2dd4fc1ab4 Python: rotations for ECT/EQD. 2022-12-07 13:03:38 -05:00
Don Cross
1d57802470 Kotlin: implemented EQD/ECT rotations. 2022-12-06 21:12:31 -05:00
Don Cross
8fe8b028f8 Added EQD/ECT rotation functions to C# topic index. 2022-12-06 20:05:46 -05:00
Don Cross
f043ebc62b C#: added rotation matrix functions for EQD/ECT. 2022-12-06 18:36:47 -05:00
Don Cross
62ba530272 Document new C functions: rotate EQD/ECT. 2022-12-06 15:19:13 -05:00
Don Cross
c102208e2b C: Rotation matrices for EQD/ECT.
Added new C functions to convert back and forth
between Equator of Date (EQD) and True Ecliptic of Date (ECT).
2022-12-06 15:09:00 -05:00
Don Cross
742ab4cbff Define ECT in documentation.
Define ECT = True Ecliptic of Date in the documentation.
I will soon convert the Ecliptic() functions to return ECT instead of
ECL, but I will retain ECL support via rotation matrix functions.
2022-12-06 13:36:47 -05:00
Don Cross
12e68a1931 Fixed warning issued by Microsoft C compiler.
Somehow gcc didn't warn me that a `void` function
was trying to return a `void` value. It makes sense
from a functional language "unit type" perspective,
but it wasn't intentional, and it is weird. Fixed it.
2022-12-05 22:10:51 -05:00
Don Cross
552c7a5557 EclipticGeoMoon uses true equinox of date in all languages.
Added EclipticGeoMoon as output to the temp/*_check.txt files as 'm' lines.
This ensures that all the languages calculate nearly identical values.

Optimized EclipticGeoMoon a little more by eliminating a redundant
call to mean_obliq.
2022-12-05 21:44:35 -05:00