Skip to content

Commit 55153c9

Browse files
committed
dev
1 parent a31bf01 commit 55153c9

10 files changed

+68
-265
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
private_tests.ipynb
2+
13
# Byte-compiled / optimized / DLL files
24
__pycache__/
35
*.py[cod]

devtests.ipynb

Lines changed: 0 additions & 237 deletions
Original file line numberDiff line numberDiff line change
@@ -45,243 +45,6 @@
4545
"wfdb.plotrec(rec,timeunits='seconds', ecggrids='all', figsize = (10, 4))"
4646
]
4747
},
48-
{
49-
"cell_type": "code",
50-
"execution_count": 2,
51-
"metadata": {
52-
"collapsed": false
53-
},
54-
"outputs": [
55-
{
56-
"name": "stdout",
57-
"output_type": "stream",
58-
"text": [
59-
"[1, 2, 3]\n"
60-
]
61-
}
62-
],
63-
"source": [
64-
"def stuff(a):\n",
65-
" a[0]=100\n",
66-
"\n",
67-
"x = [1,2,3]\n",
68-
"\n",
69-
"stuff(x[:])\n",
70-
"\n",
71-
"print(x)"
72-
]
73-
},
74-
{
75-
"cell_type": "code",
76-
"execution_count": 3,
77-
"metadata": {
78-
"collapsed": false
79-
},
80-
"outputs": [
81-
{
82-
"data": {
83-
"text/plain": [
84-
"array([[ 0., 0., 0.],\n",
85-
" [ 0., 0., 0.],\n",
86-
" [ 0., 0., 0.],\n",
87-
" [ 0., 0., 0.],\n",
88-
" [ 0., 0., 0.],\n",
89-
" [ 0., 0., 0.],\n",
90-
" [ 0., 0., 0.]])"
91-
]
92-
},
93-
"execution_count": 3,
94-
"metadata": {},
95-
"output_type": "execute_result"
96-
}
97-
],
98-
"source": [
99-
"import numpy as np\n",
100-
"x = np.zeros([10,3])\n",
101-
"x=x[:-3,:]\n",
102-
"x"
103-
]
104-
},
105-
{
106-
"cell_type": "code",
107-
"execution_count": 23,
108-
"metadata": {
109-
"collapsed": false
110-
},
111-
"outputs": [
112-
{
113-
"name": "stdout",
114-
"output_type": "stream",
115-
"text": [
116-
"[[ 0. 0. 0.]\n",
117-
" [ 0. 0. 0.]\n",
118-
" [ 0. 0. 0.]\n",
119-
" [ 0. 0. 0.]\n",
120-
" [ 0. 0. 0.]\n",
121-
" [ 0. 0. 0.]\n",
122-
" [ 0. 0. 0.]]\n",
123-
"[1 2 3]\n"
124-
]
125-
}
126-
],
127-
"source": [
128-
"x[1:6,0]\n",
129-
"y=np.array([1,2,3])\n",
130-
"print(x)\n",
131-
"print(y)"
132-
]
133-
},
134-
{
135-
"cell_type": "code",
136-
"execution_count": 14,
137-
"metadata": {
138-
"collapsed": true
139-
},
140-
"outputs": [],
141-
"source": [
142-
"sampsperframe = [1,2,1]\n",
143-
"ch=0"
144-
]
145-
},
146-
{
147-
"cell_type": "code",
148-
"execution_count": 15,
149-
"metadata": {
150-
"collapsed": false
151-
},
152-
"outputs": [
153-
{
154-
"data": {
155-
"text/plain": [
156-
"0"
157-
]
158-
},
159-
"execution_count": 15,
160-
"metadata": {},
161-
"output_type": "execute_result"
162-
}
163-
],
164-
"source": [
165-
"sum(([0] + sampsperframe)[:ch + 1])"
166-
]
167-
},
168-
{
169-
"cell_type": "code",
170-
"execution_count": 6,
171-
"metadata": {
172-
"collapsed": false
173-
},
174-
"outputs": [
175-
{
176-
"data": {
177-
"text/plain": [
178-
"[0, 1, 2, 1]"
179-
]
180-
},
181-
"execution_count": 6,
182-
"metadata": {},
183-
"output_type": "execute_result"
184-
}
185-
],
186-
"source": [
187-
"([0] + sampsperframe)"
188-
]
189-
},
190-
{
191-
"cell_type": "code",
192-
"execution_count": 16,
193-
"metadata": {
194-
"collapsed": false
195-
},
196-
"outputs": [
197-
{
198-
"data": {
199-
"text/plain": [
200-
"1"
201-
]
202-
},
203-
"execution_count": 16,
204-
"metadata": {},
205-
"output_type": "execute_result"
206-
}
207-
],
208-
"source": [
209-
"sum((sampsperframe)[:ch+1])"
210-
]
211-
},
212-
{
213-
"cell_type": "code",
214-
"execution_count": 24,
215-
"metadata": {
216-
"collapsed": false
217-
},
218-
"outputs": [
219-
{
220-
"name": "stdout",
221-
"output_type": "stream",
222-
"text": [
223-
"[array([ 0., 0.]), array([ 0., 0., 0.]), array([ 0., 0., 0., 0.])]\n"
224-
]
225-
}
226-
],
227-
"source": [
228-
"l = []\n",
229-
"\n",
230-
"for i in range(2,5):\n",
231-
" a = np.zeros(i)\n",
232-
" \n",
233-
" l.append(a)\n",
234-
" \n",
235-
"print(l)"
236-
]
237-
},
238-
{
239-
"cell_type": "code",
240-
"execution_count": 25,
241-
"metadata": {
242-
"collapsed": false
243-
},
244-
"outputs": [
245-
{
246-
"data": {
247-
"text/plain": [
248-
"array([ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.])"
249-
]
250-
},
251-
"execution_count": 25,
252-
"metadata": {},
253-
"output_type": "execute_result"
254-
}
255-
],
256-
"source": [
257-
"np.zeros(10)"
258-
]
259-
},
260-
{
261-
"cell_type": "code",
262-
"execution_count": 28,
263-
"metadata": {
264-
"collapsed": false
265-
},
266-
"outputs": [
267-
{
268-
"ename": "TypeError",
269-
"evalue": "list indices must be integers or slices, not tuple",
270-
"output_type": "error",
271-
"traceback": [
272-
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
273-
"\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)",
274-
"\u001b[0;32m<ipython-input-28-8592bdc34bd6>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0mx\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;36m2\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;36m3\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;36m4\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;36m5\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0mx\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m2\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;36m3\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;36m9\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 3\u001b[0m \u001b[0mx\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
275-
"\u001b[0;31mTypeError\u001b[0m: list indices must be integers or slices, not tuple"
276-
]
277-
}
278-
],
279-
"source": [
280-
"x=[1,2,3,4,5]\n",
281-
"x[2,3] = 9\n",
282-
"x"
283-
]
284-
},
28548
{
28649
"cell_type": "code",
28750
"execution_count": null,

sampledata/100_3chan.dat

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
�3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3Ӹ3��3��3ij3��3��3ѥ3��3��3��3�
2+
4��C�3�(4��C>�CWDKDkKD|tD|�D_�D�*D��4�Dh�Ch"4�"4��3߷3ܷ3��3��3�3��3��3�3��3��3ܽ3��3��3߾3��3��3��3��3��3��3��3��3޼3��3��3�3��3��3پ3��3��3۾3��3��3ݾ3��3��3ڻ3��3��3߽3��3��3��3��3��3��3��3��3ܼ3��3��3ݼ3��3��3ع3��3��3ۼ3��3��3޾3��3��3ټ3��3��3ؿ3��3��3ܾ3��3��3׽3��3��3ܼ3��3��3ؼ3��3��3׹3��3��3ػ3��3��3��3��3��3־3��3��3۾3��3��3ؽ3��3��3ӻ3��3��3ؼ3��3��3ս3��3��3Ѻ3��3��3л3��3��3н3��3��3̺3��3��3˹3��3��3Ȼ3��3��3ź3��3��3ĸ3��3��3ķ3��3��3��3��3��3��3��3��3¹3��3��3��3��3��3��3��3��3ø3��3��3Ʒ3��3��3ʹ3��3��3п3��3��3ν3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3¿3ӿ3��3��3��3��3��3��3��3��3��3��3��3Կ3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3¾3Ӿ3��3��3ֿ3��3��3��3��3��3Ͽ3��3��3λ3��3��3Ҽ3��3��3л3��3��3Ѿ3��3��3Ҿ3��3��3л3��3��3Ӽ3��3��3ѿ3��3��3ʺ3��3��3Ƹ3��3��3��3��3��3��3��3��3ו3��3��C�3�4��C�3�&4�/D</DbRDb�Dc�D�aD��DH�D�D��4ߗDb�Cb!4�!4�3��3��3��3��3��3��3��3ť3��3��3Ų3��3��3ȳ3��3��3Ǵ3��3��3ƴ3��3��3ɳ3��3��3ʳ3��3��3ű3��3��3ɮ3��3��3˱3��3��3ů3��3��3dz3��3��3˲3��3��3ȯ3��3��3ʮ3��3��3ʲ3��3��3ȯ3��3��3˰3��3��3˯3��3��3ǭ3��3��3˰3��3��3ͱ3��3��3ɯ3��3��3ʲ3��3��3ɳ3��3��3Ȯ3��3��3ɱ3��3��3ɵ3��3��3ű3��3��3ɰ3��3��3Dz3��3��3��3��3��3í3��3��3±3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3Ů3��3��3ʶ3��3��3˸3��3��3ϼ3��3��3��3��3��3վ3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3ٽ3��3��3׽3��3��3ؾ3��3��3һ3��3��3׻3��3��3پ3��3��3ӻ3��3��3ջ3��3��3׾3��3��3Ӽ3��3��3ӽ3��3��3վ3��3��3չ3��3��3չ3��3��3ּ3��3��3һ3��3��3ֻ3��3��3ؾ3��3��3Ի3��3��3պ3��3��3ؾ3��3��3Ի3��3��3׺3��3��3׾3��3��3Լ3��3��3׾3��3��3ؾ3��3��3һ3��3��3ؼ3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3ؼ3��3��3׽3��3��3Թ3��3��3ָ3��3��3غ3��3��3Է3��3��3Դ3��3��3׷3��3��3Ӵ3��3��3մ3��3��3Թ3��3��3в3��3��3Ȯ3��3��3��3��3��3��3��3��3�3�4��C�3�44��CK�CeDRDRD��D��Dz�D�@D��4��Dh�Ch
3+
4�
4+
4��3��3М3��3��3ͧ3��3��3ϱ3��3��3ͱ3��3��3̱3��3��3ϱ3��3��3β3��3��3ʱ3��3��3˯3��3��3̰3��3��3ȯ3��3��3ʭ3��3��3˯3��3��3Ƭ3��3��3ˬ3��3��3̮3��3��3ȫ3��3��3ˬ3��3��3ͮ3��3��3ɫ3��3��3ɰ3��3��3˰3��3��3ȱ3��3��3ȯ3��3��3ʰ3��3��3ƭ3��3��3ʫ3��3��3ǭ3��3��3ī3��3��3Ŭ3��3��3Ű3��3��3®3��3��3��3��3��3±3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3²3��3��3ɸ3��3��3ν3��3��3Ͻ3��3��3׿3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3ؿ3��3��3��3��3��3��3��3��3��3��3��3��3��3¿3ֿ3��3��3��3��3��3��3��3��3Ӻ3��3��3ּ3��3��3վ3��3��3Ӽ3��3��3ֺ3��3��3ҹ3��3��3ι3��3��3ҹ3��3��3Ҽ3��3��3Ϻ3��3��3з3��3��3ӹ3��3��3ж3��3��3ж3��3��3ѷ3��3��3ҷ3��3��3Ӷ3��3��3Һ3��3��3κ3��3��3ҷ3��3��3ѻ3��3��3ѹ3��3��3Ӹ3��3��3չ3��3��3ѵ3��3��3ӹ3��3��3ӹ3��3��3Ҹ3��3��3ո3��3��3ӹ3��3��3ѻ3��3��3Ӽ3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3��3ո3��3��3ֳ3��3��3׶3��3��3ӳ3��3��3Ա3��3��3ֳ3��3��3ѱ3��3��3Ӱ3��3��3Ե3��3��3ұ3��3��3ԯ3��3��3Ѳ3��3��3ȫ3��3��3��3��3��3��3��3��3��3��3�3�3��3��3�3�4��C�3�04��CJ�CcDJDzJD�D�Dm�D�.D��4�D_�C_4�4��3Ü3͜3��3��3ҡ3��3��3ϲ3��3��3̰3��3��3ѯ3��3��3ϲ3��3��3˯3��3��3̯3��3��3ϲ3��3��3ʮ3��3��3ͮ3��3��3ί3��3��3ʯ3��3��3ˮ3��3��3ϳ3��3��3ʱ3��3��3Ͱ3��3��3α3��3��3ʯ3��3��3Ͱ3��3��3ͳ3��3��3ɳ3��3��3˲3��3��3̵

sampledata/100_3chan.hea

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
100_3chan 3 360.0 999
2+
100_3chan.dat 212 200(1024)/mV 11 1024 995 43172 0 I
3+
100_3chan.dat 212 200(1024)/mV 11 1024 1011 63954 0 II
4+
100_3chan.dat 212 200(1024)/mV 11 1024 995 43172 0 III
5+
# Made this to test fmt 212 with odd number of samples

sampledata/100skew.hea

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
100skew 2 360 650000
2+
100.dat 212 200 11 1024 995 -22131 0 MLII
3+
100.dat 212:3 200 11 1024 1011 20052 0 V5
4+
# This is just record 100 with a skew inserted in channel 1
5+
# 69 M 1085 1629 x1
6+
# Aldomet, Inderal

wfdb/_headers.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ def getwritesubset(self, specfields):
5555
continue
5656

5757
fielditem = getattr(self, f)
58-
5958
# If the field is required by default or has been defined by the user
6059
if fieldspecs[f].write_req or (fielditem is not None and fielditem[ch] is not None):
6160
rf=f
@@ -563,7 +562,7 @@ def __init__(self, allowedtypes, delimiter, dependency, write_req, read_def, wri
563562
# Signal specification fields.
564563
sigfieldspecs = OrderedDict([('filename', WFDBheaderspecs([str], '', None, True, None, None)),
565564
('fmt', WFDBheaderspecs([str], ' ', 'filename', True, None, None)),
566-
('sampsperframe', WFDBheaderspecs(inttypes, 'x', 'fmt', False, None, None)),
565+
('sampsperframe', WFDBheaderspecs(inttypes, 'x', 'fmt', False, 1, None)),
567566
('skew', WFDBheaderspecs(inttypes, ':', 'fmt', False, None, None)),
568567
('byteoffset', WFDBheaderspecs(inttypes, '+', 'fmt', False, None, None)),
569568
('adcgain', WFDBheaderspecs(floattypes, ' ', 'fmt', True, 200., None)),

0 commit comments

Comments
 (0)