Skip to content

Commit 84c5c10

Browse files
author
Chen Xie
committed
install config file with numpy installation
1 parent 933e8a3 commit 84c5c10

File tree

4 files changed

+25
-51
lines changed

4 files changed

+25
-51
lines changed

devtests.ipynb

Lines changed: 4 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
},
1616
"outputs": [],
1717
"source": [
18-
"import numpy as np\n",
1918
"from wfdb import rdsamp\n",
2019
"# Testing rdsamp format 212\n",
2120
"sig, fields=rdsamp('sampledata/100', channels=[1], sampfrom=114, physical=0) # Default physical values\n",
@@ -744,23 +743,11 @@
744743
},
745744
{
746745
"cell_type": "code",
747-
"execution_count": 6,
746+
"execution_count": null,
748747
"metadata": {
749748
"collapsed": false
750749
},
751-
"outputs": [
752-
{
753-
"ename": "AttributeError",
754-
"evalue": "'function' object has no attribute 'dlrecordfiles'",
755-
"output_type": "error",
756-
"traceback": [
757-
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
758-
"\u001b[1;31mAttributeError\u001b[0m Traceback (most recent call last)",
759-
"\u001b[1;32m<ipython-input-6-476c7dab8711>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 2\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mwfdb\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 3\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 4\u001b[1;33m \u001b[0mwfdb\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mrdsamp\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mdlrecordfiles\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m'macecgdb/test01_00s'\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m'/home/cx1111/Downloads/wfdbrecords/prcp'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
760-
"\u001b[1;31mAttributeError\u001b[0m: 'function' object has no attribute 'dlrecordfiles'"
761-
]
762-
}
763-
],
750+
"outputs": [],
764751
"source": [
765752
"import os\n",
766753
"import wfdb\n",
@@ -802,27 +789,11 @@
802789
},
803790
{
804791
"cell_type": "code",
805-
"execution_count": 3,
792+
"execution_count": null,
806793
"metadata": {
807794
"collapsed": false
808795
},
809-
"outputs": [
810-
{
811-
"name": "stdout",
812-
"output_type": "stream",
813-
"text": [
814-
"Downloading missing file(s) into directory: /home/cx1111/Downloads/wfdbrecords/mimic2wdb/matched/s00001\n",
815-
"Download complete\n",
816-
"[[ nan nan nan nan]\n",
817-
" [ nan nan nan nan]\n",
818-
" [ nan nan nan nan]\n",
819-
" ..., \n",
820-
" [ 0.73493976 2.01818182 nan nan]\n",
821-
" [ 0.75903614 1.10909091 nan nan]\n",
822-
" [ 1.3373494 1.14545455 nan nan]]\n"
823-
]
824-
}
825-
],
796+
"outputs": [],
826797
"source": [
827798
"import wfdb\n",
828799
"sig, fields=wfdb.rdsamp('mimic2wdb/matched/s00001/s00001-2896-10-10-00-31')\n",

setup.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
from codecs import open
99
from os import path
1010

11+
xx=find_packages(exclude=['contrib', 'docs', 'tests'])
12+
print('look at this!:', xx)
13+
1114
here = path.abspath(path.dirname(__file__))
1215

1316
# Get the long description from the README file
@@ -71,9 +74,9 @@
7174
# If there are data files included in your packages that need to be
7275
# installed, specify them here. If using Python 2.6 or less, then these
7376
# have to be included in MANIFEST.in as well.
74-
# package_data={
75-
# 'sample': ['package_data.dat'],
76-
# },
77+
#package_dir={'wfdb': ''},
78+
package_data={'wfdb': ['wfdb.config'],
79+
},
7780

7881
# Although 'package_data' is the preferred approach, in some case you may
7982
# need to place data files outside of your packages. See:

wfdb/_rdsamp.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ def readheader(recordname): # For reading signal headers
379379

380380
# Get record line parameters
381381
(_, nseg, nsig, fs, counterfs, basecounter, nsamp,
382-
basetime, basedate) = rxRECORD.findall(headerlines[0])[0]
382+
basetime, basedate) = rxRECORD.findall(headerlines[0])[0]
383383

384384
# These fields are either mandatory or set to defaults.
385385
if not nseg:
@@ -412,20 +412,20 @@ def readheader(recordname): # For reading signal headers
412412
for i in range(0, int(nsig)): # will not run if nsignals=0
413413
# get signal line parameters
414414
(filename,
415-
fmt,
416-
sampsperframe,
417-
skew,
418-
byteoffset,
419-
adcgain,
420-
baseline,
421-
units,
422-
adcres,
423-
adczero,
424-
initvalue,
425-
checksum,
426-
blocksize,
427-
signame) = rxSIGNAL.findall(headerlines[i + 1])[0]
428-
415+
fmt,
416+
sampsperframe,
417+
skew,
418+
byteoffset,
419+
adcgain,
420+
baseline,
421+
units,
422+
adcres,
423+
adczero,
424+
initvalue,
425+
checksum,
426+
blocksize,
427+
signame) = rxSIGNAL.findall(headerlines[i + 1])[0]
428+
429429
# Setting defaults
430430
if not sampsperframe:
431431
# Setting strings here so we can always convert strings case
File renamed without changes.

0 commit comments

Comments
 (0)