Skip to content

Commit 8d62f0b

Browse files
committed
Clean code
1 parent 6e58329 commit 8d62f0b

File tree

2 files changed

+27
-28
lines changed

2 files changed

+27
-28
lines changed

.gitattributes

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
1-
* text=auto
1+
* text=auto
22

33
# batch files
44

5-
*.sh text eol=lf
6-
*.bat text eol=crlf
5+
*.sh text eol=lf
6+
*.bat text eol=crlf
77

88
# sensible defaults taken from https://github.com/alexkaratarakis/gitattributes
99

1010
# Documents
1111

12-
*.md text
13-
*.adoc text
14-
*.csv text
12+
*.md text
13+
*.adoc text
14+
*.csv text
1515
*.py text
1616
Makefile text eol=lf
1717
Dockerfile text eol=lf
1818

1919
# Graphics
2020

21-
*.png binary
22-
*.jpg binary
23-
*.jpeg binary
24-
*.gif binary
21+
*.png binary
22+
*.jpg binary
23+
*.jpeg binary
24+
*.gif binary
2525

2626
# Program files / Libraries
2727

28-
*.json text
29-
*.properties text
30-
*.tld text
31-
*.txt text
32-
*.xml text
28+
*.json text
29+
*.properties text
30+
*.tld text
31+
*.txt text
32+
*.xml text
3333

scp.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
33

4+
45
class ScpRecord:
56
"""Container for all SCP sections"""
67
def __init__(self):
@@ -50,8 +51,6 @@ class Section():
5051
def __init__(self, scpHeader):
5152
self.h = scpHeader
5253

53-
# 16
54-
5554

5655
class SectionHeader:
5756
"""A section header for each section"""
@@ -100,13 +99,8 @@ def pointer_for_section(self, section_id):
10099
return None
101100

102101

103-
104-
105-
# in section3
106-
107-
108102
class LeadIdentification:
109-
"""LeadIdenticitation with information about sample count"""
103+
"""LeadIdenticitation with information about sample count (Section 3)"""
110104
def __init__(self):
111105
self.startsample = 0
112106
self.endsample = 0
@@ -120,8 +114,6 @@ def sample_count(self):
120114
return self.endsample - self.startsample + 1
121115

122116

123-
124-
125117
class DataSamples:
126118
"""
127119
Data samples for a lead, for Sections 5 (ref. beat samples) and Section 6 (samples)
@@ -139,12 +131,14 @@ def __init__(self, header, pointer):
139131
self.tags = []
140132
self.datalen = 0
141133

134+
142135
class Section2(Section):
143136
"""Section 2 - Huffman tables used in encoding of Ecg data"""
144137
def __init__(self, header, pointer):
145138
super().__init__(header)
146139
self.p = pointer
147-
140+
141+
148142
class Section3(Section):
149143
"""Section 3 - ECG Leads definition"""
150144
def __init__(self, header, pointer):
@@ -164,7 +158,8 @@ class Section4(Section):
164158
def __init__(self, header, pointer):
165159
super().__init__(header)
166160
self.p = pointer
167-
161+
162+
168163
class Section5(Section):
169164
"""Section 5 with samples"""
170165
def __init__(self, header, pointer):
@@ -218,26 +213,30 @@ def __init__(self, header, pointer):
218213
super().__init__(header)
219214
self.p = pointer
220215

216+
221217
class Section9(Section):
222218
"""Section 9 - Manufacturer Specific diagnostic and overreading data"""
223219
def __init__(self, header, pointer):
224220
super().__init__(header)
225221
self.p = pointer
226222

223+
227224
class Section10(Section):
228225
"""Section 10 - per Lead ECG Measurements"""
229226
def __init__(self, header, pointer):
230227
super().__init__(header)
231228
self.p = pointer
232229

230+
233231
class Section11(Section):
234232
"""Section 11 - Universal Statement Codes resulting from the interpretation"""
235233
def __init__(self, header, pointer):
236234
super().__init__(header)
237235
self.p = pointer
238236

237+
239238
class Section12(Section):
240239
"""Section 12 - Long-Term ECG Rythm data"""
241240
def __init__(self, header, pointer):
242241
super().__init__(header)
243-
self.p = pointer
242+
self.p = pointer

0 commit comments

Comments
 (0)