Skip to content

Commit 396ace2

Browse files
authored
Merge pull request MIT-LCP#104 from MIT-LCP/doc
Version 2
2 parents 6f14dba + 895a04b commit 396ace2

File tree

197 files changed

+7014
-5601
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

197 files changed

+7014
-5601
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# For private use
2-
private_tests.ipynb
2+
private-tests.ipynb
33
notes.md
44

55
# Byte-compiled / optimized / DLL files

README.rst

Lines changed: 36 additions & 791 deletions
Large diffs are not rendered by default.
File renamed without changes.

demo.ipynb

Lines changed: 184 additions & 148 deletions
Large diffs are not rendered by default.

devtests.ipynb

Lines changed: 0 additions & 79 deletions
This file was deleted.

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line.
5+
SPHINXOPTS =
6+
SPHINXBUILD = sphinx-build
7+
SPHINXPROJ = wfdb
8+
SOURCEDIR = .
9+
BUILDDIR = _build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
File renamed without changes.

docs/_templates/.gitkeep

Whitespace-only changes.

docs/conf.py

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
#!/usr/bin/env python3
2+
# -*- coding: utf-8 -*-
3+
#
4+
# wfdb documentation build configuration file, created by
5+
# sphinx-quickstart on Tue Jan 2 13:19:02 2018.
6+
#
7+
# This file is execfile()d with the current directory set to its
8+
# containing dir.
9+
#
10+
# Note that not all possible configuration values are present in this
11+
# autogenerated file.
12+
#
13+
# All configuration values have a default; values that are commented out
14+
# serve to show the default.
15+
16+
# If extensions (or modules to document with autodoc) are in another directory,
17+
# add these directories to sys.path here. If the directory is relative to the
18+
# documentation root, use os.path.abspath to make it absolute, like shown here.
19+
#
20+
# import os
21+
# import sys
22+
# sys.path.insert(0, os.path.abspath('.'))
23+
24+
25+
# -- General configuration ------------------------------------------------
26+
27+
# If your documentation needs a minimal Sphinx version, state it here.
28+
#
29+
# needs_sphinx = '1.0'
30+
31+
# Add any Sphinx extension module names here, as strings. They can be
32+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
33+
# ones.
34+
extensions = ['sphinx.ext.autodoc']
35+
36+
# Add any paths that contain templates here, relative to this directory.
37+
templates_path = ['_templates']
38+
39+
# The suffix(es) of source filenames.
40+
# You can specify multiple suffix as a list of string:
41+
#
42+
# source_suffix = ['.rst', '.md']
43+
source_suffix = '.rst'
44+
45+
# The master toctree document.
46+
master_doc = 'index'
47+
48+
# General information about the project.
49+
project = 'wfdb'
50+
copyright = '2018, MIT Lab for Computational Physiology'
51+
author = 'Chen Xie, Julien Dubiel'
52+
53+
import wfdb
54+
# The version info for the project you're documenting, acts as replacement for
55+
# |version| and |release|, also used in various other places throughout the
56+
# built documents.
57+
#
58+
# The short X.Y version.
59+
version = wfdb.__version__
60+
# The full version, including alpha/beta/rc tags.
61+
release = wfdb.__version__
62+
63+
# The language for content autogenerated by Sphinx. Refer to documentation
64+
# for a list of supported languages.
65+
#
66+
# This is also used if you do content translation via gettext catalogs.
67+
# Usually you set "language" from the command line for these cases.
68+
language = None
69+
70+
# List of patterns, relative to source directory, that match files and
71+
# directories to ignore when looking for source files.
72+
# This patterns also effect to html_static_path and html_extra_path
73+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
74+
75+
# The name of the Pygments (syntax highlighting) style to use.
76+
pygments_style = 'sphinx'
77+
78+
# If true, `todo` and `todoList` produce output, else they produce nothing.
79+
todo_include_todos = False
80+
81+
82+
# -- Options for HTML output ----------------------------------------------
83+
84+
# The theme to use for HTML and HTML Help pages. See the documentation for
85+
# a list of builtin themes.
86+
#
87+
html_theme = 'alabaster'
88+
89+
# Theme options are theme-specific and customize the look and feel of a theme
90+
# further. For a list of options available for each theme, see the
91+
# documentation.
92+
#
93+
# html_theme_options = {}
94+
95+
# Add any paths that contain custom static files (such as style sheets) here,
96+
# relative to this directory. They are copied after the builtin static files,
97+
# so a file named "default.css" will overwrite the builtin "default.css".
98+
html_static_path = ['_static']
99+
100+
# Custom sidebar templates, must be a dictionary that maps document names
101+
# to template names.
102+
#
103+
# This is required for the alabaster theme
104+
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
105+
html_sidebars = {
106+
'**': [
107+
'relations.html', # needs 'show_related': True theme option to display
108+
'searchbox.html',
109+
]
110+
}
111+
112+
113+
# -- Options for HTMLHelp output ------------------------------------------
114+
115+
# Output file base name for HTML help builder.
116+
htmlhelp_basename = 'wfdbdoc'
117+
118+
119+
# -- Options for LaTeX output ---------------------------------------------
120+
121+
latex_elements = {
122+
# The paper size ('letterpaper' or 'a4paper').
123+
#
124+
# 'papersize': 'letterpaper',
125+
126+
# The font size ('10pt', '11pt' or '12pt').
127+
#
128+
# 'pointsize': '10pt',
129+
130+
# Additional stuff for the LaTeX preamble.
131+
#
132+
# 'preamble': '',
133+
134+
# Latex figure (float) alignment
135+
#
136+
# 'figure_align': 'htbp',
137+
}
138+
139+
# Grouping the document tree into LaTeX files. List of tuples
140+
# (source start file, target name, title,
141+
# author, documentclass [howto, manual, or own class]).
142+
latex_documents = [
143+
(master_doc, 'wfdb.tex', 'wfdb Documentation',
144+
'Chen Xie, Julien Dubiel', 'manual'),
145+
]
146+
147+
148+
# -- Options for manual page output ---------------------------------------
149+
150+
# One entry per manual page. List of tuples
151+
# (source start file, name, description, authors, manual section).
152+
man_pages = [
153+
(master_doc, 'wfdb', 'wfdb Documentation',
154+
[author], 1)
155+
]
156+
157+
158+
# -- Options for Texinfo output -------------------------------------------
159+
160+
# Grouping the document tree into Texinfo files. List of tuples
161+
# (source start file, target name, title, author,
162+
# dir menu entry, description, category)
163+
texinfo_documents = [
164+
(master_doc, 'wfdb', 'wfdb Documentation',
165+
author, 'wfdb', 'One line description of project.',
166+
'Miscellaneous'),
167+
]
168+
169+
170+

