Skip to content

Commit

Permalink
Updating docs
Browse files Browse the repository at this point in the history
  • Loading branch information
marlinfiggins committed Jun 1, 2024
1 parent 995ffe0 commit c32518a
Show file tree
Hide file tree
Showing 7 changed files with 154 additions and 12 deletions.
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)
13 changes: 13 additions & 0 deletions docs/api_reference.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
API Reference
-------------

The following documents provide a detailed reference to the functions and modules in `evofr`.

.. toctree::
:maxdepth: 1

source/evofr.data
source/evofr.models
source/evofr.infer
source/evofr.posterior
source/evofr.plotting
8 changes: 7 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import pathlib
import sys
from datetime import datetime

import evofr

# -- Path setup --------------------------------------------------------------
Expand All @@ -23,10 +24,13 @@
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx.ext.napoleon",
"sphinx_rtd_theme",
"nbsphinx",
"sphinx.ext.mathjax",
]

templates_path = ["_templates"]
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", "**.ipynb_checkpoints"]

# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
Expand All @@ -38,6 +42,8 @@
autodoc_typehints = "description"
add_module_names = False

nbsphinx_execute = "never"

# Napolean settings
napoleon_google_docstring = True
napoleon_numpy_docstring = True
48 changes: 38 additions & 10 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,23 +1,51 @@
.. evofr documentation master file, created by
sphinx-quickstart on [date you ran the command].
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to evofr's documentation!
=================================

.. automodule:: evofr
:members:
.. image:: https://github.com/blab/evofr/actions/workflows/ci.yaml/badge.svg
:target: https://github.com/blab/evofr/actions/workflows/ci.yaml

.. toctree::
:maxdepth: 1
Overview
--------

`evofr` is a Python package designed for evolutionary forecasting of genetic variants.
This project provides tools aimed at modeling and predicting the evolution and prevalence of genetic variants over time.
The package integrates various data handling, modeling, and plotting capabilities, making it a useful toolkit for researchers in the field of genetic epidemiology and evolutionary dynamics.

Installation
------------

You can install the latest release of `evofr` directly using pip:

.. code-block:: bash
pip install evofr
source/evofr.data.rst
source/evofr.models.rst
source/evofr.infer.rst
source/evofr.posterior.rst
source/evofr.plotting.rst
For those looking to contribute or modify the package, it can be built locally with:

.. code-block:: bash
poetry build
pip install path-to-wheel>
Indices and tables
==================
------------------

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

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

installation
api_reference
mlr_quickstart

=================================
67 changes: 67 additions & 0 deletions docs/installation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
Installation Guide
==================

This page provides detailed instructions on how to install `evofr`, a Python package for evolutionary forecasting of genetic variants.

Installing with pip
-------------------

The easiest way to install the latest version of `evofr` is via pip. This method will automatically handle all dependencies, including JAX and Numpyro:

.. code-block:: bash
pip install evofr
Installing from Source
----------------------

For those who prefer to install `evofr` from the source or want to contribute to the development, follow these steps:

.. code-block:: bash
git clone https://github.com/blab/evofr.git
cd evofr
pip install .
Installing from Source Using Poetry
-----------------------------------

Poetry is a tool for dependency management and packaging in Python. To use Poetry to install `evofr` from the source, follow these instructions:

.. code-block:: bash
git clone https://github.com/blab/evofr.git
cd evofr
poetry install
This command will create a virtual environment and install all dependencies defined in `pyproject.toml`. To activate the virtual environment created by Poetry, you can use:

.. code-block:: bash
poetry shell
Alternatively, to run commands within the virtual environment without activating it, use `poetry run`:

.. code-block:: bash
poetry run python -m mymodule
For more information on using Poetry, visit the `Poetry documentation <https://python-poetry.org/docs/>`_.

Environment Setup
-----------------

It is often beneficial to set up a virtual environment for Python projects to manage dependencies separately from the system-wide installations:

.. code-block:: bash
python -m venv evofr-env
source evofr-env/bin/activate
pip install evofr
This method is especially recommended when working on development or managing multiple Python packages.

Additional Installation Help
----------------------------

If you encounter any issues during the installation, particularly related to JAX, please consult the `JAX installation guide <https://jax.readthedocs.io/en/latest/installation.html>`_ for detailed instructions and troubleshooting tips.
8 changes: 8 additions & 0 deletions docs/mlr_quickstart.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Getting starting with Evofr
--------------------------

.. toctree::
:maxdepth: 2
:caption Test

notebooks/example_mlr.ipynb
2 changes: 1 addition & 1 deletion evofr/infer/MCMC_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def fit(
num_samples:
number of samples to be returned in MCMC.
**mcmc_kwargs:
mcmc_kwargs:
additional arguments to be passed to MCMC algorithms.
"""
self.mcmc = MCMC(
Expand Down

0 comments on commit c32518a

Please sign in to comment.