Skip to content

Commit

Permalink
first version of documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiaskoenig committed Oct 22, 2019
1 parent 3f7442e commit 126d039
Show file tree
Hide file tree
Showing 12 changed files with 321 additions and 28 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ __pycache__
.ipynb_checkpoints/
.pytest_cache

# documentation
docs/_build/

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)
11 changes: 11 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Documentation

To create the documentation use
```
(sbmlsim) pip install -r requirements-docs.txt
(sbmlsim) cd docs
(sbmlsim) ./make_docs.sh
```

The documentation is build using `sphinx` with the
[sphinx-rtd-theme](https://sphinx-rtd-theme.readthedocs.io/en/latest/configuring.html)
28 changes: 0 additions & 28 deletions docs/Vision.md

This file was deleted.

54 changes: 54 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# 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
# sys.path.insert(0, os.path.abspath('.'))


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

project = 'sbmlsim'
copyright = '2019, Matthias König'
author = 'Matthias König'


# -- 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 = [
'recommonmark',
'sphinx_rtd_theme',
]

# 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 = ['_build', 'Thumbs.db', '.DS_Store']


# -- 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_rtd_theme'

# 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']
23 changes: 23 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.. sbmlsim documentation master file, created by
sphinx-quickstart on Tue Oct 22 08:52:36 2019.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to sbmlsim's documentation!
===================================

.. toctree::
:maxdepth: 2
:caption: Contents:

overview
notebooks/simjson.rst



Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
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

if "%1" == "" goto help

%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.http://sphinx-doc.org/
exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
53 changes: 53 additions & 0 deletions docs/make_docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/bin/bash
###############################################################
# Build script for tellurium documentation from rst files and
# python docstrings in the tellurium package
#
# execute this script in the docs folder i.e., after
# cd tellurium/docs
#
# Usage:
# ./make_docs.sh 2>&1 | tee ./make_docs.log
#
# The documentation is written in docs/_build
###############################################################
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )

date
echo "--------------------------------------"
echo "remove old documentation"
echo "--------------------------------------"
rm -rf _built
rm -rf _static
rm -rf _templates
rm -rf _notebooks

echo "--------------------------------------"
echo "convert notebooks to rst"
echo "--------------------------------------"
NBDIR=$DIR/notebooks

# convert the notebooks to rst after running headlessly
# if errors should abort, remove the --allow-errors option
jupyter nbconvert --ExecutePreprocessor.timeout=600 --to=rst --allow-errors --execute $NBDIR/*.ipynb

echo "--------------------------------------"
echo "postprocessing notebooks rst"
echo "--------------------------------------"
# remove the following lines from the documentation
# sed -i '/%matplotlib inline/d' ./*.rst

# change the image locations (FIXME)
sed -i -- 's/.. image:: /.. image:: notebooks\/docs\//g' ./*.rst


echo "--------------------------------------"
echo "create html docs"
echo "--------------------------------------"
cd $DIR
# make html
sphinx-build -b html . _build/html

# open documentation
firefox _build/html/index.html

69 changes: 69 additions & 0 deletions docs/notebooks/simjson.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%load_ext autoreload\n",
"%autoreload 2"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# JSON simulation language\n",
"For simple exchange of simulation descriptions a JSON format for the simulation was\n",
"developed."
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"0.0.6\n"
]
}
],
"source": [
"import sbmlsim\n",
"print(sbmlsim.__version__)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "sbmlsim",
"language": "python",
"name": "sbmlsim"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.9"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
22 changes: 22 additions & 0 deletions docs/notebooks/simjson.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.. code:: ipython3
%load_ext autoreload
%autoreload 2
JSON simulation language
========================

For simple exchange of simulation descriptions a JSON format for the
simulation was developed.

.. code:: ipython3
import sbmlsim
print(sbmlsim.__version__)
.. parsed-literal::
0.0.6
28 changes: 28 additions & 0 deletions docs/overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Overview

**Mission**: make SBML simulations great again

The idea of sbmlsim is to provide a simple abstraction layer for running
simulations with SBML models in python.

**Simplicity**
- make it easy to encode simple simulation experiments with a focus
on numerical ODE simulations

**Simulation**
- timecourse simulations
- combined simulation experiments (combination of changes)
- parameter scans
- parameter sensitivity analysis

**Visualization**
- interactive plots (altair)

**Parallelization**
- simple parallelization of multiple simulation, collection of results

**Parameter fitting**
- helpers for using model + data to run simulations on a cluster

**Unit support**

3 changes: 3 additions & 0 deletions requirements-docs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
sphinx
recommonmark
sphinx-rtd-theme

0 comments on commit 126d039

Please sign in to comment.