diff --git a/docs/changes.rst b/docs/changes.rst index ac4762af..061f4877 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -5,6 +5,25 @@ This page lists recent changes in the `wfdb` package (since version 4.0.0) that .. _development repository: https://github.com/MIT-LCP/wfdb-python +Version 4.1.2 (June 2023) +----------------------------- + +**Handle more than 8 compressed signals in wrsamp** + Previously, the package did not support writing of compressed records with more than 8 channels. + +**Use int64 instead of int for ann2rr** + Fixes 'np has no attribute np.int' error raised when running ann2rr. + +Version 4.1.1 (April 2023) +----------------------------- + +**Remove upper bound on dependencies** + Previously, the package provided restrictive caps on version number of dependencies. These caps have been removed. + +**Miscellaneous style and typing fixes** + Various fixes were made to code style and handling of data types. + + Version 4.1.0 (December 2022) ----------------------------- diff --git a/pyproject.toml b/pyproject.toml index 735b64fb..406cf72f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "wfdb" -version = "4.1.0" +version = "4.1.2" description = "The WFDB Python package: tools for reading, writing, and processing physiologic signals and annotations." authors = ["The Laboratory for Computational Physiology "] readme = "README.md" diff --git a/tests/test_record.py b/tests/test_record.py index 9563ef11..8d09e39d 100644 --- a/tests/test_record.py +++ b/tests/test_record.py @@ -286,6 +286,33 @@ def test_read_write_flac_multifrequency(self): ) assert record == record_write + def test_read_write_flac_many_channels(self): + """ + Check we can read and write to format 516 with more than 8 channels. + """ + # Read in a signal with 12 channels in format 16 + record = wfdb.rdrecord("sample-data/s0010_re", physical=False) + + # Test that we can write out the signal in format 516 + wfdb.wrsamp( + record_name="s0010_re_fmt516", + fs=record.fs, + units=record.units, + sig_name=record.sig_name, + fmt=["516"] * record.n_sig, + d_signal=record.d_signal, + adc_gain=record.adc_gain, + baseline=record.baseline, + write_dir=self.temp_path, + ) + + # Check that signal matches the original + record_fmt516 = wfdb.rdrecord( + os.path.join(self.temp_path, "s0010_re_fmt516"), + physical=False, + ) + assert (record.d_signal == record_fmt516.d_signal).all() + def test_read_flac_longduration(self): """ Three signals multiplexed in a FLAC file, over 2**24 samples. diff --git a/wfdb/io/_header.py b/wfdb/io/_header.py index dbcc0177..419fb1cf 100644 --- a/wfdb/io/_header.py +++ b/wfdb/io/_header.py @@ -384,6 +384,7 @@ def _auto_signal_file_names(self): num_groups += 1 channels_in_group = 0 group_number.append(num_groups) + channels_in_group += 1 prev_fmt = ch_fmt prev_spf = ch_spf diff --git a/wfdb/processing/hr.py b/wfdb/processing/hr.py index 6d6502ad..5e6bfc36 100644 --- a/wfdb/processing/hr.py +++ b/wfdb/processing/hr.py @@ -227,7 +227,7 @@ def ann2rr( elif format == "h": out_interval = time_interval / (60 * 60) else: - out_interval = np.around(time_interval * ann.fs).astype(np.int) + out_interval = np.around(time_interval * ann.fs).astype(np.int64) if as_array: return out_interval diff --git a/wfdb/version.py b/wfdb/version.py index 70397087..13ffcf42 100644 --- a/wfdb/version.py +++ b/wfdb/version.py @@ -1 +1 @@ -__version__ = "4.1.0" +__version__ = "4.1.2"