Skip to content

Commit

Permalink
add sphinx doc
Browse files Browse the repository at this point in the history
  • Loading branch information
lruizcalico committed Dec 11, 2023
1 parent 425ade9 commit cb64022
Show file tree
Hide file tree
Showing 9 changed files with 317 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Baskerville Docs

on:
workflow_dispatch:

defaults:
run:
shell: bash

permissions:
contents: write
jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v3

- name: Install dependencies
run: |
cd ${{ github.workspace }}/src/docs
pip install -r requirements.txt
- name: Sphinx build
run: |
cd ${{ github.workspace }}/src/docs/source
rm -f *.rst make.bat
cd ${{ github.workspace }}/src
sphinx-apidoc -F -a -o docs/source baskerville
cd ${{ github.workspace }}/src/docs
make html
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ${{ github.workspace }}/src/docs/build/html
force_orphan: true
20 changes: 20 additions & 0 deletions src/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)
Empty file added src/docs/build/.placeholder
Empty file.
35 changes: 35 additions & 0 deletions src/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
19 changes: 19 additions & 0 deletions src/docs/source/baskerville.helpers.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
baskerville.helpers Subpackages of helpers for the Baskerville package.
==============================================================================

Submodules
----------

baskerville.helpers.gcs_utils module
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. automodule:: baskerville.helpers.gcs_utils
:members:
:undoc-members:
:show-inheritance:

baskerville.helpers.utils module
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. automodule:: baskerville.helpers.utils
:members:
:undoc-members:
:show-inheritance:
98 changes: 98 additions & 0 deletions src/docs/source/baskerville.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
baskerville package
===================


Subpackages
-----------

.. toctree::
:maxdepth: 4

baskerville.helpers
baskerville.scripts

Submodules
----------

baskerville.bed module
~~~~~~~~~~~~~~~~~~~~~~

.. automodule:: baskerville.bed
:members:
:undoc-members:
:show-inheritance:

baskerville.blocks module
~~~~~~~~~~~~~~~~~~~~~~~~~

.. automodule:: baskerville.blocks
:members:
:undoc-members:
:show-inheritance:

baskerville.dataset module
~~~~~~~~~~~~~~~~~~~~~~~~~~

.. automodule:: baskerville.dataset
:members:
:undoc-members:
:show-inheritance:

baskerville.dna module
~~~~~~~~~~~~~~~~~~~~~~
.. automodule:: baskerville.dna
:members:
:undoc-members:
:show-inheritance:


baskerville.gene module
~~~~~~~~~~~~~~~~~~~~~~~
.. automodule:: baskerville.gene
:members:
:undoc-members:
:show-inheritance:

baskerville.layers module
~~~~~~~~~~~~~~~~~~~~~~~~~
.. automodule:: baskerville.layers
:members:
:undoc-members:
:show-inheritance:

baskerville.metrics module
~~~~~~~~~~~~~~~~~~~~~~~~~~
.. automodule:: baskerville.metrics
:members:
:undoc-members:
:show-inheritance:

baskerville.seqnn module
~~~~~~~~~~~~~~~~~~~~~~~~
.. automodule:: baskerville.seqnn
:members:
:undoc-members:
:show-inheritance:

baskerville.snps module
~~~~~~~~~~~~~~~~~~~~~~~
.. automodule:: baskerville.snps
:members:
:undoc-members:
:show-inheritance:

baskerville.trainer module
~~~~~~~~~~~~~~~~~~~~~~~~~~
.. automodule:: baskerville.trainer
:members:
:undoc-members:
:show-inheritance:

baskerville.vcf module
~~~~~~~~~~~~~~~~~~~~~~
.. automodule:: baskerville.vcf
:members:
:undoc-members:
:show-inheritance:


53 changes: 53 additions & 0 deletions src/docs/source/baskerville.scripts.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
baskerville.scripts Subpackages of scripts for the Baskerville project.
=============================================================

"""
This package contains scripts for the Baskerville project
that are not part of the main codebase.

"""
Submodules
==========

baskerville.scripts.hound_eval_spec module
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. automodule:: baskerville.scripts.hound_eval_spec
:members:
:undoc-members:
:show-inheritance:

baskerville.scripts.hound_eval module
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. automodule:: baskerville.scripts.hound_eval
:members:
:undoc-members:
:show-inheritance:

baskerville.scripts.hound_predbed module
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. automodule:: baskerville.scripts.hound_predbed
:members:
:undoc-members:
:show-inheritance:


baskerville.scripts.hound_snp module
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. automodule:: baskerville.scripts.hound_snp
:members:
:undoc-members:
:show-inheritance:

baskerville.scripts.hound_snp_slurm module
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. automodule:: baskerville.scripts.hound_snp_slurm
:members:
:undoc-members:
:show-inheritance:

baskerville.scripts.hound_train module
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. automodule:: baskerville.scripts.hound_train
:members:
:undoc-members:
:show-inheritance:
38 changes: 38 additions & 0 deletions src/docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
import os
import sys

# This root should be where docs folder is visible.
sys.path.insert(0, os.path.abspath("../.."))
sys.setrecursionlimit(1500)

project = "baskerville"
copyright = "2023, David Kelly"
author = "David Kelly"
release = "0.0.1"

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


# -- 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"]
16 changes: 16 additions & 0 deletions src/docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Welcome to baskerville's documentation!
=======================================

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

baskerville


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

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

0 comments on commit cb64022

Please sign in to comment.