Skip to content

Commit

Permalink
Create first implementation of docs
Browse files Browse the repository at this point in the history
  • Loading branch information
aknierim committed Oct 16, 2024
1 parent c74b41f commit 59be933
Show file tree
Hide file tree
Showing 20 changed files with 430 additions and 1 deletion.
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
2 changes: 2 additions & 0 deletions docs/_templates/autosummary/base.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{% extends "autosummary_core/base.rst" %}
{# The template this is inherited from is in astropy/sphinx/ext/templates/autosummary_core. If you want to modify this template, it is strongly recommended that you still inherit from the astropy template. #}
2 changes: 2 additions & 0 deletions docs/_templates/autosummary/class.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{% extends "autosummary_core/class.rst" %}
{# The template this is inherited from is in astropy/sphinx/ext/templates/autosummary_core. If you want to modify this template, it is strongly recommended that you still inherit from the astropy template. #}
2 changes: 2 additions & 0 deletions docs/_templates/autosummary/module.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{% extends "autosummary_core/module.rst" %}
{# The template this is inherited from is in astropy/sphinx/ext/templates/autosummary_core. If you want to modify this template, it is strongly recommended that you still inherit from the astropy template. #}
16 changes: 16 additions & 0 deletions docs/api-reference/cleaning/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.. _cleaning:

***************************************
Image Cleaning (`~radiotools.cleaning`)
***************************************

.. currentmodule:: radiotools.cleaning

Image cleaning module of radiotools.


Reference/API
=============

.. automodapi:: radiotools.cleaning
:inherited-members:
16 changes: 16 additions & 0 deletions docs/api-reference/gridding/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.. _gridding:

*********************************
Gridding (`~radiotools.gridding`)
*********************************

.. currentmodule:: radiotools.gridding

Gridding module of radiotools.


Reference/API
=============

.. automodapi:: radiotools.gridding
:inherited-members:
9 changes: 9 additions & 0 deletions docs/api-reference/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
*************
API Reference
*************

.. toctree::
:maxdepth: 1
:glob:

*/index
16 changes: 16 additions & 0 deletions docs/api-reference/layouts/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.. _layouts:

*******************************
Layouts (`~radiotools.layouts`)
*******************************

.. currentmodule:: radiotools.layouts

Layouts module of radiotools.


Reference/API
=============

.. automodapi:: radiotools.layouts
:inherited-members:
16 changes: 16 additions & 0 deletions docs/api-reference/measurements/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.. _measurements:

*****************************************
Measurements (`~radiotools.measurements`)
*****************************************

.. currentmodule:: radiotools.measurements

Measurements module of radiotools.


Reference/API
=============

.. automodapi:: radiotools.measurements
:inherited-members:
16 changes: 16 additions & 0 deletions docs/api-reference/utils/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.. _utils:

***************************
Utils (`~radiotools.utils`)
***************************

.. currentmodule:: radiotools.utils

Utils module of radiotools.


Reference/API
=============

.. automodapi:: radiotools.utils
:inherited-members:
16 changes: 16 additions & 0 deletions docs/api-reference/visibility/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.. _visibility:

*************************************
Visibility (`~radiotools.visibility`)
*************************************

.. currentmodule:: radiotools.visibility

Visibility module of radiotools.


Reference/API
=============

.. automodapi:: radiotools.visibility
:inherited-members:
5 changes: 5 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
**********
Change Log
**********

.. include:: ../CHANGES.rst
121 changes: 121 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
#!/usr/bin/env python3
import datetime
import sys
from pathlib import Path

import radiotools

if sys.version_info < (3, 11):
import tomli as tomllib
else:
import tomllib

pyproject_path = Path(__file__).parent.parent / "pyproject.toml"
pyproject = tomllib.loads(pyproject_path.read_text())

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
"sphinx.ext.todo",
"sphinx.ext.coverage",
"sphinx.ext.viewcode",
"sphinx_automodapi.automodapi",
"sphinx_automodapi.smart_resolver",
"matplotlib.sphinxext.plot_directive",
"numpydoc",
"sphinx_design",
"IPython.sphinxext.ipython_console_highlighting",
]

numpydoc_show_class_members = False
numpydoc_class_members_toctree = False

templates_path = ["_templates"]
exclude_patterns = [
"_build",
"Thumbs.db",
".DS_Store",
"changes",
"*.log",
]

source_suffix = ".rst"
master_doc = "index"


project = pyproject["project"]["name"]
author = pyproject["project"]["authors"][0]["name"]
copyright = "{}. Last updated {}".format(
author, datetime.datetime.now().strftime("%d %b %Y %H:%M")
)
python_requires = pyproject["project"]["requires-python"]

# make some variables available to each page
rst_epilog = f"""
.. |python_requires| replace:: {python_requires}
"""


version = radiotools.__version__
# The full version, including alpha/beta/rc tags.
release = version


# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = "pydata_sphinx_theme"
html_static_path = ["_static"]

html_file_suffix = ".html"


html_theme_options = {
"github_url": "https://github.com/radionets-project/radiotools",
"header_links_before_dropdown": 5,
"navbar_start": ["navbar-logo"],
"navigation_with_keys": False,
# "use_edit_page_button": True,
"icon_links_label": "Quick Links",
"icon_links": [
{
"name": "Radionets Project",
"url": "https://github.com/radionets-project",
"type": "url",
"icon": "https://avatars.githubusercontent.com/u/77392854?s=200&v=4", # noqa: E501
},
],
"announcement": """
<p>radiotools is not stable yet, so expect large and rapid
changes to structure and functionality as we explore various
design choices before the 1.0 release.</p>
""",
}

html_title = f"{project}"
htmlhelp_basename = project + "docs"


# Configuration for intersphinx
intersphinx_mapping = {
"astropy": ("https://docs.astropy.org/en/stable", None),
"ipywidgets": ("https://ipywidgets.readthedocs.io/en/stable", None),
"joblib": ("https://joblib.readthedocs.io/en/stable", None),
"matplotlib": ("https://matplotlib.org/stable", None),
"numba": ("https://numba.readthedocs.io/en/stable", None),
"numpy": ("https://numpy.org/doc/stable", None),
"pandas": ("https://pandas.pydata.org/pandas-docs/stable", None),
"pytest": ("https://docs.pytest.org/en/stable", None),
"python": ("https://docs.python.org/3", None),
"scipy": ("https://docs.scipy.org/doc/scipy", None),
"setuptools": ("https://setuptools.pypa.io/en/stable", None),
"sklearn": ("https://scikit-learn.org/stable", None),
}


suppress_warnings = [
"intersphinx.external",
]
7 changes: 7 additions & 0 deletions docs/developer-guide/getting-started.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.. _getting_started_dev:

******************************
Getting Started for Developers
******************************

We strongly recommend using the `Miniforge3 conda distribution <https://github.com/conda-forge/miniforge>`_.
10 changes: 10 additions & 0 deletions docs/developer-guide/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.. _dev-guide:

***************
Developer Guide
***************

.. toctree::
:maxdepth: 2

getting-started
99 changes: 99 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
.. include:: references.rst

:html_theme.sidebar_secondary.remove: true
:html_theme.sidebar_primary.remove: true

.. _radiotools:

##########################################
Tools for Radio Astronomy (``radiotools``)
##########################################

.. currentmodule:: radiotools


**Version**: |version| **Date**: |today|

**Useful links**:
`Source Repository <https://github.com/radionets-project/radiotools>`__ |
`Issue Tracker <https://github.com/radionets-project/radiotools/issues>`__ |

**License**: MIT

**Python**: |python_requires|


.. _radiotools_docs:

.. toctree::
:maxdepth: 1
:hidden:

user-guide/index
developer-guide/index
api-reference/index
changelog


.. grid:: 1 2 2 3

.. grid-item-card::

:octicon:`book;40px`

User Guide
^^^^^^^^^^

Learn how to get started as a user. This guide
will help you install radiotools.

+++

.. button-ref:: user-guide/index
:expand:
:color: primary
:click-parent:

To the user guide


.. grid-item-card::

:octicon:`person-add;40px`

Developer Guide
^^^^^^^^^^^^^^^

Learn how to get started as a developer.
This guide will help you install radiotools
for development and explains how to contribute.

+++

.. button-ref:: developer-guide/index
:expand:
:color: primary
:click-parent:

To the developer guide


.. grid-item-card::

:octicon:`code;40px`

API Reference
^^^^^^^^^^^^^

The API reference contains detailed
descriptions of of the modules, classes
and functions included in radiotools.

+++

.. button-ref:: api-reference/index
:expand:
:color: primary
:click-parent:

To the API reference
Loading

0 comments on commit 59be933

Please sign in to comment.