Skip to content

Commit

Permalink
Very preliminary effort at starting sphinx docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jranalli committed Jul 15, 2024
1 parent f37fd7f commit 94b9d3c
Show file tree
Hide file tree
Showing 10 changed files with 215 additions and 1 deletion.
20 changes: 20 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

build:
os: "ubuntu-22.04"
tools:
python: "3.10"

python:
install:
- method: pip
path: .

sphinx:
configuration: docs/sphinx/source/conf.py
fail_on_warning: true
20 changes: 20 additions & 0 deletions docs/sphinx/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 = source
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)
35 changes: 35 additions & 0 deletions docs/sphinx/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=source
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
11 changes: 11 additions & 0 deletions docs/sphinx/source/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
API
===

.. autosummary::
:toctree: generated

solartoolbox.cmv
solartoolbox.field

.. toctree::
solartoolbox
7 changes: 7 additions & 0 deletions docs/sphinx/source/cmv.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
solartoolbox.cmv module
-----------------------

.. automodule:: solartoolbox.cmv
:members:
:undoc-members:
:show-inheritance:
47 changes: 47 additions & 0 deletions docs/sphinx/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = 'solartoolbox'
copyright = '2024, Joe Ranalli'
author = 'Joe Ranalli'

release = '0.4'
version = '0.4.1'

import os
import sys
sys.path.insert(0, os.path.abspath(os.path.join('..', '..', '..', 'src')))

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

extensions = ['sphinx.ext.duration',
'sphinx.ext.doctest',
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.intersphinx',
]

intersphinx_mapping = {
'python': ('https://docs.python.org/3/', None),
'sphinx': ('https://www.sphinx-doc.org/en/master/', None),
}

templates_path = ['_templates']



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

html_theme = 'alabaster'
html_static_path = ['_static']


# -- Options for EPUB output
epub_show_urls = 'footnote'
7 changes: 7 additions & 0 deletions docs/sphinx/source/field.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
solartoolbox.field module
-------------------------

.. automodule:: solartoolbox.field
:members:
:undoc-members:
:show-inheritance:
16 changes: 16 additions & 0 deletions docs/sphinx/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.. solartoolbox documentation master file, created by
sphinx-quickstart on Mon Jul 15 15:04:14 2024.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
solartoolbox documentation
==========================

Add your content using ``reStructuredText`` syntax. See the
`reStructuredText <https://www.sphinx-doc.org/en/master/usage/restructuredtext/index.html>`_
documentation for details.


.. toctree::
api

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

.. CMV
---
See the :py:mod:`~solartoolbox.cmv` module
.. Field
-----
..
See the :py:mod:`~solartoolbox.field` module


solartoolbox.irradiance module
------------------------------

.. automodule:: solartoolbox.irradiance
:members:
:undoc-members:
:show-inheritance:

solartoolbox.signalproc module
------------------------------

.. automodule:: solartoolbox.signalproc
:members:
:undoc-members:
:show-inheritance:

solartoolbox.spatial module
---------------------------

.. automodule:: solartoolbox.spatial
:members:
:undoc-members:
:show-inheritance:

solartoolbox.stats module
-------------------------

.. automodule:: solartoolbox.stats
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: solartoolbox
:members:
:undoc-members:
:show-inheritance:
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@
'scipy'
],
license='BSD (3 Clause)',
extras_require=dict(tests=['pytest'], demos=['matplotlib', 'jupyter']),
extras_require=dict(tests=['pytest'], demos=['matplotlib', 'jupyter'], docs=['sphinx']),
)

0 comments on commit 94b9d3c

Please sign in to comment.