Skip to content

Commit

Permalink
Merge pull request #84 from judithabk6/add_doc
Browse files Browse the repository at this point in the history
Add documentation
  • Loading branch information
brash6 authored Apr 26, 2024
2 parents 9cc2394 + e748ef6 commit 47f4ce9
Show file tree
Hide file tree
Showing 6 changed files with 208 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/sphinx_doc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: documentation

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: "3.10"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ghp-import sphinx sphinx_rtd_theme -e .
- name: Build HTML
run: |
cd docs/
make html
- name: Run ghp-import
run: |
ghp-import -n -p -f docs/_build/html
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)
37 changes: 37 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import os
import sys

import med_bench
import med_bench.get_estimation
import med_bench.get_simulated_data
import med_bench.mediation
import med_bench.utils
import med_bench.utils.utils
import med_bench.utils.nuisances


sys.path.insert(0, os.path.abspath('../'))

project = 'med_bench'
copyright = '2024, Judith Abecassis, Houssam Zenati, Bertrand Thirion, Hadrien Mariaccia, Mouad Zbakh'
author = 'Judith Abecassis, Houssam Zenati, Bertrand Thirion, Hadrien Mariaccia, Mouad Zbakh'

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

extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.viewcode',
'sphinx.ext.napoleon',
'sphinx.ext.githubpages'
]

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


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

.. toctree::
:maxdepth: 4
:caption: Contents:

modules



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

%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
57 changes: 57 additions & 0 deletions docs/modules.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
.. toctree::
:maxdepth: 4
:caption: Contents:


med_bench
=================
.. automodule:: med_bench
:members:
:undoc-members:
:show-inheritance:


get_estimation
--------

.. automodule:: med_bench.get_estimation
:members:
:undoc-members:
:show-inheritance:


get_simulated_data
--------

.. automodule:: med_bench.get_simulated_data
:members:
:undoc-members:
:show-inheritance:


mediation
--------

.. automodule:: med_bench.mediation
:members:
:undoc-members:
:show-inheritance:


utils
--------

.. automodule:: med_bench.utils.utils
:members:
:undoc-members:
:show-inheritance:


nuisances
--------

.. automodule:: med_bench.utils.nuisances
:members:
:undoc-members:
:show-inheritance:

0 comments on commit 47f4ce9

Please sign in to comment.