Commit Graph

2245 Commits

Author SHA1 Message Date
Don Cross
eac7750fba Fixed #86 - eliminated redundant JS functions MakeObserver and MakeSpherical.
In the TypeScript/JavaScript code, the functions MakeObserver and MakeSpherical
are no longer needed, because the classes Observer and Spherical are now exported,
along with their constructors. I deleted those functions and reworked callers
to use the equivalent constructors instead.

Also fixed a few breakages in the html/browser examples that crept in recently.
2021-02-09 19:49:00 -05:00
Don Cross
52626514e2 JS: Always use @brief in jsdoc. Corrections to JS documentation.
Although it looks less pretty in the generated Markdown,
I think it makes more sense to consistently use @brief in
the jsdoc comments for functions and classes, so that the generated
documentation.json might be more useful some day.
Added @brief comments for places it was missing.

Fixed obsolete remarks in the documentation for AstroTime:
this type, and its constructor, are both exported now.

Fixed broken link to EclipseEvent function.
2021-02-09 16:37:59 -05:00
Don Cross
1e1ed312df Decreased size of Acknowledgements header. 2021-02-09 13:09:36 -05:00
Don Cross
4bdcbfe36d Added "Deploys by Netlify" badge to README.md. 2021-02-09 13:08:12 -05:00
Don Cross
44137e4dc3 Merge pull request #84 from matheo/initial-docs
JS: Library capable of tree-shaking
2021-02-08 21:56:22 -05:00
Mateo Tibaquira
433a985b6f demos: improved valildation of body-position form 2021-02-08 20:12:53 -05:00
Mateo Tibaquira
992aaf4ea1 JS: Library capable of tree-shaking
I found that the Angular bundles had all the astronomy-engine library for a total of 90.62Kb
after this change Angular is able to reduce the demo module to 54.56Kb

Based on https://toastui.medium.com/building-a-ui-library-capable-of-tree-shaking-from-a-to-z-b3f8a9be589f
2021-02-08 20:09:17 -05:00
Don Cross
7449ff4be0 Merge pull request #82 from matheo/initial-docs
Initial documentation website
2021-02-08 17:33:57 -05:00
Don Cross
b529a34c66 JS: Mention TypeScript in the Markdown documentation.
Let people know that a TypeScript version of
Astronomy Engine is now available.
2021-02-08 17:31:42 -05:00
Don Cross
ba619d553a JS: Fixed JSDOC type declaration for the Search parameter 'func'.
The JSDOC type declaration for the Search function's 'func'
parameter was 'ContinuousFunction', which is nowhere defined.
Replaced that with an inline declaration of the function type.
Unfortunately, it shows up in the Markdown code as 'function',
but at least I explain the function's parameter and return type
in the accompanying text.
2021-02-08 16:28:33 -05:00
Don Cross
edc5cb6e15 JS: Miscellaneous cleanup in TypeScript types and JSDOC comments.
Use FlexibleDateTime consistently in the JSDOC parameter types.

Expanded the documentation for FlexibleDateTime.

Because we now export the AstroTime constructor, allow it to accept
FlexibleDateTime as a parameter. This means adding the ability to
clone another AstroTime if passed in as the parameter.

Where appropriate, use the more concise TypeScript constructor syntax
that declares members and parameters at the same time.

Use @ignore in JSDOC comments for things I want to document
internally, but are not exported. This way they do not appear
in the generated Markdown files.
Added @ignored documentation for ShadowInfo and body_grav_calc_t,
because these are complicated calculations.

It looks like parentheses are not needed in JSDOC parameter
types, even when there are multiple types separated by vertical bars.
Normalize {(a|b|c)} to {a | b | c} for improved readability.

Created a TypeScript SearchOptions interface for the Search function,
instead of the inline object-shape definition.
2021-02-08 15:59:59 -05:00
Don Cross
485ce7230e JS: Removed 'export' from private functions and variables. 2021-02-08 10:16:42 -05:00
Don Cross
85e3a36000 JS unit test should use the Node version of astronomy.js, not the browser version.
Now that we generate separate JavaScript code for Node.js and the browser,
the unit test should use the minified Node version.

