Skip to content

Version 2 #104

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 59 commits into from
Feb 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
7aee523
add sphinx doc
cx1111 Jan 2, 2018
08e7567
rename files and variables to be more pythonic
cx1111 Jan 2, 2018
d0cccfd
change function and variable names
cx1111 Jan 2, 2018
3228810
change function and variable names
cx1111 Jan 2, 2018
ad5e5ce
rename variables
cx1111 Jan 2, 2018
24e95b3
signal(s) case now singular
cx1111 Jan 3, 2018
ee7a574
rename variables
cx1111 Jan 3, 2018
e7a65c5
fixing tests to reflect variable name changes
cx1111 Jan 3, 2018
f9ead45
fix tests, update docstrings
cx1111 Jan 3, 2018
c828e7d
update doc
cx1111 Jan 3, 2018
6024658
finish tidying helpstrings for public functions
cx1111 Jan 3, 2018
c786318
fix typos in code
cx1111 Jan 3, 2018
5cb3632
add docstring
cx1111 Jan 3, 2018
83139ab
updating doc
cx1111 Jan 4, 2018
606774c
update doc
cx1111 Jan 4, 2018
ce449ab
udpate doc
cx1111 Jan 5, 2018
8e4c11f
fix demo and update doc
cx1111 Jan 5, 2018
41442c3
update doc
cx1111 Jan 5, 2018
1efef36
udpate doc
cx1111 Jan 5, 2018
ca7d3ad
refactoring gqrs
cx1111 Jan 7, 2018
340c18a
refactoring gqrs
cx1111 Jan 7, 2018
754703f
refactoring gqrs
cx1111 Jan 7, 2018
b3add82
refactoring gqrs
cx1111 Jan 7, 2018
b331e53
refactor
cx1111 Jan 11, 2018
a053e2c
make new function cqrs
cx1111 Jan 13, 2018
f50e46c
work on cqrs
cx1111 Jan 13, 2018
2e33496
old kmeans
cx1111 Jan 14, 2018
5a3af94
work on cqrs
cx1111 Jan 15, 2018
1915402
work on cqrs
cx1111 Jan 15, 2018
5b30f8c
work on cqrs
cx1111 Jan 16, 2018
f3c7e34
work on cqrs
cx1111 Jan 17, 2018
0a8fc34
work on cqrs
cx1111 Jan 17, 2018
3664ecc
work on cqrs
cx1111 Jan 18, 2018
799174a
xqrs runs through
cx1111 Jan 18, 2018
5f96ed5
work on annotation comparison
cx1111 Jan 20, 2018
b7f69bc
work on evaluator
cx1111 Jan 20, 2018
d517b85
refactoring plot functions
cx1111 Jan 26, 2018
6b9324a
add plot subfunctions
cx1111 Jan 26, 2018
dba7540
work on plots
cx1111 Jan 28, 2018
4be3baa
refactor plots
cx1111 Jan 29, 2018
bf0dc27
clean up test syntax and fix an import. fixes #99
cx1111 Feb 1, 2018
374819a
correct variable name. fixes #98
cx1111 Feb 1, 2018
370b0be
adding plot_wfdb function
cx1111 Feb 1, 2018
761dbc0
finish plot_wfdb
cx1111 Feb 2, 2018
93ca1fe
resampling: ann.fs -> fs_target
Dubrzr Feb 3, 2018
c661d90
fix test
cx1111 Feb 4, 2018
1ad204c
Merge branch 'doc' of github.com:MIT-LCP/wfdb-python into doc
cx1111 Feb 4, 2018
ab5e3ee
refactor gqrs
cx1111 Feb 5, 2018
6637ab1
complete stats calculation and plotting for comparitors
cx1111 Feb 6, 2018
5eeef2e
refactor xqrs and add xqrs test
cx1111 Feb 6, 2018
cf6290a
qrs documentation
cx1111 Feb 6, 2018
e5555d1
udpate demos
cx1111 Feb 7, 2018
7dcf871
udpate docstring
cx1111 Feb 7, 2018
93625da
update docstrings
cx1111 Feb 9, 2018
d5b0016
add write_dir option to wrsamp. fixes #90
cx1111 Feb 9, 2018
1c9069b
apply annotation range in rdann. fixes #101
cx1111 Feb 9, 2018
356b873
fix inifite xqrs backsearch
cx1111 Feb 10, 2018
197a641
rewrite correct_peaks and add write_dir to wrann
cx1111 Feb 10, 2018
895a04b
update docs and move gqrs to qrs module
cx1111 Feb 11, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# For private use
private_tests.ipynb
private-tests.ipynb
notes.md

# Byte-compiled / optimized / DLL files
Expand Down
827 changes: 36 additions & 791 deletions README.rst

Large diffs are not rendered by default.

File renamed without changes
332 changes: 184 additions & 148 deletions demo.ipynb

Large diffs are not rendered by default.

79 changes: 0 additions & 79 deletions devtests.ipynb

This file was deleted.

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 = wfdb
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)
File renamed without changes.
Empty file added docs/_templates/.gitkeep
Empty file.
170 changes: 170 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# wfdb documentation build configuration file, created by
# sphinx-quickstart on Tue Jan 2 13:19:02 2018.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.

