Skip to content

Commit 47f4ce9

Browse files
authored
Merge pull request #84 from judithabk6/add_doc
Add documentation
2 parents 9cc2394 + e748ef6 commit 47f4ce9

File tree

6 files changed

+208
-0
lines changed

6 files changed

+208
-0
lines changed

.github/workflows/sphinx_doc.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: documentation
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
10+
jobs:
11+
# This workflow contains a single job called "build"
12+
build:
13+
# The type of runner that the job will run on
14+
runs-on: ubuntu-latest
15+
16+
# Steps represent a sequence of tasks that will be executed as part of the job
17+
steps:
18+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
19+
- uses: actions/checkout@v2
20+
21+
- name: Set up Python 3.10
22+
uses: actions/setup-python@v2
23+
with:
24+
python-version: "3.10"
25+
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install ghp-import sphinx sphinx_rtd_theme -e .
30+
31+
- name: Build HTML
32+
run: |
33+
cd docs/
34+
make html
35+
- name: Run ghp-import
36+
run: |
37+
ghp-import -n -p -f docs/_build/html

docs/Makefile

+20
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 = .
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

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import os
2+
import sys
3+
4+
import med_bench
5+
import med_bench.get_estimation
6+
import med_bench.get_simulated_data
7+
import med_bench.mediation
8+
import med_bench.utils
9+
import med_bench.utils.utils
10+
import med_bench.utils.nuisances
11+
12+
13+
sys.path.insert(0, os.path.abspath('../'))
14+
15+
project = 'med_bench'
16+
copyright = '2024, Judith Abecassis, Houssam Zenati, Bertrand Thirion, Hadrien Mariaccia, Mouad Zbakh'
17+
author = 'Judith Abecassis, Houssam Zenati, Bertrand Thirion, Hadrien Mariaccia, Mouad Zbakh'
18+
19+
# -- General configuration ---------------------------------------------------
20+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
21+
22+
extensions = [
23+
'sphinx.ext.autodoc',
24+
'sphinx.ext.viewcode',
25+
'sphinx.ext.napoleon',
26+
'sphinx.ext.githubpages'
27+
]
28+
29+
templates_path = ['_templates']
30+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', '.venv']
31+
32+
33+
# -- Options for HTML output -------------------------------------------------
34+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
35+
36+
html_theme = 'sphinx_rtd_theme'
37+
html_static_path = ['_static']

docs/index.rst

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
.. med_bench documentation master file, created by
2+
sphinx-quickstart on Tue Apr 9 16:50:56 2024.
3+
You can adapt this file completely to your liking, but it should at least
4+
contain the root `toctree` directive.
5+
6+
Welcome to med_bench's documentation!
7+
=====================================
8+
9+
.. toctree::
10+
:maxdepth: 4
11+
:caption: Contents:
12+
13+
modules
14+
15+
16+
17+
Indices and tables
18+
==================
19+
20+
* :ref:`genindex`
21+
* :ref:`modindex`
22+
* :ref:`search`

docs/make.bat

+35
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

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
.. toctree::
2+
:maxdepth: 4
3+
:caption: Contents:
4+
5+
6+
med_bench
7+
=================
8+
.. automodule:: med_bench
9+
:members:
10+
:undoc-members:
11+
:show-inheritance:
12+
13+
14+
get_estimation
15+
--------
16+
17+
.. automodule:: med_bench.get_estimation
18+
:members:
19+
:undoc-members:
20+
:show-inheritance:
21+
22+
23+
get_simulated_data
24+
--------
25+
26+
.. automodule:: med_bench.get_simulated_data
27+
:members:
28+
:undoc-members:
29+
:show-inheritance:
30+
31+
32+
mediation
33+
--------
34+
35+
.. automodule:: med_bench.mediation
36+
:members:
37+
:undoc-members:
38+
:show-inheritance:
39+
40+
41+
utils
42+
--------
43+
44+
.. automodule:: med_bench.utils.utils
45+
:members:
46+
:undoc-members:
47+
:show-inheritance:
48+
49+
50+
nuisances
51+
--------
52+
53+
.. automodule:: med_bench.utils.nuisances
54+
:members:
55+
:undoc-members:
56+
:show-inheritance:
57+

0 commit comments

Comments
 (0)