Commit Graph

59 Commits

Author SHA1 Message Date
Don Cross
67dd5dc691 Attempt to make GitHub Actions run the same python I told it to install.
It looks like I have been running an unintended version of Python
from GitHub Actions.  In Linux/Mac I used `python3`, and in Windows
I used `py`. It appears that I should be executing `python` in
all 3 operating systems.

This is an experiment to see if I can get everyone on the same page.
2024-05-30 12:57:43 -04: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
Don Cross
a1c3f6be52 JS documentation: sort functions alphabetically.
The JavaScript functions were appearing in unsorted
order in the markdown documentation.
The `jsdoc2md` tool does not have an option for sorting them.
So I wrote a new script `sort_js_functions.py` that post-
processes the markdown to sort the functions.
2022-07-21 17:36:17 -04:00
Don Cross
e187707412 Patch version numbers using a Python program.
It turns out that "sed" does not work on Mac OS,
and I wasn't even trying to patch the version
numbers on Windows. I decided to write a Python
program for this task, so it will work identically
on all 3 operating systems.
2022-06-05 15:03:02 -04:00
Don Cross
1e9f1a7b05 Automatically patch version number.
Added a new file generate/version.txt that contains
the current Astronomy Engine version number.
Now when I run the build/test process, the version
number is patched in all the places it needs to
be changed to keep all the packages and documentation
up to date.

This means when I want to change the Astronomy Engine
version number, I just need to edit version.txt, then
execute the generate/run script.
2022-06-05 14:07:32 -04:00
Don Cross
74044b39d3 More Python/pip package cleanup : version 2.0.17.
Generate astronomy.py directly in the package directory.
I realized it doesn't make sense to generate it in the
parent directory and then copy it; just generate it where
it will end up anyway.

Updated documentation so people know they can just do

    pip install astronomy-engine

to install Astronomy Engine in their Python project.

Removed the GitHub Actions status badge because it is redundant with
the checkmark/X indicator.

Now that private symbols are no longer exported, I had to
fix a couple of places where the unit tests still accessed them.
2022-03-20 16:47:29 -04:00
Don Cross
2a92ad70c0 Fixed pip package. Added SiderealTime to pip, npm.
The pip package was broken!
I violated ancient software development wisdom:
"If you haven't tested it, it doesn't work."
It is now working in:

https://pypi.org/project/astronomy-engine/2.0.15/

Version 2.0.15 of Astronomy Engine for Python (pip)
and Node.js (npm) add support for the new SiderealTime
function. This was previously an internal function,
but now it is exposed for outside callers.
2022-03-20 13:42:16 -04:00
Don Cross
c86445ccce Mac fix: eliminate 'realpath' from makedoc script.
The program 'realpath' does not come installed on Mac OS.
This caused the bash script 'makedoc' to fail on Mac.
The only place I used realpath was to convert relative
paths to absolute paths for filenames passed to
check_internal_links.py.

It turns out Python has a standard function os.path.realpath()
that does the same thing, so I moved the logic into the
Python script itself. Thus makedoc no longer needs the
realpath program, and the Python function will work on
all platforms.

There is a general lesson here: in the future I will
consider moving more of my scripting logic into Python.
It has proven to be more portable than a mixture
of bash scripts and Windows batch files.
2021-12-30 11:08:09 -05:00
Don Cross
d1d34d5254 Enable generation of C documentation by default.
When building Astronomy Engine for publication,
I was disabling generation of C documentation by default,
because I used to have issues getting deterministic output
in the CI tests (GitHub Actions). Now I have reason to believe
it will work reliably, so I am turning on C docs generation
by default.

If this fails the CI test, I will have to make the CI test
explicitly disable this step until I figure out how to fix it.
Otherwise (and preferably) the CI test will ensure that the
published C documentation is always up to date, and will fail
the build if there are any issues generating the docs.

