Skip to content

Commit

Permalink
Merge pull request sirocco-rt#1076 from smangham/issue1075-sphinx-pyp…
Browse files Browse the repository at this point in the history
…rogs

Document `py_progs` using Sphinx
  • Loading branch information
smangham authored May 24, 2024
2 parents dd77a1a + 418c42c commit 7374525
Show file tree
Hide file tree
Showing 122 changed files with 2,105 additions and 977 deletions.
3 changes: 3 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@ formats: all
# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
apt_packages:
- libhdf4-dev
tools:
python: "3.12"


# Optionally set the version of Python and requirements required to build your docs
python:
install:
Expand Down
5 changes: 3 additions & 2 deletions docs/sphinx/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
sphinx
sphinx-issues
sphinx==5.3.0
sphinx-issues==4.1.0
ipython
nbsphinx
sphinx-rtd-theme
Expand All @@ -11,3 +11,4 @@ scipy
sqlalchemy
jinja2==3.0.3
sphinx_gallery
pyhdf
19 changes: 14 additions & 5 deletions docs/sphinx/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,15 @@
'sphinx.ext.mathjax',
'sphinx.ext.ifconfig',
'sphinx.ext.githubpages',
'sphinx.ext.autosummary',
'sphinx.ext.todo',
'sphinx.ext.autosectionlabel',
'sphinx_issues',
'nbsphinx',
'IPython.sphinxext.ipython_console_highlighting',
'sphinx.ext.autodoc',
'sphinx.ext.autodoc.typehints',
'sphinx.ext.napoleon',
"sphinx_gallery.load_style",
]

Expand Down Expand Up @@ -74,17 +77,17 @@

# General information about the project.
project = 'python'
copyright = '2018-2023, Knox Long, Christian Knigge, Stuart Sim, Nick Higginbottom, James Matthews, Sam Mangham, Edward Parkinson, Mandy Hewitt'
copyright = '2018-2024, Knox Long, Christian Knigge, Stuart Sim, Nick Higginbottom, James Matthews, Sam Mangham, Edward Parkinson, Mandy Hewitt'
author = 'Knox Long, Christian Knigge, Stuart Sim, Nick Higginbottom, James Matthews, Sam Mangham, Edward Parkinson, Mandy Hewitt'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '86'
version = '88'
# The full version, including alpha/beta/rc tags.
release = '86g'
release = '88a'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand All @@ -101,6 +104,9 @@
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'

# Whether to include type hints in the doc, and where
autodoc_typehints = 'both'

# -- Options for HTML output ----------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
Expand Down Expand Up @@ -167,8 +173,11 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'python.tex', 'python Documentation',
'Knox Long, Christian Knigge, Stuart Sim, Nick Higginbottom, James Matthews, Sam Mangham, Edward Parkinson, Mandy Hewitt', 'manual'),
(
master_doc, 'python.tex', 'python Documentation',
author,
'manual'
),
]

# -- Options for manual page output ---------------------------------------
Expand Down
6 changes: 0 additions & 6 deletions docs/sphinx/source/config.py

This file was deleted.

6 changes: 4 additions & 2 deletions docs/sphinx/source/examples/demo-models/quasar/quasar.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ This particular document focuses on Model A from M20. As with most of the demo m

The wind is equatorial, and illuminated by an isotropic SED.

.. todo:: more description needed
.. note::

more description needed

Important Parameters
============================
Expand Down Expand Up @@ -42,4 +44,4 @@ Outputs
============================

References
============================
============================
2 changes: 1 addition & 1 deletion docs/sphinx/source/meta.rst
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ The above link contains full documentation of the commands. A module in py_progs

.. code :: rst
.. automodule:: py_read_output.py
.. automodule:: py_read_output
:members:
For this to work properly, docstrings have to be in a reasonable rst format. We might consider using the `napoleon extension <https://www.sphinx-doc.org/en/master/usage/extensions/napoleon.html>`_ if this is not to our taste.
Expand Down
85 changes: 8 additions & 77 deletions docs/sphinx/source/plotting/plot_spectrum.ipynb

Large diffs are not rendered by default.