docs/index.rst

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
wfdb
2+
====
3+
4+
Introduction
5+
------------
6+
7+
The native Python waveform-database (WFDB) package. A library of tools
8+
for reading, writing, and processing WFDB signals and annotations.
9+
10+
Core components of this package are based on the original WFDB
11+
specifications. This package does not contain the exact same
12+
functionality as the original WFDB package. It aims to implement as many
13+
of its core features as possible, with user-friendly APIs. Additional
14+
useful physiological signal-processing tools are added over time.
15+
16+
17+
Development
18+
-----------
19+
20+
The development repository is hosted at: https://github.com/MIT-LCP/wfdb-python
21+
22+
The package is to be expanded with physiological signal-processing tools, and general improvements. Development is made for Python 2.7 and 3.5+ only.
23+
24+
25+
API Reference
26+
--------------
27+
28+
The exact API of all accessible functions and classes, as given by the docstrings, grouped by subpackage:
29+
30+
.. toctree::
31+
:maxdepth: 2
32+
33+
io
34+
plot
35+
processing
36+
37+
38+
Core Components
39+
---------------
40+
41+
A subset of the above components are accessible by directly importing the base package.
42+
43+
.. toctree::
44+
:maxdepth: 2
45+
46+
wfdb
47+
48+
49+
Other Content
50+
-------------
51+
.. toctree::
52+
:maxdepth: 2
53+
54+
installation
55+
wfdb-specifications
56+
57+
58+
Indices and tables
59+
------------------
60+
61+
* :ref:`genindex`
62+
* :ref:`modindex`
63+
* :ref:`search`
64+
65+
66+
Authors
67+
-------
68+
69+
`Chen Xie`_
70+
71+
`Julien Dubiel`_
72+
73+
74+
.. _PEP8: https://www.python.org/dev/peps/pep-0008/
75+
.. _docstrings: https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt
76+
.. _existing tests: https://github.com/MIT-LCP/wfdb-python/tree/master/tests
77+
78+
.. _Chen Xie: https://github.com/cx1111/
79+
.. _Julien Dubiel: https://github.com/Dubrzr/

