Commit Graph

2245 Commits

Author SHA1 Message Date
Don Cross
700d3d7870 Starting to create my own custom Python to Markdown converter.
Once again, existing tools are too complicated and don't do what I want.
It's actually easier to create my own tool for this special purpose.
I also want the documentation to be similar in style to the other languages.
2019-07-08 14:25:49 -04:00
Don Cross
bbd79d7e33 Following "NumPy style" Python docstrings.
I will probably need to create my own tool for generating
Markdown from these comments. None of the tools I see online
do quite what I want.
2019-07-07 20:59:20 -04:00
Don Cross
0e5dd8cee9 Include members-of-members in Python documentation. 2019-07-07 17:43:46 -04:00
Don Cross
ce3d709d5e Adding a little more Python documentation. 2019-07-07 17:42:21 -04:00
Don Cross
254238b9ea Disable Python doc generation on Travis CI. 2019-07-07 15:03:02 -04:00
Don Cross
cb82749aec Starting to work on Python documentation. 2019-07-07 14:56:04 -04:00
Don Cross
718645a5b7 Avoid redundant trim of astronomy.h. 2019-07-07 14:07:28 -04:00
Don Cross
aa0561a534 Trim trailing whitespace from all generated source. 2019-07-07 14:05:49 -04:00
Don Cross
6992d4fae9 Use NAN to indicate uninitialized fields in astro_time_t. 2019-07-07 14:01:13 -04:00
Don Cross
bae9d45e6f Generate JS iau2000b data from file. 2019-07-06 21:00:57 -04:00
Don Cross
78d43589ff Generate C iau2000b data from file. 2019-07-06 20:49:11 -04:00
Don Cross
463103ef70 JS: Generate AddSol calculations from data file. 2019-07-06 18:15:21 -04:00
Don Cross
f390fc9201 Generate C CalcMoon AddSol statements from data file.
Use the same data file that I generate AddSol for Python
to also generate them in the C source code.
2019-07-06 18:08:07 -04:00
Don Cross
20f87859d8 Moved AddSol data into a data file, so data can be shared across languages. 2019-07-06 17:50:45 -04:00
Don Cross
d750c61337 Python: Moved iau2000b and CalcMoon AddSol data into codegen phase.
Now the code generator knows how to optimize and inject these
two calculations into the Python code.
2019-07-06 17:29:34 -04:00
Don Cross
2920d983d3 First step toward making CalcMoon and iau2000b optimizers part of codegen.
I have decided to try similar optimizations in other languages
than Python. The most likely candidate is in the C code.
JavaScript I might want to optimize for small code size instead of
fast execution.
2019-07-05 20:59:18 -04:00
Don Cross
ccf8ab041b Made generated code in _iau2000b a little prettier.
Instead of (a + -b*t), generate (a - b*t).
2019-07-05 08:33:05 -04:00
Don Cross
b4b97935c3 _iau2000b: eliminate a few assignment statements. 2019-07-05 08:31:18 -04:00
Don Cross
36482b7b37 Python _iau2000b: remove fmod calls. riseset 17.0 seconds. 2019-07-05 08:28:07 -04:00
Don Cross
a2183214f1 riseset 17.85 seconds: more optimization of _iau2000b. 2019-07-04 22:16:52 -04:00
Don Cross
2a6e4fa8c9 riseset 17.8 seconds: eliminate more 0 terms. 2019-07-04 21:59:47 -04:00
Don Cross
eb7b1c18fc Minor cleanup in _iau2000b optimizer. 2019-07-04 21:46:41 -04:00
Don Cross
efb94660b8 riseset 18.0 seconds: eliminate multiplications by 1.0. 2019-07-04 21:36:44 -04:00
Don Cross
3984be1ee2 riseset 17.9 seconds: omit iau2000b terms with 0 coefficient. 2019-07-04 21:12:13 -04:00
Don Cross
900a4c9554 Unrolled _iau2000b loop: riseset test runs in 18.8 seconds. 2019-07-04 21:00:17 -04:00
Don Cross
a7002adf71 Python: riseset test runs in 19.3 seconds: improved _CalcVsop(). 2019-07-04 20:00:39 -04:00
Don Cross
c07ba908cb Python: _iau2000 is a little faster: remove list indexing from inner loop.
riseset test now finishes in 19.8 seconds.
2019-07-04 19:43:56 -04:00
Don Cross
bdc84e6d15 Python: _iau2000 is a little faster.
riseset test now runs in 20.3 seconds.
Converted all _iaudata to explicit float, and use tuples instead of lists.
Both appear to help.
2019-07-04 19:33:41 -04:00
Don Cross
ba244cdb0d Now running riseset test in 22 seconds: better _iau2000 loop. 2019-07-04 19:08:21 -04:00
Don Cross
0909aeeddd Python: small performance improvement in _iau2000b. 2019-07-04 15:32:15 -04:00
Don Cross
59f23226b6 Python _CalcMoon: Combine complex multiplication lists into single statements. 2019-07-04 09:52:13 -04:00
Don Cross
42a7e1680e Python _CalcMoon: Simplified ADDN, but no real performance change. 2019-07-04 09:38:28 -04:00
Don Cross
f9bdda49e3 Python _CalcMoon optimization: use native Python complex numbers. 2019-07-04 09:32:17 -04:00
Don Cross
cdc7416996 Eliminated AddThe function calls in expanded output. 2019-07-03 22:12:58 -04:00
Don Cross
a32f08ebb5 Greatly simplified fixaddsol translator without changing its output. 2019-07-03 22:02:33 -04:00
Don Cross
0ac3fa708f fixaddsol: Major performance improvement: 29.1 seconds.
Use dictionaries instead of creating custom array classes.
That way co[] and si[] subscripts are much faster.
2019-07-03 21:46:18 -04:00
Don Cross
835d6e524b fixaddsol: Eliminate Term and AddSol functions completely. 44.4 seconds. 2019-07-03 21:34:26 -04:00
Don Cross
ca658e2ad1 fixaddsol: Eliminate lines where we are multiplying a term by zero. 2019-07-03 21:27:26 -04:00
Don Cross
19eee58f00 Python: fixaddsol now greatly reduces the number of calls to AddThe(). 46.6 seconds. 2019-07-03 20:57:45 -04:00
Don Cross
ea10e1c793 Python: fixaddsol.py now generates smaller optimized code. 48.7 seconds. 2019-07-03 20:45:43 -04:00
Don Cross
00c2543c7b Python: AddSol translation gets time down to 49 seconds. 2019-07-03 20:36:20 -04:00
Don Cross
cb09c40ef5 Experimental reworking of Python AddSol to improve performance. 2019-07-03 20:05:30 -04:00
Don Cross
810724a7da Python: Another _CalcMoon performance improvement.
Reworked Term() to use less array indexing; pack and unpack tuples instead.
Execution time for riseset is just below 51 seconds now.
2019-07-03 19:54:10 -04:00
Don Cross
adc424106c Python: Improved performance of _CalcMoon.
I unrolled the loop in the Term function.
The riseset test now runs in 52 seconds instead of 56.
2019-07-03 17:49:42 -04:00
Don Cross
ed2cf7d985 Split out separate script ctbuild for building ctest from source. 2019-07-02 21:24:50 -04:00
Don Cross
b2c64800d9 Added test for issue 48. 2019-07-02 20:28:50 -04:00
Don Cross
e51874426c Created the same "Issue 46" test for JavaScript. Same output as C.
So now I'm interested in finding out if the JavaScript and C output
can be brought more in agreement than the current value:

ctest(Diff): Maximum numeric difference = 1.81899e-12, worst line number = 145936

This rules out the same discrepancy with JavaScript % operator versus C fmod().
2019-07-02 20:05:47 -04: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
010ea33b32 Adding code to debug a slight calculation difference between Python and C. 2019-07-02 17:47:23 -04:00