Commit Graph

12 Commits

Author SHA1 Message Date
Don Cross
d3a2596e4c Exclude Any type from Python documentation.
Now that we use Python type hints, I discovered that
Python 3.11.2 includes the placeholder type `Any`
in the metadata reflected by `importlib`.
In order to generate consistent documentation with
older versions of Python, I exclude `Any` if it is present.

This change affects only the documentation and has
no effect on the Astronomy Engine package itself.
2023-03-22 12:23:10 -04: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
fa3b90678e Work around inconsistent type signatures in Python.
My custom Markdown generator for Python documentation `pydown`
was generating inconsistent function type signatures depending
on the version of Python executing it. This happened for functions
like `Search` that return either Time or None.

On older Pythons we see "Optional[astronomy.Time]".
On newer Pythons we see "Union[astronomy.Time, NoneType]".
This caused unit test failures on GitHub Actions when I check in changes.

I prefer to see Optional[x] over Union[x, NoneType], so I hacked
pydown to replace this using a regex substitution.
2023-02-20 10:32:55 -05:00
Don Cross
da14856a19 Pydown fix: more reliable way to extract list of imported symbols. 2023-02-19 15:47:46 -05:00
ris-tlp
7818a6ce38 Python: Fixing multiple imports within same line bug 2023-02-15 00:56:18 -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
Don Cross
137fc5ce7b Python docs: better formatting of return values. 2022-05-25 17:23:41 -04:00
Don Cross
f02658d63c More documentation fixes.
Corrected a mistake in the explanation of the
C function Astronomy_GravSimInit: the `bodyStates`
parameter is NOT barycentric -- it is relative to the
originBody parameter.

Python had improperly formatted documentation for
Time.FromTerrestrialTime parameter `tt`.

The Python markdown generator `pydown` did not
correctly handle links to compound symbols like
`#GravitySimulator.Update`. It also was trying
to link to `StateVector[]` instead of `StateVector`.

Removed unnecessary and unhelpful documentation
for C# internal class constructors. They do not appear
in the generated markdown documentation anyway.

Other minor wording revisions in the documentation.
2022-05-25 14:12:55 -04:00
Don Cross
68f118587d PY gravim: work in progress.
Started implementation of the Python gravity simulator.
Updated the `pydown` markdown generator to include
class constructors `__init__` when they contain docstrings.
2022-05-21 23:23:29 -04:00
Don Cross
6cfd5d467b Fix generating markdown docs for Python.
In Windows I am running Python 3.7.8.
For some reason, it fails to write Unicode Greek letters
I use in the Markdown documentation unless I explicitly
specify to use utf-8 encoding. I thought that was the default,
because it works fine in Linux running 3.9.2.
I'm not sure whether the issue is due to Windows or
to a change in the Python version. Regardless, I am
explicitly specifying the file encoding to make the
documentation translator I wrote (pydown.py) work.
2021-12-03 22:25:53 -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