# 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
# sys.path.insert(0, os.path.abspath('.'))


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

# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'

# 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']

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

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'

# The master toctree document.
master_doc = 'index'

# General information about the project.
project = 'wfdb'
copyright = '2018, MIT Lab for Computational Physiology'
author = 'Chen Xie, Julien Dubiel'

import wfdb
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = wfdb.__version__
# The full version, including alpha/beta/rc tags.
release = wfdb.__version__

# 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 patterns also effect to 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'

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False


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

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'alabaster'

# 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']

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
# This is required for the alabaster theme
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
html_sidebars = {
'**': [
'relations.html', # needs 'show_related': True theme option to display
'searchbox.html',
]
}


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

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


# -- Options for LaTeX output ---------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'wfdb.tex', 'wfdb Documentation',
'Chen Xie, Julien Dubiel', 'manual'),
]


# -- Options for manual page output ---------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'wfdb', 'wfdb Documentation',
[author], 1)
]


# -- Options for Texinfo output -------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'wfdb', 'wfdb Documentation',
author, 'wfdb', 'One line description of project.',
'Miscellaneous'),
]



79 changes: 79 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
wfdb
====

Introduction
------------

The native Python waveform-database (WFDB) package. A library of tools
for reading, writing, and processing WFDB signals and annotations.

Core components of this package are based on the original WFDB
specifications. This package does not contain the exact same
functionality as the original WFDB package. It aims to implement as many
of its core features as possible, with user-friendly APIs. Additional
useful physiological signal-processing tools are added over time.


Development
-----------

The development repository is hosted at: https://github.com/MIT-LCP/wfdb-python

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.


API Reference
--------------

The exact API of all accessible functions and classes, as given by the docstrings, grouped by subpackage:

.. toctree::
:maxdepth: 2

io
plot
processing


Core Components
---------------

A subset of the above components are accessible by directly importing the base package.

.. toctree::
:maxdepth: 2

wfdb


Other Content
-------------
.. toctree::
:maxdepth: 2

installation
wfdb-specifications


Indices and tables
------------------

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


Authors
-------

`Chen Xie`_

`Julien Dubiel`_


.. _PEP8: https://www.python.org/dev/peps/pep-0008/
.. _docstrings: https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt
.. _existing tests: https://github.com/MIT-LCP/wfdb-python/tree/master/tests

.. _Chen Xie: https://github.com/cx1111/
.. _Julien Dubiel: https://github.com/Dubrzr/
10 changes: 10 additions & 0 deletions docs/installation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Installation
------------

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::

$ pip install wfdb

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::

$ pip install .
35 changes: 35 additions & 0 deletions docs/io.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
io
===

The input/output subpackage contains classes used to represent WFDB
objects, and functions to read, write, and download WFDB files.


WFDB Records
---------------

.. automodule:: wfdb.io
:members: rdrecord, rdsamp, wrsamp

.. autoclass:: wfdb.io.Record
:members: wrsamp, adc, dac

.. autoclass:: wfdb.io.MultiRecord
:members: multi_to_single


WFDB Anotations
---------------

.. automodule:: wfdb.io
:members: rdann, wrann, show_ann_labels, show_ann_classes

.. autoclass:: wfdb.io.Annotation
:members: wrann


Downloading
-----------

.. automodule:: wfdb.io
:members: get_dbs, get_record_list, dl_database, dl_files
5 changes: 5 additions & 0 deletions docs/plot.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
plot
----

.. automodule:: wfdb.plot
:members: plot_items, plot_wfdb, plot_all_records
41 changes: 41 additions & 0 deletions docs/processing.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
processing
==========

The processing subpackage contains signal-processing tools.


Basic Utility
-------------

Basic signal processing functions

.. automodule:: wfdb.processing
:members: resample_ann, resample_sig, resample_singlechan,
resample_multichan, normalize_bound, get_filter_gain

Heart Rate
----------

.. automodule:: wfdb.processing
:members: compute_hr


Peaks
-----

.. automodule:: wfdb.processing
:members: find_peaks, find_local_peaks, correct_peaks


QRS Detectors
-------------

.. automodule:: wfdb.processing
:members: XQRS, xqrs_detect, gqrs_detect


Annotation Evaluators
---------------------

.. automodule:: wfdb.processing
:members: Comparitor, compare_annotations
16 changes: 16 additions & 0 deletions docs/wfdb-specifications.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
WFDB Specifications
-------------------

The wfdb-python package is built according to the specifications of the original WFDB package.

* `WFDB Software Package`_
* `WFDB Applications Guide`_
* `WFDB Header Specifications`_
* `WFDB Signal Specifications`_
* `WFDB Annotation Specifications`_

.. _WFDB Software Package: http://physionet.org/physiotools/wfdb.shtml
.. _WFDB Applications Guide: http://physionet.org/physiotools/wag/
.. _WFDB Header Specifications: https://physionet.org/physiotools/wag/header-5.htm
.. _WFDB Signal Specifications: https://physionet.org/physiotools/wag/signal-5.htm
.. _WFDB Annotation Specifications: https://physionet.org/physiotools/wag/annot-5.htm
Loading