From 5b0930bd50b9a8a1e3c587afbd879346a5dff99f Mon Sep 17 00:00:00 2001 From: agent3gatech <38729751+agent3gatech@users.noreply.github.com> Date: Mon, 4 Nov 2024 13:36:30 -0500 Subject: [PATCH 1/2] Corrected type and extended allowed types for MultiSegmentRecord Corrected misordered arguments in util.lines_to_file. Added 'list' as allowed types for seg_name and seg_len, for when writing MultiSegmentRecords. --- wfdb/io/_header.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wfdb/io/_header.py b/wfdb/io/_header.py index 419fb1cf..f678f4de 100644 --- a/wfdb/io/_header.py +++ b/wfdb/io/_header.py @@ -120,8 +120,8 @@ columns=_SPECIFICATION_COLUMNS, dtype="object", data=[ - [(str), "", None, True, None, None], # seg_name - [int_types, " ", "seg_name", True, None, None], # seg_len + [(str, list), "", None, True, None, None], # seg_name + [(int_types, list), " ", "seg_name", True, None, None], # seg_len ], ) @@ -779,7 +779,7 @@ def wr_header_file(self, write_fields, write_dir): comment_lines = ["# " + comment for comment in self.comments] header_lines += comment_lines - util.lines_to_file(self.record_name + ".hea", header_lines, write_dir) + util.lines_to_file(self.record_name + ".hea", write_dir, header_lines) def get_sig_segments(self, sig_name=None): """ From 09ea537a14e6fb01e4485c98f17cc844c0b5056a Mon Sep 17 00:00:00 2001 From: agent3gatech <38729751+agent3gatech@users.noreply.github.com> Date: Tue, 5 Nov 2024 15:06:47 -0500 Subject: [PATCH 2/2] Fix indentation error in _header.py --- wfdb/io/_header.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wfdb/io/_header.py b/wfdb/io/_header.py index f678f4de..0d420521 100644 --- a/wfdb/io/_header.py +++ b/wfdb/io/_header.py @@ -779,7 +779,7 @@ def wr_header_file(self, write_fields, write_dir): comment_lines = ["# " + comment for comment in self.comments] header_lines += comment_lines - util.lines_to_file(self.record_name + ".hea", write_dir, header_lines) + util.lines_to_file(self.record_name + ".hea", write_dir, header_lines) def get_sig_segments(self, sig_name=None): """