Skip to content

Commit fe63d3b

Browse files
committed
Build docs
1 parent 3328c57 commit fe63d3b

File tree

12 files changed

+284
-79
lines changed

12 files changed

+284
-79
lines changed

.github/workflows/documentation.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Based on https://github.com/actions/starter-workflows/blob/main/pages/static.yml
2+
name: documentation
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: write
12+
pages: write
13+
id-token: write
14+
15+
jobs:
16+
docs:
17+
environment:
18+
name: github-pages
19+
url: ${{ steps.deployment.outputs.page_url }}
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v4
23+
- name: Set up Python for Docs
24+
uses: actions/setup-python@v5
25+
with:
26+
python-version: '3.x'
27+
- name: Install mssmViz & dependencies
28+
run: |
29+
python -m pip install --upgrade pip
30+
pip install .
31+
- name: Install sphinx
32+
run: |
33+
pip install sphinx sphinx-rtd-theme
34+
- name: Build Docs
35+
run: |
36+
sphinx-build docs docs/_build
37+
- name: Upload artifact
38+
uses: actions/upload-pages-artifact@v3
39+
with:
40+
path: './docs/_build'
41+
- name: Deploy to GitHub Pages
42+
id: deployment
43+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,4 +160,5 @@ cython_debug/
160160
#.idea/
161161
/.db/*
162162

163-
*tests.*
163+
*tests.*
164+
.DS_store

1) GAMMs.ipynb

Lines changed: 52 additions & 41 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# mssmViz
22

3+
![Docs](https://github.com/jokra1/mssm_tutorials/actions/workflows/documentation.yml/badge.svg?branch=main)
4+
35
## Description
46

5-
Plotting functions for the Mixed Sparse Smooth Models ([mssm](https://github.com/JoKra1/mssm)) toolbox. ``mssm`` is a toolbox to estimate Generalized Additive Mixed Models (GAMMs), Generalized Additive Mixed Models of Location Scale and Shape (GAMMLSS), and even more general smooth models in the sense defined by [Wood, Pya, & Säfken (2016)](https://doi.org/10.1080/01621459.2016.1180986). In addition, a tutorial for ``mssm`` is provided with this repository.
7+
Plotting functions for the Mixed Sparse Smooth Models ([mssm](https://github.com/JoKra1/mssm)) toolbox. ``mssm`` is a toolbox to estimate Generalized Additive Mixed Models (GAMMs), Generalized Additive Mixed Models of Location Scale and Shape (GAMMLSS), and even more general smooth models in the sense defined by [Wood, Pya, & Säfken (2016)](https://doi.org/10.1080/01621459.2016.1180986). In addition, a tutorial for ``mssm`` is provided with this repository. **Documentation** for ``mssmViz`` is hosted [here](https://jokra1.github.io/mssm_tutorials/index.html).
68

79
## Installation
810

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = source
9+
BUILDDIR = build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/conf.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# For the full list of built-in configuration values, see the documentation:
4+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
5+
6+
# path
7+
import os
8+
import sys
9+
10+
sys.path.insert(0, os.path.abspath('..'))
11+
12+
# -- Project information -----------------------------------------------------
13+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
14+
15+
project = 'mssmViz'
16+
copyright = '2025, Joshua Krause'
17+
author = 'Joshua Krause'
18+
19+
# -- General configuration ---------------------------------------------------
20+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
21+
22+
extensions = ['sphinx.ext.autodoc']
23+
24+
templates_path = ['_templates']
25+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
26+
27+
28+
29+
# -- Options for HTML output -------------------------------------------------
30+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
31+
32+
html_theme = 'sphinx_rtd_theme'
33+
34+
html_theme_options = {
35+
36+
# Toc options
37+
'collapse_navigation': False,
38+
'sticky_navigation': True,
39+
'navigation_depth': 8
40+
}
41+
42+
43+
html_static_path = ['_static']

docs/index.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
.. mssmViz documentation master file, created by
2+
sphinx-quickstart on Thu Jan 9 18:52:26 2025.
3+
You can adapt this file completely to your liking, but it should at least
4+
contain the root `toctree` directive.
5+
6+
mssmViz documentation
7+
=====================
8+
9+
This is the documentation of ``mssmViz``. The entire source code is available for inspection on `GitHub <https://github.com/JoKra1/mssm_tutorials>`_.
10+
``mssmViz`` contains code to extract information from (:mod:`mssmViz.src.extract`), to visualize, & and to validate (:mod:`mssmViz.src.plot`) smooth models estimated via the `mssm <https://github.com/JoKra1/mssm>`_ Python toolbox for estimating Generalized Additive Mixed Models (GAMMs), Generalized Additive Mixed Models of Location Scale
11+
and Shape (GAMMLSS), and more general (mixed) smooth models in the sense defined by `Wood, Pya, & Säfken (2016) <https://doi.org/10.1080/01621459.2016.1180986>`_.
12+
13+
Approximate estimation (and automatic regularization) of the latter only requires users to provide the (gradient of) the log-likelihood.
14+
Furthermore, ``mssm`` is an excellent choice for the modeling of multi-level time-series data, often estimating additive models with separate smooths for thousands of levels in a couple of minutes.
15+
16+
Use the side-bar on the left to navigate through the document tree.
17+
18+
19+
.. toctree::
20+
:maxdepth: 2
21+
:caption: Contents:
22+
23+
modules

docs/make.bat

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=.
11+
set BUILDDIR=_build
12+
13+
%SPHINXBUILD% >NUL 2>NUL
14+
if errorlevel 9009 (
15+
echo.
16+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
17+
echo.installed, then set the SPHINXBUILD environment variable to point
18+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
19+
echo.may add the Sphinx directory to PATH.
20+
echo.
21+
echo.If you don't have Sphinx installed, grab it from
22+
echo.https://www.sphinx-doc.org/
23+
exit /b 1
24+
)
25+
26+
if "%1" == "" goto help
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33+
34+
:end
35+
popd

docs/modules.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
src
2+
===
3+
4+
.. toctree::
5+
:maxdepth: 4
6+
7+
mssmViz

docs/mssmViz.rst

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
mssmViz package
2+
===============
3+
4+
Submodules
5+
----------
6+
7+
mssmViz.extract module
8+
----------------------
9+
10+
.. automodule:: mssmViz.extract
11+
:members:
12+
:undoc-members:
13+
:show-inheritance:
14+
15+
mssmViz.plot module
16+
-------------------
17+
18+
.. automodule:: mssmViz.plot
19+
:members:
20+
:undoc-members:
21+
:show-inheritance:
22+
23+
mssmViz.sim module
24+
------------------
25+
26+
.. automodule:: mssmViz.sim
27+
:members:
28+
:undoc-members:
29+
:show-inheritance:

0 commit comments

Comments
 (0)