Skip to content

Commit

Permalink
another attmept
Browse files Browse the repository at this point in the history
  • Loading branch information
Sceki committed Nov 25, 2024
1 parent beba332 commit 18c7dc1
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 2 deletions.
35 changes: 35 additions & 0 deletions doc/_templates/custom-class-template.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{{ fullname | escape | underline}}

.. currentmodule:: {{ module }}

.. autoclass:: {{ objname }}
:members:
:special-members: __init__, __call__

{% block methods %}
{# We go through this circumlocution because __call__ for some reason #}
{# does not show up in the list of methods, only in the list of members. #}
{# If we do not do this, the full documentation of __call__ will show up, #}
{# but its entry in autosummary will not. #}
{% if methods or '__call__' in members %}
.. rubric:: {{ _('Methods') }}

.. autosummary::
{% for item in members %}
{% if item in methods or item == '__call__' %}
~{{ name }}.{{ item }}
{% endif %}
{%- endfor %}
{% endif %}
{% endblock %}

{% block attributes %}
{% if attributes %}
.. rubric:: {{ _('Attributes') }}

.. autosummary::
{% for item in attributes %}
~{{ name }}.{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}
14 changes: 12 additions & 2 deletions doc/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ API
$\partial$SGP4 API

.. autosummary::
:toctree: _autosummary
:maxdepth: 3
:toctree: _autosummary/
:recursive:

dsgp4
dsgp4.plot.plot_orbit
Expand Down Expand Up @@ -49,4 +49,14 @@ $\partial$SGP4 API
dsgp4.sgp4init.sgp4init
dsgp4.sgp4init_batch.sgp4init_batch
dsgp4.sgp4init_batch.initl_batch
dsgp4.mldsgp4
dsgp4.initl
dsgp4.newton_method
dsgp4.sgp4init
dsgp4.sgp4init_batch

.. autosummary::
:toctree: _autosummary
:template: custom-class-template.rst

dsgp4.mldsgp4.mldsgp4
1 change: 1 addition & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
extensions = ["myst_nb", "sphinx.ext.autodoc", "sphinx.ext.doctest", "sphinx.ext.intersphinx", "sphinx.ext.autosummary","sphinx.ext.napoleon"]

autosummary_generate = True
autosummary_imported_members = True
napoleon_google_docstring = True
napoleon_numpy_docstring = False

Expand Down

0 comments on commit 18c7dc1

Please sign in to comment.