docs/installation.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Installation
2+
------------
3+
4+
The distribution is hosted on pypi at: https://pypi.python.org/pypi/wfdb/. To directly install the package from pypi without needing to explicitly download content, run from your terminal::
5+
6+
$ pip install wfdb
7+
8+
The development version is hosted at: https://github.com/MIT-LCP/wfdb-python. This repository also contains demo scripts and example data. To install the development version, clone or download the repository, navigate to the base directory, and run::
9+
10+
$ pip install .

docs/io.rst

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
io
2+
===
3+
4+
The input/output subpackage contains classes used to represent WFDB
5+
objects, and functions to read, write, and download WFDB files.
6+
7+
8+
WFDB Records
9+
---------------
10+
11+
.. automodule:: wfdb.io
12+
:members: rdrecord, rdsamp, wrsamp
13+
14+
.. autoclass:: wfdb.io.Record
15+
:members: wrsamp, adc, dac
16+
17+
.. autoclass:: wfdb.io.MultiRecord
18+
:members: multi_to_single
19+
20+
21+
WFDB Anotations
22+
---------------
23+
24+
.. automodule:: wfdb.io
25+
:members: rdann, wrann, show_ann_labels, show_ann_classes
26+
27+
.. autoclass:: wfdb.io.Annotation
28+
:members: wrann
29+
30+
31+
Downloading
32+
-----------
33+
34+
.. automodule:: wfdb.io
35+
:members: get_dbs, get_record_list, dl_database, dl_files

docs/plot.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
plot
2+
----
3+
4+
.. automodule:: wfdb.plot
5+
:members: plot_items, plot_wfdb, plot_all_records

docs/processing.rst

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
processing
2+
==========
3+
4+
The processing subpackage contains signal-processing tools.
5+
6+
7+
Basic Utility
8+
-------------
9+
10+
Basic signal processing functions
11+
12+
.. automodule:: wfdb.processing
13+
:members: resample_ann, resample_sig, resample_singlechan,
14+
resample_multichan, normalize_bound, get_filter_gain
15+
16+
Heart Rate
17+
----------
18+
19+
.. automodule:: wfdb.processing
20+
:members: compute_hr
21+
22+
23+
Peaks
24+
-----
25+
26+
.. automodule:: wfdb.processing
27+
:members: find_peaks, find_local_peaks, correct_peaks
28+
29+
30+
QRS Detectors
31+
-------------
32+
33+
.. automodule:: wfdb.processing
34+
:members: XQRS, xqrs_detect, gqrs_detect
35+
36+
37+
Annotation Evaluators
38+
---------------------
39+
40+
.. automodule:: wfdb.processing
41+
:members: Comparitor, compare_annotations

docs/wfdb-specifications.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
WFDB Specifications
2+
-------------------
3+
4+
The wfdb-python package is built according to the specifications of the original WFDB package.
5+
6+
* `WFDB Software Package`_
7+
* `WFDB Applications Guide`_
8+
* `WFDB Header Specifications`_
9+
* `WFDB Signal Specifications`_
10+
* `WFDB Annotation Specifications`_
11+
12+
.. _WFDB Software Package: http://physionet.org/physiotools/wfdb.shtml
13+
.. _WFDB Applications Guide: http://physionet.org/physiotools/wag/
14+
.. _WFDB Header Specifications: https://physionet.org/physiotools/wag/header-5.htm
15+
.. _WFDB Signal Specifications: https://physionet.org/physiotools/wag/signal-5.htm
16+
.. _WFDB Annotation Specifications: https://physionet.org/physiotools/wag/annot-5.htm

0 commit comments

Comments
 (0)