It's interesting that the test works equally well with either file.
Perhaps we should consider exercising both in the unit tests?
2021-02-08 09:37:33 -05:00
Don Cross
129a3ccdc5 Merge pull request #83 from matheo/typescript
JS: Refactor typescript build process
2021-02-08 09:00:40 -05:00
Mateo Tibaquira
a0946fab37 build: website bundle for GitHub pages 2021-02-08 02:10:34 -05:00
Mateo Tibaquira
3fd9022fdc demos: initial port of celestial body positions 2021-02-08 02:06:20 -05:00
Mateo Tibaquira
57d74555d7 JS: Fix JSON documentation removing absolute paths 2021-02-08 02:06:04 -05:00
Mateo Tibaquira
958f8b0ddc JS: Fix docblock for SearchOptions 2021-02-07 23:46:01 -05:00
Mateo Tibaquira
27634b9553 website: initial homepage based on PrettyDocs theme 2021-02-07 23:38:32 -05:00
Mateo Tibaquira
ba921d45b4 website: add the main module with index component 2021-02-07 23:38:31 -05:00
Mateo Tibaquira
cc31072506 build: generate JSON documentation with JSDoc 2021-02-07 23:38:31 -05:00
Mateo Tibaquira
22acc9fe9c docs: ng add @angular/material @angular/flex-layout 2021-02-07 23:32:19 -05:00
Mateo Tibaquira
7447d400bd docs: ng new website 2021-02-07 23:32:19 -05:00
Mateo Tibaquira
fa6f7c0767 JS: Fix the links in the README file 2021-02-07 23:31:43 -05:00
Mateo Tibaquira
f6917c9a7d JS: Improve typedef docblocks
Restored the jsdoc2md template usage for the Javascript README.md
2021-02-07 21:39:18 -05:00
Mateo Tibaquira
44a96f8c21 JS: Improve the documentation of FlexibleDateTime
Also moved the NPM commands to the package.json
so the makedoc scripts execute them in a central place.

Installed a jsdoc theme to improve the html output.
2021-02-07 20:42:05 -05:00
Mateo Tibaquira
21c053dbed JS: Refactor the build setup
The npm dependencies required are now
installed locally inside the generate folder.

Cleaned up the Astronomy object closure for TS
and kept it for the Browser bundle.

We will have some usage examples in the website.
2021-02-07 17:09:21 -05:00
Don Cross
e5726bfae6 JS: Fixed problems passing parameters to Search, and checking for failures.
The JavaScript version of Astronomy.Search was sometimes being passed
an incorrect 'options' parameter. It should always be either omitted
or passed in an object with the correct shape.

Also, there were places where Search failures, indicated by it
returning null, should cause an immediate exception.
2021-02-07 15:17:51 -05:00
Don Cross
35167c84aa Merge branch 'master' into typescript 2021-02-06 15:41:53 -05:00
Don Cross
8c53180f18 Fixed C# floating point parse/format issues in European cultures.
When built from a system with a European (or similar) culture setting
where a comma is used as a decimal marker instead of a period,
the C# unit tests and demos would fail.

