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 docs #91

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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 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 = 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/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
17 changes: 17 additions & 0 deletions docs/rtd_environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: lcm-docs
channels:
- conda-forge
dependencies:
- python=3.12
- pip
- setuptools_scm
- sphinx
- sphinxcontrib-bibtex
- sphinx-copybutton
- sphinx-design
- sphinx-panels
- myst-nb
- furo
- pip:
- ../
96 changes: 96 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# Configuration file for the Sphinx documentation builder. # noqa: INP001
#
# 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 = "lcm"
copyright = "2024, Tim Mensinger, Janos Gabler" # noqa: A001
author = "Tim Mensinger, Janos Gabler"


# Set variable so that todos are shown in local build
on_rtd = os.environ.get("READTHEDOCS") == "True"


# -- 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.todo",
"sphinx.ext.coverage",
"sphinx.ext.extlinks",
"sphinx.ext.intersphinx",
"sphinx.ext.mathjax",
"sphinx.ext.viewcode",
"sphinx.ext.napoleon",
"sphinx_copybutton",
"myst_nb",
"sphinx_panels",
"sphinx_design",
]

myst_enable_extensions = [
"colon_fence",
"dollarmath",
"html_image",
]

copybutton_prompt_text = ">>> "
copybutton_only_copy_prompt_lines = False

extlinks = {
"ghuser": ("https://github.com/%s", "@"),
"gh": ("https://github.com/optimagic-dev/optimagic/pulls/%s", "#"),
}

intersphinx_mapping = {
"numpy": ("https://docs.scipy.org/doc/numpy", None),
"pandas": ("https://pandas.pydata.org/pandas-docs/stable", None),
"python": ("https://docs.python.org/3.12", None),
"jax": ("https://jax.readthedocs.io/en/latest", None),
}

linkcheck_ignore = [
r"https://tinyurl\.com/*.",
]


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


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

# 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"]
4 changes: 4 additions & 0 deletions docs/source/development/changes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(changes)=

```{include} ../../../CHANGES.md
```
12 changes: 12 additions & 0 deletions docs/source/development/enhancement_proposals.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Enhancement Proposals

LCM Enhancement Proposals (EPs) can be used to discuss and design large changes.

These EPs are currently in place:

```{toctree}
---
maxdepth: 1
---
ep-00-refactoring.md
```
25 changes: 25 additions & 0 deletions docs/source/development/ep-00-refactoring.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
(ep-00)=

# EP-00: Refactoring

```{eval-rst}
+------------+------------------------------------------------------------------+
| Author | `Tim Mensinger <https://github.com/timmens>`_, |
| | `Janoś Gabler <https://github.com/janosg>`_ |
+------------+------------------------------------------------------------------+
| Status | Draft |
+------------+------------------------------------------------------------------+
| Type | Standards Track |
+------------+------------------------------------------------------------------+
| Created | 2024-09-06 |
+------------+------------------------------------------------------------------+
| Resolution | |
+------------+------------------------------------------------------------------+
```


## Abstract

This LEP proposes a refactoring of LCM's entry point using newly developed model block
classes. This will move LCM closer to a framework in which users have greater control
over all model aspects, e.g., the model solution and simulation.
9 changes: 9 additions & 0 deletions docs/source/development/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Development

```{toctree}
---
maxdepth: 1
---
enhancement_proposals
changes
```
10 changes: 10 additions & 0 deletions docs/source/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# LCM


```{toctree}
---
hidden: true
maxdepth: 1
---
development/index
```
Loading