Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Docs for scripts and standardize the docstrings #158

Merged
merged 9 commits into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions 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 = docs
BUILDDIR = docs/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)
7 changes: 7 additions & 0 deletions docs/analysis_doc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Analysis
--------

.. automodule:: scripts.analysis
:members:
:undoc-members:
:show-inheritance:
104 changes: 104 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys
sys.path.insert(0, os.path.abspath('../'))


# -- Project information -----------------------------------------------------

project = 'Transition Scenarios'
copyright = '2024, ARFC'
author = 'ARFC'

# The full version, including alpha/beta/rc tags
release = '0.01'


# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.

# myst_parser adds support for Markedly Structured Text, includes more features
# sphinx.ext.napoleon allows for a google/numpy docstring style
# sphinx.ext.duration represents time durations in a human-readable format
# sphinx.ext.autosectionlabel labels sections
# sphinx.ext.autodoc generates docs from docstrings
# sphinx.ext.autosummary generates summary tables of modules and packages
# sphinx.ext.intersphinx allows for linking to external documentation sites
# sphinx.ext.viewcode adds "View Source" links to docs
# sphinx.ext.mathjax renders mathematical expressions written in LaTeX
# sphinx.ext.coverage assesses and visualizing the test coverage
# nbsphinx includes Jupyter Notebooks in docs
# sphinxcontrib.mermaid create diagrams in markdown

extensions = ["myst_parser",
"sphinx.ext.napoleon",
"sphinx.ext.duration",
"sphinx.ext.autosectionlabel",
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx.ext.intersphinx",
"sphinx.ext.viewcode",
"sphinx.ext.mathjax",
"sphinx.ext.coverage",
"nbsphinx",
"sphinxcontrib.mermaid"]

# Suffixes that are useable
# source_suffix = {
# '.rst': 'restructuredtext',
# '.txt': 'markdown',
# '.md': 'markdown',
# }

# make sure you have a unique autolabelled target
autosectionlabel_prefix_document = True
# Sphinx will create explicit targets for all your sections, the name of target
# has the form {path/to/page}:{title-of-section}.

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

# List of modules to be mocked up.
autodoc_mock_imports = ['pyne', 'd3ploy', 'seaborn', 'xmltodict',
'dataframe_analysis', 'predicting_the_past_import',
'create_AR_DeployInst']

intersphinx_mapping = {
'python': ('https://docs.python.org/3', None),
'pandas': ('https://pandas.pydata.org/docs/', None),
'numpy': ('https://numpy.org/doc/stable/', None),
'astropy': ('https://docs.astropy.org/en/stable/', None),
'cyclus': ('https://fuelcycle.org/', None),
}


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

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'alabaster'

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['source/_static']
7 changes: 7 additions & 0 deletions docs/create_ar_deployinst_doc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Create AR DeployInst
--------------------

.. automodule:: scripts.create_AR_DeployInst
:members:
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions docs/create_cyclus_input_doc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Create Cyclus Input
-------------------

.. automodule:: scripts.create_cyclus_input
:members:
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions docs/dakota_input_doc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Dakota Input
------------

.. automodule:: scripts.dakota_input
:members:
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions docs/dataframe_analysis_doc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Dataframe Analysis
------------------

.. automodule:: scripts.dataframe_analysis
:members:
:undoc-members:
:show-inheritance:
55 changes: 55 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<!-- Transition Scenarios documentation master file, created by
sphinx-quickstart on Mon Feb 19 13:18:08 2024.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive. -->

# Welcome to Transition Scenarios's documentation!

```{toctree}
:maxdepth: 1

scripts_outline
analysis_doc
create_ar_deployinst_doc
create_cyclus_input_doc
dakota_input_doc
dataframe_analysis_doc
merge_coordinates_doc
output_metrics_doc
predicting_the_past_import_doc
random_lifetime_extension_doc
transition_metrics_doc
transition_plots_doc
```

# Indices and tables

- {ref}`genindex`
- {ref}`modindex`
- {ref}`search`


# Building the Docs
To compile the documentation, make sure you have all the requirements
installed, then run `make html` from the top level of the repository.

```{warning}
The docs are still in their nascent stage. If you find a
problem, please open an issue on
[github](https://github.com/arfc/transition-scenarios/issues).
```

## Docs Requirements
* sphinx
* myst_parser
* sphinx.ext.napoleon
* sphinx.ext.duration
* sphinx.ext.autosectionlabel
* sphinx.ext.autodoc
* sphinx.ext.autosummary
* sphinx.ext.intersphinx
* sphinx.ext.viewcode
* sphinx.ext.mathjax
* sphinx.ext.coverage
* nbsphinx
* sphinxcontrib.mermaid
7 changes: 7 additions & 0 deletions docs/merge_coordinates_doc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Merge Coordinates
-----------------

.. automodule:: scripts.merge_coordinates
:members:
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions docs/output_metrics_doc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Output Metrics
--------------

.. automodule:: scripts.output_metrics
:members:
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions docs/predicting_the_past_import_doc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Predicting the Past
-------------------

.. automodule:: scripts.predicting_the_past_import
:members:
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions docs/random_lifetime_extension_doc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Random Lifetime Extension
-------------------------

.. automodule:: scripts.random_lifetime_extension
:members:
:undoc-members:
:show-inheritance:
4 changes: 4 additions & 0 deletions docs/scripts_outline.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Scripts Outline

```{include} ../scripts/scripts_README.md
```
7 changes: 7 additions & 0 deletions docs/transition_metrics_doc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Transition Metrics
------------------

.. automodule:: scripts.transition_metrics
:members:
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions docs/transition_plots_doc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Transition Plots
----------------

.. automodule:: scripts.transition_plots
:members:
:undoc-members:
:show-inheritance:
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
35 changes: 35 additions & 0 deletions make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=docs
set BUILDDIR=docs/build

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

if "%1" == "" goto help

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ pandas
pytest
matplotlib
tables
sphinx
m2r2
fuzzywuzzy
Loading