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

Add sphinx doc #202

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
a99afe1
DOC: Add sphinx doc, initial commit
KybernetikJo Jul 26, 2023
d0a0d2d
DOC: Add examples
KybernetikJo Jul 26, 2023
224221e
Update gitignore
KybernetikJo Jul 26, 2023
c764077
DOC: Add slicot and slycot inspection
KybernetikJo Jul 26, 2023
4045036
Update inspection notebooks
KybernetikJo Aug 8, 2023
8427bc0
Update development info
KybernetikJo Aug 8, 2023
0727127
Improve inspection notebooks, Minor update of docs
KybernetikJo Aug 8, 2023
a4d302b
Remove SLICOT help html files from _static, add link to online SLICOT…
KybernetikJo Aug 9, 2023
0450153
Update outer and inner function reference
KybernetikJo Aug 9, 2023
90e328f
Update inpect_notebooks, Update create names for Slycot reference.
KybernetikJo Aug 17, 2023
d7f56e6
Update inpection notebooks
KybernetikJo Aug 18, 2023
61ed3d2
Add code to get info of release and version from git tags
KybernetikJo Aug 25, 2023
501e5e5
Update doc/source to add new routines
KybernetikJo Aug 25, 2023
6e67460
Add check_names, checks if all routines are added in sphinx help
KybernetikJo Aug 26, 2023
b6b4579
Add ag08bd, add sb10yd to help
KybernetikJo Aug 26, 2023
62696c4
Add new routines to sphinx doc
KybernetikJo Jan 9, 2024
c542a90
Pump sphinx doc requirements
KybernetikJo Jan 9, 2024
ec834fc
Update slycot inpect notebooks
KybernetikJo Jan 9, 2024
c08b251
Automate update of year in copyright
KybernetikJo Jan 9, 2024
7bd444d
Change doc organization to diataxis approach
KybernetikJo Jan 18, 2024
d850266
Add sphinx-copybutton
KybernetikJo Jan 19, 2024
e5765c7
Update venn diagramm in inpect notebooks
KybernetikJo Apr 4, 2024
9b6b178
Update ho-to-guides examples
KybernetikJo Apr 4, 2024
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
doc/_build
doc/generated
doc/source/reference/generated/
.DS_Store*
MANIFEST
dist/
Expand All @@ -12,3 +15,4 @@ build.log
*~
setup.cfg
_skbuild

20 changes: 20 additions & 0 deletions doc/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 doc/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
13 changes: 13 additions & 0 deletions doc/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
sphinx>=7.2.6
sphinx-copybutton
numpy
scipy
pandas
matplotlib
matplotlib_venn
sphinx_rtd_theme>=2.0.0
numpydoc
ipykernel
nbsphinx
docutils
#docutils==0.16 # pin until sphinx_rtd_theme is compatible with 0.17 or later
50 changes: 50 additions & 0 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# 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
import os
import sys
sys.path.insert(0, os.path.abspath('../slycot'))

master_doc = "index"
from datetime import date
project = 'Slycot'
copyright = f'{date.today().year}, Slycot Developers'
author = 'Slycot Developers'

# Version information - read from the source code
import re

# Get the version number for this commmit (including alpha/beta/rc tags)
release = re.sub('^v', '', os.popen('git describe --tags').read().strip())

# The short X.Y.Z version
version = re.sub(r'(\d+\.\d+\.\d+(.post\d+)?)(.*)', r'\1', release)

print("version %s, release %s" % (version, release))

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

extensions = [
'sphinx.ext.autodoc', 'sphinx.ext.todo', 'sphinx.ext.napoleon',
'sphinx.ext.intersphinx', 'sphinx.ext.imgmath',
'sphinx.ext.autosummary', 'nbsphinx', 'numpydoc',
'sphinx.ext.doctest', 'sphinx_copybutton'
]
# scan documents for autosummary directives and generate stub pages for each.
autosummary_generate = True

templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']



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

html_theme = 'sphinx_rtd_theme'
html_static_path = ['_static']
30 changes: 30 additions & 0 deletions doc/source/contributing/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
.. this page is referenced from the front page but it's unnecessary as a navigation section for now.

:orphan:

Contributing to Slycot
======================

Development process and tools
-----------------------------

The development process is currently described on the `slycot github repo <https://github.com/python-control/Slycot>`_ and the `slycot github wiki <https://github.com/python-control/Slycot/wiki>`_.
You should be familiar with following topics:

- `git <https://git-scm.com/>`_
- `github <https://skills.github.com/>`_
- `Sphinx <https://www.sphinx-doc.org/en/master/index.html>`_
- `reStructuredText <https://www.sphinx-doc.org/en/master/usage/restructuredtext/index.html>`_
- `numpydoc <https://numpydoc.readthedocs.io/en/latest/>`_
- `f2py <https://numpy.org/devdocs/f2py/index.html>`_

numpydoc
--------

Slycot uses numpydoc for the docstring style in order to provide support the Numpy docstring format in sphinx,
`see numpydoc example <https://numpydoc.readthedocs.io/en/latest/example.html>`_.

F2PY
----

Slycot heavily relias on `F2PY <https://numpy.org/devdocs/f2py/index.html>`_, which is currently a part of `NumPy <http://www.numpy.org>`_.
12 changes: 12 additions & 0 deletions doc/source/explanation/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.. this page is referenced from the front page but it's unnecessary as a navigation section for now.

:orphan:

Inspect
=======

.. toctree::
:maxdepth: 1

inspect_slycot
inspect_slicot_slycot
Loading
Loading