From 16c3dd6d76b12acd73a45d3c3906b61a7588598e Mon Sep 17 00:00:00 2001 From: R543hfer099JJfd <127630341+AFg6K7h4fhy2@users.noreply.github.com> Date: Sun, 17 Mar 2024 16:36:46 -0400 Subject: [PATCH] Setting up Sphinx site again --- docs/source/conf.py | 21 +---------- docs/source/index.rst | 21 ++--------- docs/source/usage.rst | 87 ------------------------------------------- 3 files changed, 5 insertions(+), 124 deletions(-) delete mode 100644 docs/source/usage.rst diff --git a/docs/source/conf.py b/docs/source/conf.py index 825d878d..5ef1d106 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -5,14 +5,6 @@ # -- Project information ----------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information -# import pathlib -# import sys -# sys.path.insert(0, pathlib.Path(__file__).parents[2].resolve().as_posix()) - -import os -import sys -sys.path.insert(0, os.path.abspath('../../model/src')) - project = 'CFA Multisignal Renewal' copyright = '2024, CFA' @@ -22,18 +14,7 @@ # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration -extensions = [ - 'sphinx.ext.autodoc', - 'sphinx.ext.autosectionlabel', - 'sphinx.ext.autosummary', - 'sphinx.ext.doctest', - 'sphinx.ext.duration', - 'sphinx.ext.githubpages', - 'sphinx.ext.inheritance_diagram', - 'sphinx.ext.todo', - 'sphinx.ext.viewcode', - 'sphinx.ext.mathjax', -] +extensions = [] templates_path = ['_templates'] exclude_patterns = [] diff --git a/docs/source/index.rst b/docs/source/index.rst index 208c9943..93e0cd01 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -1,33 +1,20 @@ -.. CFA-Multisignal-Renewal documentation master file, created by - sphinx-quickstart on Tue Mar 5 10:06:53 2024. +.. CFA Multisignal Renewal documentation master file, created by + sphinx-quickstart on Sun Mar 17 15:31:47 2024. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. -Welcome to CFA-Multisignal-Renewal's documentation! +Welcome to CFA Multisignal Renewal's documentation! =================================================== .. toctree:: :maxdepth: 2 :caption: Contents: - usage -**Disclaimer**: This repository was created for use by CDC programs to collaborate on public health related projects in support of the CDC mission. GitHub is not hosted by the CDC, but is a third party website used by CDC and its partners to share information and collaborate on software. CDC use of GitHub does not imply an endorsement of any one particular service, product, or enterprise. - -**Overview**: This repo hosts the multisignal (a.k.a. signal fusion) renewal project: an internal forecasting model that leverages multiple data sources for enhancing epidemiological modeling of infectious disease outbreaks. - -.. note:: - - This project is under active development. - - -Check out the :doc:`usage` section for further information. - Indices and tables ================== * :ref:`genindex` +* :ref:`modindex` * :ref:`search` - -.. * :ref:`modindex` diff --git a/docs/source/usage.rst b/docs/source/usage.rst deleted file mode 100644 index 6fb6a772..00000000 --- a/docs/source/usage.rst +++ /dev/null @@ -1,87 +0,0 @@ -Using CFA-Multisignal-Renewal -============================= - - -Example Code Description ------------------------- - -The function ``pyrenew.sample_infections_rt()`` is used to sample infections: - -.. py:function:: pyrenew.sample_infections_rt(I0: ArrayLike, Rt: ArrayLike, reversed_generation_interval_pmf: ArrayLike) - - Sample infections according to a renewal process with a time-varying reproduction number R(t) - - :param I0: Array of initial infections of the same length as the generation interval pmf vector. - :type I0: ArrayLike - :param Rt: Timeseries of R(t) values - :type Rt: ArrayLike - :param reversed_generation_interval_pmf: Discrete probability mass vector representing the generation interval of the infection process, where the final entry represents an infection 1 time unit in the past, the second-to-last entry represents an infection two time units in the past, etc. - :type reversed_generation_interval_pmf: ArrayLike - :return: The timeseries of infections. - :rtype: Array - -.. code-block:: python - - def sample_infections_rt( - I0: ArrayLike, Rt: ArrayLike, reversed_generation_interval_pmf: ArrayLike - ): - """ - Sample infections according to a - renewal process with a time-varying - reproduction number R(t) - - Parameters - ---------- - I0: ArrayLike - Array of initial infections of the - same length as the generation inferval - pmf vector. - - Rt: ArrayLike - Timeseries of R(t) values - - reversed_generation_interval_pmf: ArrayLike - discrete probability mass vector - representing the generation interval - of the infection process, where the final - entry represents an infection 1 time unit in the - past, the second-to-last entry represents - an infection two time units in the past, etc. - - Returns - -------- - The timeseries of infections, as a JAX array - """ - incidence_func = new_convolve_scanner(reversed_generation_interval_pmf) - - latest, all_infections = jax.lax.scan(incidence_func, I0, Rt) - - return all_infections - - -.. code-block:: python - - class BasicRenewalModel: - """ - Implementation of a basic - renewal model, not abstracted - or modular, just for testing - """ - - def __init__( - self, - Rt0_dist=None, - Rt_transform=None, - Rt_rw_dist=None, - I0_dist=None, - IHR_dist=None, - gen_int=None, - inf_hosp_int=None, - hosp_observation_model=None, - ): - if Rt_transform is None: - Rt_transform = LogTransform() - self.Rt_transform = Rt_transform - - -.. autofunction:: pyrenew.sample_infections_rt \ No newline at end of file