From f1c67b3115dc2c1f78319dd999e3059d7d8a6720 Mon Sep 17 00:00:00 2001 From: SamJelfs <68540342+SamJelfs@users.noreply.github.com> Date: Thu, 13 Feb 2025 19:41:13 +0100 Subject: [PATCH] Update summary printing when writing EDF When writing an EDF file the summary of recording length is printed to console. If the number of bytes per block is not an integer this fails with `ValueError: Unknown format code 'd' for object of type 'float'`. Ensure cast to int first. --- wfdb/io/convert/edf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wfdb/io/convert/edf.py b/wfdb/io/convert/edf.py index c2d0af47..f6f49415 100644 --- a/wfdb/io/convert/edf.py +++ b/wfdb/io/convert/edf.py @@ -959,12 +959,12 @@ def wfdb_to_edf( [ num_blocks, num_blocks * int(frames_per_block), - num_blocks * bytes_per_block, + num_blocks * int(bytes_per_block), ] ), num_blocks, num_blocks * int(frames_per_block), - num_blocks * bytes_per_block, + num_blocks * int(bytes_per_block), ) ) print(