Now explicitly specify InvariantCulture to resolve these problems.
2021-02-06 15:39:55 -05:00
Don Cross
d776c3d453 Enabled --strict option in TypeScript compiler. Fixed resulting errors.
Improved the type checking by using tsc --strict.
Nothing substatial changed in the generated JavaScript, and no
actual bugs were found, but I removed a lot of loose/sloppy
type signatures. This should make mistakes less likely
in the JavaScript code going forward.
2021-02-05 20:46:56 -05:00
Don Cross
c5738052b4 Starting to convert JavaScript code to TypeScript, and compiling it back to JavaScript.
The goal is to provide both TypeScript and JavaScript to developers.
Will also provide a type definition file once I figure that out.
This is just the first pass through the code.
It builds and passes all the unit tests, with some minor changes
to the generated README.md.
2021-02-04 22:12:49 -05:00
Don Cross
48b7ffe96e Fixed #81 - Upgraded C# projects from .NET Core 3.1 to .NET 5.0. 2021-02-03 14:52:55 -05:00
Don Cross
4337c1b62c Merge pull request #80 from matheo/netlify-integration
Integrate Netlify for Open Source projects.
2021-02-02 15:17:11 -05:00
Mateo Tibaquira
15387033c5 Integrate Netlify for Open Source projects 2021-02-02 12:43:19 -05:00
Don Cross
f34b700ce3 Updated copyrights for 2021. This resolves Travis CI broken build.
I forgot that my build process automatically updates
copyright years when the current year changes.
My Travis CI unit tests verify that there are no local
changes after running all the tests.
That test failed because the update_copyrights.py changed
all the "2019-2020" to "2019-2021".
2021-01-07 08:55:52 -05:00
Don Cross
14ff7519b5 Updated npm package to 1.1.3 to include full moon search fix. 2021-01-06 21:56:27 -05:00
Don Cross
246ac47d2b Fixed a failure to find a full moon using certain start dates.
In all four versions of Astronomy Engine (C, C#, JavaScript, and Python),
starting a search for a full moon near December 19, 2020 would fail.
I added a unit test to all four languages and it failed consistently
across them all.

The root cause: I was too optimistic about how narrow I could make
the window around the approximate moon phase time in the
SearchMoonPhase functions. Finding the exact moon phase time failed
because it was outside this excessively small window around the approximate
time. I increased the window from 1.8 days to 3.0 days.
This should handle all cases with minimal impact on performance.

Now all four of the new unit tests pass.
2020-12-18 14:29:41 -05:00
Don Cross
c58a59dabf Fixed #76 - Migrating from travis-ci.org to travis-ci.com. 2020-09-16 20:41:42 -04:00
Don Cross
d8e268e116 linux_riseset.c demo: Moon, Sun culmination.
Calculate the next Moon and Sun cumlination,
and include the altitude of the body above
the horizon at that moment.
2020-09-13 19:23:09 -04:00
Don Cross
b779a6aeca Added linux_riseset.c, a variation of riseset.c.
This new demo shows how to calculate rise and set times
of the Sun and Moon in local time, using Linux functions.
It also sorts the events in chronological order.
2020-09-08 21:40:05 -04:00
Don Cross
9dfa0285e2 Perform JavaScript unit tests on the minified code.
In order to verify that the minified code is valid, the
JavaScript unit tests should use it rather than the original
code. I must have changed back to using the normal code while
I was debugging something and forgot to change it back.
2020-08-31 11:34:20 -04:00
Don Cross
f6f9df369e Removed obsolete code generators.
I no longer need code generators for Chebyshev and TOP2013 models.
2020-08-26 20:21:36 -04:00
Don Cross
7183f9be30 Eliminated some more obsolete code I missed. 2020-08-25 18:01:28 -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
10d7821184 npm version 1.1.2 - Improved Pluto calculation.
The minimized code astronomy.min.js is now significantly smaller
because it uses a completely new algorithm for calculating
the position of Pluto. Instead of using TOP2013 formulas directly,
it simulates the gravitational forces on Pluto between 40
precalculated checkpoints spread over a 4000 year range.
2020-08-24 21:42:06 -04:00
Don Cross
9de3be62d3 Made a change to astronomy.cs template that didn't get checked in. 2020-08-24 21:06:50 -04:00
Don Cross
8f16f0a5ae Pluto integrator: finished porting to Python.
I believe this wraps up the Python integrator.
It now works in all 4 languages and passes all tests.
Fixed up demo tests to match new output.
Turned on Travis CI checking in this branch again.
2020-08-24 20:54:20 -04:00
Don Cross
1a2508f68b Pluto integrator: ported to JavaScript. 2020-08-24 14:14:32 -04:00
Don Cross
304d10fc97 Pluto integrator: ported to C#.
Ported Pluto integrator to C#.

Along the way, I noticed that I had VSOP87 latitude and longitude
swapped in such a way that they worked, but were labeled wrong.
This confused me quite a bit as I tried to implement functions
to calculate the derivatives of the VSOP87 spherical coordinates.
Fixed this in the code generator and the C and C# template files.
2020-08-23 20:49:10 -04:00