166 changes: 14 additions & 152 deletions docs/sphinx/source/plotting/plot_wind.ipynb

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions docs/sphinx/source/py_progs.rst
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
Python Scripts
##############
################################

There are several `Python` (the scripting language) scripts written to prepare input for
There are several `Python` scripts written to prepare input for
and analyse the output of *python* (the C code).

Some of the more useful scripts/modules are documented below. Alternatively, you can generate documentation
for all the scripts by navigating to :code:`docs/pydocs` and running :code:`write_docs.py`. The resulting output file can be found `here <../../pydocs/doc_index.html>`_.
Some of the more useful scripts/modules are documented below.
Alternatively, you can generate documentation for all the scripts by navigating to :code:`docs/pydocs` and running :code:`write_docs.py`.
The resulting output file can be found `here <../../pydocs/doc_index.html>`_.

.. admonition :: Warning to user
The scripts documented here form an incomplete and inhomogenous list, in the sense that they have been developed by different people at different times and do not fit nicely together as a single python package. Some of the scripts should still be useful, particularly if you consult example notebookes, but use with caution!
The scripts documented here form an incomplete and inhomogenous list, in the sense that they have been developed by different people at different times and do not fit nicely together as a single python package.
Some of the scripts should still be useful, particularly if you consult example notebookes, but use with caution!
.. todo:: Finish adding modules below.
.. toctree::
:maxdepth: 2
:glob:

py_progs/plotting
py_progs/testing
py_progs/utilities
py_progs/py4py
py_progs/*
7 changes: 7 additions & 0 deletions docs/sphinx/source/py_progs/MakeMacro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,12 @@ without the -guess option to produce a final set of files
**Note that at present the routine does not handle the collisional x-sections, though this should be straightforward to add**


API Documentation
=================

.. autosummary::
:toctree: MakeMacro

MakeMacro
MacroCombine
RedoPhot
1 change: 1 addition & 0 deletions docs/sphinx/source/py_progs/MakeMacro.sphinx_cannot_doc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Macro2Simple
37 changes: 37 additions & 0 deletions docs/sphinx/source/py_progs/MakeMacro/MacroCombine.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
MacroCombine
============

.. automodule:: MacroCombine







.. rubric:: Functions

.. autosummary::

add_gtot
plot_xsec
read_phot
redo_lines
redo_phot
reweight
steer
write_phot
xguess













38 changes: 38 additions & 0 deletions docs/sphinx/source/py_progs/MakeMacro/MakeMacro.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
MakeMacro
=========

.. automodule:: MakeMacro







.. rubric:: Functions

.. autosummary::

calculate_oscillator_strength
doit
get_collisions
get_f
get_levels
get_lines
get_phot
make_phot
print_elvlc
write_phot













34 changes: 34 additions & 0 deletions docs/sphinx/source/py_progs/MakeMacro/RedoPhot.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
RedoPhot
========

.. automodule:: RedoPhot







.. rubric:: Functions

.. autosummary::

extrap
plot_phot
read_phot
redo_one
steer
write_phot_tab













33 changes: 33 additions & 0 deletions docs/sphinx/source/py_progs/development.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Developer Tools
---------------

Several scripts have been written to assist in developing and documenting **Python**.


Documentation
=============

.. autosummary::
:toctree: development

autogenerate_parameter_docs
autogenerate_rtd_pages
dox
dox_check



Development
===========

.. autosummary::
:toctree: development

add_param
update_param
run_indent
init_extern
make_rtheta
pf_check
CheckAtomic
retro
35 changes: 35 additions & 0 deletions docs/sphinx/source/py_progs/development/CheckAtomic.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
CheckAtomic
===========

.. automodule:: CheckAtomic







.. rubric:: Functions

.. autosummary::

analyze_lines
doit
get_element_table
get_ion_tab
get_level_tab
get_line_tab
xread













32 changes: 32 additions & 0 deletions docs/sphinx/source/py_progs/development/add_param.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
add\_param
==========

.. automodule:: add_param







.. rubric:: Functions

.. autosummary::

do_one
doit
read_file
read_table













Loading

0 comments on commit 7374525

Please sign in to comment.