I also had forgotten to enable installing dependencies for
my custom tool `hydrogen` in the Windows build. I added a fix
for that.
2021-11-24 19:37:13 -05:00
Don Cross
91341df4a0 Moved website/tutorials to separate branch.
For now, I'm keeping beta/unfinished website and tutorial stuff
outside the master branch to reduce confusion for newcomers.
It will stay in the `tutorials` branch for any ongoing development.
If we finish it and make it ready for public use, then I will
bring it back into `master`.

Updated the `makedoc` script to gracefully skip steps
involving tutorials or website if they are absent.

Also, we were not installing packages needed for `hydrogen`
to generate C documentation. This broke document generation
on freshly-cloned repos.
2021-11-24 19:17:29 -05:00
Don Cross
aa334a0067 Moved code generation directories beneath 'generate'.
I'm trying to make it easier for first-time visitors to
this project to find the source code and documentation
to get started quickly. Moved directories that are only
used by contributors (mostly myself) out of the root
and into the 'generate' directory where they are less
distracting.
2021-11-23 21:23:54 -05:00
Don Cross
e03289a8cc Fixed #120 - google-closure-compiler now works on Raspberry Pi.
Worked around an issue where the npm package google-closure-compiler
assumes the current architecture is Intel x64.
This caused a broken install on the Raspberry Pi.
Detect non-Intel architecture and fall back to installing
only the Java version of the Closure compiler.
2021-09-18 21:56:02 -04:00
Don Cross
19aa193dc1 Fixed #95 - automate reporting of minified JavaScript size in documentation
Automatically update the front page README.md to include the current
byte size of astronomy.browser.min.js. Fail the build process if
this file ever grows to 100000 bytes or larger.
2021-04-04 19:49:38 -04:00
Don Cross
d5304651f2 C#: ObserverVector, vector operators, constant docs in Markdown.
Ported the ObserverVector function to C#, but it is not tested yet.

While doing that, I realized I needed a way to document newly public
constants DEG2RAD, RAD2DEG, and KM_PER_AU. This led to work
on the 'csdown' project that converts C# XML documentation
into Markdown format.

Then I realized a lot of code would be more elegant if
AstroVector had operator overloads for addition, subtraction,
and dot products.

This in turn required these operators to know which time value
to store in the AstroVector, which led to realizing that I
was sloppy in a lot of places and passed in null times.

So this whole commit contains a variety of unrelated topics,
which is something I don't usually do, but it felt
justified here while I'm in a refactoring mood.
2021-03-29 20:36:55 -04:00
Mateo Tibaquira
57d74555d7 JS: Fix JSON documentation removing absolute paths 2021-02-08 02:06:04 -05:00
Mateo Tibaquira
cc31072506 build: generate JSON documentation with JSDoc 2021-02-07 23:38:31 -05:00
Mateo Tibaquira
fa6f7c0767 JS: Fix the links in the README file 2021-02-07 23:31:43 -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
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
db9eb6b180 Maintain redundant copies of Astronomy Engine source in demo folders.
Windows does not support relative links in Git by default.
This broke the first-time experience for Windows users.
From now on I will maintain copies of the astronomy.js
and astronomy.py in the demo folders, so that the demos
will work on Windows immediately after cloning the repo.
2020-08-10 11:08:27 -04:00
Don Cross
d0699e828e doxygen: enable more warnings, eliminate unnecessary output.
Tell doxygen to warn (and fail) for undocumented parameters.
Tell doxygen to generate XML only, not LaTeX, HTML, etc.
2020-05-23 13:58:23 -04:00
Don Cross
93fdf9a146 C# rotation: added remaining rotation functions.
Fixed a couple of mistakes in the C documentation.
Turned on link checking for csharp markdown output.
2019-12-22 13:44:58 -05:00
Don Cross
1fde8049c6 Added check_internal_links.py utility to look for broken links in markdown files.
Currently I ignore any errors when checking the C# documentation,
because there are broken links for the rotation functions I
haven't started adding yet.  I will turn that error check back on
once I finish those functions.
2019-12-21 15:41:39 -05:00
Don Cross
0801769b35 C# doc: Starting to reflect in astronomy.dll. 2019-12-20 15:24:44 -05:00
Don Cross
96288bf014 Starting to add a C# utility for generating C# documentation.
I will need to use reflection into the astronomy.dll assembly,
along with the generated astronomy.xml, to generate Markdown
documentation. This is the start of that project.
2019-12-20 13:41:15 -05:00
Don Cross
54e886f1a5 C#: starting to work on documentation generator.
I was going to write a Python program to parse the
xml file generated by the C# compiler.
The problem is it does not contain enough information
about types, as explained here:

