Skip to content

Commit

Permalink
Merge pull request #48 from anissa111/main
Browse files Browse the repository at this point in the history
First pass at documentation
  • Loading branch information
rmshkv authored Jan 18, 2024
2 parents 5ca6b44 + f339ab9 commit e5750b3
Show file tree
Hide file tree
Showing 8 changed files with 193 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ cupid.egg-info
**/*.swp

externals/

# Documentation
/docs/_build/
12 changes: 12 additions & 0 deletions build_envs/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: cupid-docs
channels:
- conda-forge
dependencies:
- python>=3.9,<3.12
- ipykernel
- ipython
- jupyter_client
- sphinx-book-theme
- myst-nb
- sphinx-design
- nbsphinx
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)
Binary file added docs/_static/images/logos/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
113 changes: 113 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
# 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
import datetime
sys.path.insert(0, os.path.abspath('../..'))

print("sys.path:", sys.path)

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

project = 'CUPiD'

current_year = datetime.datetime.now().year
copyright = u'{}, University Corporation for Atmospheric Research'.format(
current_year)

author = 'NSF NCAR'

# The master toctree document.
master_doc = 'index'


# -- 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.

extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.napoleon',
'sphinx.ext.autosummary',
'sphinx.ext.intersphinx',
'myst_nb',
"sphinx_design",
"nbsphinx",
]

intersphinx_mapping = {
'dask': ('https://docs.dask.org/en/latest/', None),
'python': ('http://docs.python.org/3/', None),
'numpy': ("https://numpy.org/doc/stable", None),
'scipy': ('https://docs.scipy.org/doc/scipy/reference/', None),
'xarray': ('http://xarray.pydata.org/en/stable/', None),
'pint': ('https://pint.readthedocs.io/en/stable/', None),
'cftime': ('https://unidata.github.io/cftime/', None),
}

autosummary_generate = True

# 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 = ['**.ipynb_checkpoints']

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
# source_suffix = ['.rst', '.md']
source_suffix = {
'.rst': 'restructuredtext',
'.ipynb': 'myst-nb',
}


# -- 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 = "sphinx_book_theme"
html_title = ""

autosummary_imported_members = True

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
html_theme_options = dict(
# analytics_id='' this is configured in rtfd.io
# canonical_url="",
repository_url="https://github.com/NCAR/CUPiD",
repository_branch="main",
path_to_docs="docs",
use_edit_page_button=True,
use_repository_button=True,
use_issues_button=True,
home_page_in_toc=False,
extra_footer=
"<em>The National Center for Atmospheric Research is sponsored by the National Science Foundation. Any opinions, findings and conclusions or recommendations expressed in this material do not necessarily reflect the views of the National Science Foundation.</em>",
)

# 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 = ['_static']

html_logo = '_static/images/logos/logo.png'
html_favicon = '_static/images/logos/logo.png'

autoclass_content = 'both'
8 changes: 8 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CUPiD Documentation
===================

.. toctree::
:maxdepth: 2
:hidden:

Installation Guide <install.rst>
2 changes: 2 additions & 0 deletions docs/install.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Installing CUPiD
================
35 changes: 35 additions & 0 deletions docs/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=.
set BUILDDIR=_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

0 comments on commit e5750b3

Please sign in to comment.