Skip to content

Commit

Permalink
pip installable through pypi
Browse files Browse the repository at this point in the history
  • Loading branch information
Chen Xie committed Sep 7, 2016
1 parent 3907097 commit 859e952
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 38 deletions.
3 changes: 3 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Include the license file
include LICENSE

# Include readme file
include README.md

# Include the data files
# recursive-include data *

Expand Down
85 changes: 50 additions & 35 deletions devtests.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 4,
"metadata": {
"collapsed": false
},
Expand All @@ -968,44 +968,59 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Help on function rdann in module wfdb._rdann:\n",
"\n",
"rdann(recordname, annot, sampfrom=0, sampto=[], anndisp=1)\n",
" Read a WFDB annotation file recordname.annot and return the fields as lists or arrays\n",
" \n",
" Usage: annsamp, anntype, num, subtype, chan, aux, annfs = rdann(recordname, annot, \n",
" sampfrom=0, sampto=[], \n",
" anndisp=1)\n",
" \n",
" Input arguments:\n",
" - recordname (required): The record name of the WFDB annotation file. ie. for \n",
" file '100.atr', recordname='100'\n",
" - annot (required): The annotator extension of the annotation file. ie. for \n",
" file '100.atr', annot='atr'\n",
" - sampfrom (default=0): The minimum sample number for annotations to be returned.\n",
" - sampto (default=the final annotation sample): The maximum sample number for \n",
" annotations to be returned.\n",
" - anndisp (default = 1): The annotation display flag that controls the data type \n",
" of the 'anntype' output parameter. 'anntype' will either be an integer key(0), \n",
" a shorthand display symbol(1), or a longer annotation code.\n",
" \n",
" Output arguments:\n",
" - annsamp: The annotation location in samples relative to the beginning of the record.\n",
" - anntype: The annotation type according the the standard WFDB keys.\n",
" - subtype: The marked class/category of the annotation.\n",
" - chan: The signal channel associated with the annotations.\n",
" - num: The marked annotation number. This is not equal to the index of the current annotation.\n",
" - aux: The auxiliary information string for the annotation.\n",
" - annfs: The sampling frequency written in the beginning of the annotation file if present.\n",
" \n",
" *NOTE: Every annotation contains the 'annsamp' and 'anntype' field. All \n",
" other fields default to 0 or empty if not present.\n",
"\n"
"<class 'int'>\n",
"Downloading missing file(s) into directory: /home/cx1111/PhysionetProjects/wfdb-python\n",
"Downloaded all missing files for record.\n"
]
},
{
"data": {
"text/plain": [
"(array([[ 1.00000000e-01, -3.05110000e+02, -2.87190000e+02,\n",
" -2.66720000e+02],\n",
" [ -2.87190000e+02, -2.71830000e+02, -2.87190000e+02,\n",
" 1.10000000e-01],\n",
" [ -2.99990000e+02, -2.87190000e+02, -2.64160000e+02,\n",
" -2.87190000e+02],\n",
" ..., \n",
" [ -2.79520000e+02, -2.87190000e+02, -2.66710000e+02,\n",
" -2.87190000e+02],\n",
" [ 1.20000000e-01, -2.00160000e+02, -2.87190000e+02,\n",
" -2.79520000e+02],\n",
" [ -2.87190000e+02, -2.84640000e+02, -2.87190000e+02,\n",
" 1.20000000e-01]]),\n",
" {'basedate': '',\n",
" 'baseline': [0, 0, 0, 0],\n",
" 'basetime': '',\n",
" 'byteoffset': [0, 0, 0, 0],\n",
" 'comments': [' <age>: 25 <sex>: M <diagnoses>: (none) <medications>: (none)'],\n",
" 'filename': ['test01_00s.dat',\n",
" 'test01_00s.dat',\n",
" 'test01_00s.dat',\n",
" 'test01_00s.dat'],\n",
" 'fmt': ['16', '16', '16', '16'],\n",
" 'fs': 500.0,\n",
" 'gain': [100.0, 100.0, 100.0, 100.0],\n",
" 'initvalue': [10, -8, -57, -66],\n",
" 'nsamp': 4000,\n",
" 'nsampseg': [],\n",
" 'nseg': 1,\n",
" 'nsig': 4,\n",
" 'sampsperframe': [1, 1, 1, 1],\n",
" 'signame': ['ECG', 'ECG', 'ECG', 'ECG'],\n",
" 'skew': [0, 0, 0, 0],\n",
" 'units': ['mV', 'mV', 'mV', 'mV']})"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"help(wfdb.rdann)"
"import wfdb\n",
"\n",
"wfdb.rdsamp('macecgdb/test01_00s', pbdl=1)\n"
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
setup(
name='wfdb',

# Versions should comply with PEP440. For a discussion on single-sourcing
# Versions should comply with PEP440. For a discussion on single-sourcing
# the version across setup.py and the project code, see
# https://packaging.python.org/en/latest/single_source_version.html
version='0.1.0',
version='0.1.1',

description='The WFDB Python Toolbox',
long_description=long_description,
Expand Down
2 changes: 1 addition & 1 deletion wfdb/_rdsamp.py
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,7 @@ def rdsamp(
Example: sig, fields = wfdb.rdsamp('macecgdb/test01_00s', sampfrom=800, pbdl=1, dldir='/home/username/Downloads/wfdb')
"""

if sampfrom < 0:
sys.exit("sampfrom must be non-negative")
if channels and min(channels) < 0:
Expand Down

0 comments on commit 859e952

Please sign in to comment.