Skip to content

Datetime on the header file is restricted with DD/MM/YYYY format #128

@zeynep-ozturk

Description

@zeynep-ozturk

Hi,
I wanted to use your package to make peak detection and remove them. However, in my case the header files are like this:

A00001 1 300 9000 2014-05-08 05:05:15
A00001.mat 16+24 1000/mV 16 0 -127 0 0 ECG

This is from the 2017 challenge by the way. Because your code only supports DD/MM/YYYY format, I am getting this error:

File "/Users/zeynepozturk/dersler/ie517_hw3/venv/lib/python3.6/site-packages/wfdb/io/record.py", line 1130, in rdrecord
record = rdheader(record_name, pb_dir=pb_dir, rd_segments=False)
File "/Users/zeynepozturk/dersler/ie517_hw3/venv/lib/python3.6/site-packages/wfdb/io/record.py", line 981, in rdheader
record_fields = _header._read_record_line(header_lines[0])
File "/Users/zeynepozturk/dersler/ie517_hw3/venv/lib/python3.6/site-packages/wfdb/io/_header.py", line 743, in _read_record_line
record_fields['base_time'] = wfdb_strptime(record_fields['base_time'])
File "/Users/zeynepozturk/dersler/ie517_hw3/venv/lib/python3.6/site-packages/wfdb/io/_header.py", line 672, in wfdb_strptime
return datetime.datetime.strptime(time_string, time_fmt).time()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/_strptime.py", line 565, in _strptime_datetime
tt, fraction = _strptime(data_string, format)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/_strptime.py", line 365, in _strptime
data_string[found.end():])
ValueError: unconverted data remains: 14
I am using version '2.0.4'.

This is my first issue on Github, so I apologize beforehand for my mistakes.

Hope you can improve this and be open to new date formats.

Best regards,

Zeynep

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions