Skip to content

Commit

Permalink
[DOC] Initial documentation setup
Browse files Browse the repository at this point in the history
  • Loading branch information
rmarkello committed Sep 17, 2018
1 parent 83b60bd commit 1b1cdc6
Show file tree
Hide file tree
Showing 12 changed files with 297 additions and 60 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ dist/*
localtest
.pytest_cache/
__pycache__/
_build/
57 changes: 0 additions & 57 deletions README.md

This file was deleted.

82 changes: 82 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
peakdet: A toolbox for physiological peak detection analyses
============================================================

This package is designed for use in the reproducible processing and analysis of
physiological data, like those collected from respiratory belts, pulse
photoplethysmography, or electrocardiogram (ECG/EKG) monitors.

.. image:: https://travis-ci.org/rmarkello/peakdet.svg?branch=master
:target: https://travis-ci.org/rmarkello/peakdet
.. image:: https://codecov.io/gh/rmarkello/peakdet/branch/master/graph/badge.svg
:target: https://codecov.io/gh/rmarkello/peakdet
.. image:: https://readthedocs.org/projects/peakdet/badge/?version=latest
:target: http://peakdet.readthedocs.io/en/latest
.. image:: https://img.shields.io/badge/License-GPL%20v3-blue.svg
:target: https://www.gnu.org/licenses/gpl-3.0

.. _overview:

Overview
--------

Physiological data are messy and prone to artifact (e.g.,) movement in
respiration and pulse, ectopic beats in ECG). Despite leaps and bounds in
recent algorithms for processing these data there still exists a need for
manual inspection to ensure such artifacts have been appropriately removed.
Because of this manual intervention step, understanding exactly what happened
to go from "raw" data to processed, "analysis-ready" data can often be
difficult or impossible. This toolbox aims to provide a set of tools that will
work with a variety of input data to reproducibly generate manually-corrected,
analysis-ready physiological data.

.. _development:

Development and getting involved
--------------------------------

This package has been largely developed in the spare time of a single graduate
student (`@rmarkello <https://github.com/rmarkello>`_) with help from some
incredible `contributors <https://github.com/rmarkello/peakdet/graphs/
contributors>`_. While it would be |sparkles| amazing |sparkles| if anyone else
finds it helpful, given the limited time constraints of graduate school, the
current package is not currently accepting requests for new features.

However, if you're interested in getting involved in the project, we're
thrilled to welcome new contributors! You should start by reading our
`contributing guidelines <https://github.com/rmarkello/peakdet/blob/master/
CONTRIBUTING.md>`_ and `code of conduct <https://github.com/rmarkello/peakdet/
blob/master/CODE_OF_CONDUCT.md>`_. Once you're done with that, take a look at
our `issues <https://github.com/rmarkello/peakdet/issues>`_ to see if there's
anything you might like to work on. Alternatively, if you've found a bug, are
experiencing a problem, or have a question, create a new issue with some
information about it!

.. _acknowledgments:

Acknowledgments
---------------

While this package was initially created in 2016, some of the behind-the-scenes
functions in the project were translated from the `PhysIO <https://github.com/
translationalneuromodeling/tapas/tree/master/PhysIO>`_ MATLAB toolbox. As such,
if you use this code it would be good to (1) provide a link back to the
``peakdet`` repostiory with the version of the code used, and (2) cite `their
paper <http://www.sciencedirect.com/science/article/pii/S016502701630259X>`_:

.. [1] Kasper, L., Bollmann, S., Diaconescu, A. O., Hutton, C., Heinzle, J.,
Iglesias, S., ... & Stephan, K. E. (2017). The PhysIO toolbox for modeling
physiological noise in fMRI data. Journal of Neuroscience Methods, 276,
56-72.
.. _licensing:

License Information
-------------------

This codebase is licensed under the GNU General Public License version 3.
The full license can be found in the `LICENSE <https://github.com/rmarkello/
peakdet/blob/master/LICENSE>`_ file in the ``peakdet`` distribution.

All trademarks referenced herein are property of their respective holders.

.. |sparkles| replace::
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.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXPROJ = peakdet
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)
33 changes: 33 additions & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
.. _api_ref:

.. currentmodule:: peakdet

API
===

Physiological data
------------------

.. autoclass:: peakdet.Physio

Loading data
------------

.. autofunction:: peakdet.load_physio
.. autofunction:: peakdet.load_history
.. autofunction:: peakdet.load_rtpeaks

Processing data
---------------

.. autofunction:: peakdet.interpolate_physio
.. autofunction:: peakdet.filter_physio
.. autofunction:: peakdet.peakfind_physio
.. autofunction:: peakdet.edit_physio
.. autofunction:: peakdet.plot_physio

Saving data
-----------

.. autofunction:: peakdet.save_physio
.. autofunction:: peakdet.save_history
105 changes: 105 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
import os
import sys

# -- Project information -----------------------------------------------------

# Add project name, copyright holder, and author(s)
project = 'peakdet'
copyright = '2018, peakdet developers'
author = 'Ross Markello'

# Import project to get version info
sys.path.insert(0, os.path.abspath(os.path.pardir))
import peakdet # noqa
# The short X.Y version
version = peakdet.__version__
# The full version, including alpha/beta/rc tags
release = peakdet.__version__


# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.mathjax',
'sphinx.ext.napoleon',
'sphinx.ext.viewcode',
]

# Generate the API documentation when building
autosummary_generate = True
numpydoc_show_class_members = False
autoclass_content = "class"

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# The suffix(es) of source filenames.
source_suffix = '.rst'

# The master toctree document.
master_doc = 'index'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path .
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'

# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
import sphinx_rtd_theme # noqa
html_theme = 'sphinx_rtd_theme'
html_show_sourcelink = False

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
html_theme_options = {}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']


# -- Options for HTMLHelp output ---------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'peakdetdoc'


# -- Extension configuration -------------------------------------------------
intersphinx_mapping = {
'matplotlib': ('https://matplotlib.org', None),
'numpy': ('https://docs.scipy.org/doc/numpy', None),
'scipy': ('https://docs.scipy.org/doc/scipy/reference', None),
'sklearn': ('http://scikit-learn.org/stable', None),
}
11 changes: 11 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.. include:: ../README.rst

Contents
--------

.. toctree::
:maxdepth: 1

installation
usage
api
19 changes: 19 additions & 0 deletions docs/installation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
.. _installation_setup:

Installation and setup
======================

.. _basic_installation:

Basic installation
--------------------

This package requires Python >= 3.6. Assuming you have the correct version of
Python installed, you can install ``peakdet`` by opening a terminal and running
the following:

.. code-block:: bash
git clone https://github.com/rmarkello/peakdet.git
cd peakdet
python setup.py install
4 changes: 4 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-r ../requirements.txt
sphinx>=1.2
sphinx_rtd_theme

11 changes: 11 additions & 0 deletions docs/usage.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.. _usage:

Using peakdet
=============

The API of ``peakdet`` is under active development, so it's not quite stable
enough for example usage instructions. Try taking a look at the :ref:`api_ref`
to get an idea about the available functions and methods. If you're *super
eager* to get started, try `opening an issue <https://github.com/rmarkello/
peakdet/issues>`_ to let the developers know there's external interest in these
sorts of things. Otherwise, check back soon!
12 changes: 10 additions & 2 deletions peakdet/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
DESCRIPTION = """\
A toolbox for reproducible physiological data analysis\
"""
LONG_DESCRIPTION = 'README.md'
LONG_DESCRIPTION_CONTENT_TYPE = 'text/markdown'
LONG_DESCRIPTION = 'README.rst'
LONG_DESCRIPTION_CONTENT_TYPE = 'text/x-rst'
URL = 'https://github.com/rmarkello/{name}'.format(name=NAME)
DOWNLOAD_URL = ('http://github.com/rmarkello/{name}/archive/{ver}.tar.gz'
.format(name=NAME, ver=__version__))
Expand All @@ -29,8 +29,16 @@
]

EXTRAS_REQUIRES = {
'doc': [
'sphinx>=1.2',
'sphinx_rtd_theme'
]
}

EXTRAS_REQUIRES['all'] = list(
set([v for deps in EXTRAS_REQUIRES.values() for v in deps])
)

PACKAGE_DATA = {
'peakdet.tests': [
'data/*'
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[metadata]
description-file = README.md
description-file = README.rst

[flake8]
ignore = E402
Expand Down

0 comments on commit 1b1cdc6

Please sign in to comment.