Skip to content

Commit 8ae7124

Browse files
committed
Refactors code / removes previously used code
1 parent d6ee68c commit 8ae7124

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

wfdb/io/record.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2048,17 +2048,14 @@ def sampfreq(record_name, pn_dir=None):
20482048
>>> ECG 4 500
20492049
20502050
"""
2051-
dir_name, base_record_name = os.path.split(record_name)
2052-
dir_name = os.path.abspath(dir_name)
2053-
20542051
if (pn_dir is not None) and ('.' not in pn_dir):
20552052
dir_list = pn_dir.split(os.sep)
20562053
pn_dir = posixpath.join(dir_list[0], get_version(dir_list[0]),
20572054
*dir_list[1:])
20582055

2059-
record = rdheader(record_name, pn_dir=pn_dir).__dict__
2060-
samps_per_frame = [record['fs']*samp for samp in record['samps_per_frame']]
2061-
sig_name = record['sig_name']
2056+
record = rdheader(record_name, pn_dir=pn_dir)
2057+
samps_per_frame = [record.fs*samp for samp in record.samps_per_frame]
2058+
sig_name = record.sig_name
20622059

20632060
for sig,samp in zip(sig_name, samps_per_frame):
20642061
print('{}\t{}'.format(sig,samp))

0 commit comments

Comments
 (0)