https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/xmldoc/how-to-use-the-xml-documentation-features

"The XML file does not provide full information about the type and members
(for example, it does not contain any type information).
To get full information about a type or member, the documentation file
must be used together with reflection on the actual type or member."

So that means I will end up writing the documentation generator in C#
and using reflection along with the XML file to generate Markdown.
2019-12-19 21:16:57 -05:00
Don Cross
3d38890aaf Merge branch 'master' into csharp.
Includes coordinate transform logic support in
C, JavaScript, and Python.
Will start porting to C# soon.
2019-12-19 14:28:09 -05:00
Don Cross
07e68707a6 Add prefix markdown to Python documentation. 2019-12-19 13:35:56 -05:00
Don Cross
7bff374d57 Starting to add support for generating C# code.
Decided to move call to makedoc script from run script.
It was confusing that it was hidden inside unit_test_js,
especially because it invokes the code generator for
all supported languages.
2019-10-10 14:56:49 -04:00
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
0e5dd8cee9 Include members-of-members in Python documentation. 2019-07-07 17:43:46 -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
e37d7e90f0 Trim trailing whitespace from python code. 2019-06-22 21:15:54 -04:00
Don Cross
fcb04cd40f Fixed #15 - Using Google Closure Compiler to minify astronomy.js. 2019-06-05 20:52:05 -04:00
Don Cross
83ec1a6b1a Fixed #43 - Trim trailing whitespace from source code before processing it.
This resolves an issue that sometimes messed up generating
markdown from C source code via doxygen and custom script hydrogen.js.
2019-06-03 15:08:10 -04:00
Don Cross
4e3abd0d9c Fixed #40 - Generate markdown from doxygen for C source code.
Got makedoc.bat to generate compatible documentation with
Linux makedoc script. Started to document all the stuff
developers have to install to work on this project.
2019-05-28 21:00:29 -04:00
Don Cross
57fea25f3a hydrogen: Added prefix template. Added internal links to items. 2019-05-27 19:41:53 -04:00
Don Cross
b23a0316a8 To find structs, need to process other xml files. Merge all xml.
It turns out it simplifies things to merge all the doxygen xml
files into a single all.xml file, then process that. That way
I can find all the struct definitions too.
2019-05-27 19:01:25 -04:00
Don Cross
f8001db8d0 More work on custom translation of doxygen xml to markdown. 2019-05-27 09:25:58 -04:00
Don Cross
63474a29d0 Work in progress: hydrogen 2019-05-26 21:22:23 -04:00
Don Cross
1ddff8f0d6 Work in progress: hydrogen = doxygen to markdown converter. 2019-05-26 21:16:25 -04:00
Don Cross
118a224921 Removing moxygen. I'm going to create my own custom doxygen-to-markdown. 2019-05-26 20:32:57 -04:00
Don Cross
d44eb1eed6 Removed apparently unnecessary moxygen option -l.
It looks like the '-l c' option does nothing when there is
an explicit template directory.
2019-05-26 17:52:53 -04:00
Don Cross
cbdef29197 Starting to experiment with moxygen custom templates.
I don't know if this is going to do what I want, but I'm
hoping I can customize the Markdown output generated by moxygen
to be useful for a simple C library like this. It appears to be
customized for a class-oriented C++ program.
2019-05-26 17:43:23 -04:00
Don Cross
e8708fd634 Giving up on Travis CI generating C documentation.
The version of doxygen supported in Travis CI appears to be
too old to work with moxygen.  This is just not worth the hassle.
I will generate documentation locally, and I will document to
any prospective contributors how to do so also.
2019-05-26 12:19:12 -04:00