From 0e23a49ddb34fadf72fe0457d23eef066e1a3532 Mon Sep 17 00:00:00 2001 From: Alex Jadczak Date: Tue, 27 Jun 2023 12:25:13 -0400 Subject: [PATCH 1/3] bug-fix: Numpy ValueError when cheking empty list equality Using the equality operator with an empty list will result in the following error. ValueError: operands could not be broadcast together with shapes (28,) (0,) Using len() and inverting the logic avoids this issue. --- wfdb/io/annotation.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wfdb/io/annotation.py b/wfdb/io/annotation.py index 655d1212..5cde1edf 100644 --- a/wfdb/io/annotation.py +++ b/wfdb/io/annotation.py @@ -940,10 +940,10 @@ def wr_ann_file(self, write_fs, write_dir=""): core_bytes = self.calc_core_bytes() # Mark the end of the special annotation types if needed - if fs_bytes == [] and cl_bytes == []: - end_special_bytes = [] - else: + if len(fs_bytes) or len(cl_bytes): end_special_bytes = [0, 236, 255, 255, 255, 255, 1, 0] + else: + end_special_bytes = [] # Write the file with open( From 9602fd38bb6033c24ef7544947a1d4d34b9f8809 Mon Sep 17 00:00:00 2001 From: Benjamin Moody Date: Wed, 5 Jul 2023 13:21:40 -0400 Subject: [PATCH 2/3] run-tests.yml: drop python 3.7 from matrix. Currently, Python 3.7 in GitHub Actions (on macos-latest) appears to be broken ("No module named '_bz2'"). Moreover, this version has now reached its end of life. Remove it from the test matrix. --- .github/workflows/run-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 164bdd28..a6fb4d12 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -17,7 +17,7 @@ jobs: strategy: matrix: os: [windows-latest, ubuntu-latest, macos-latest] - python-version: ["3.7", "3.8", "3.9", "3.10"] + python-version: ["3.8", "3.9", "3.10"] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} From 07da4f48dad5cfc07420a061db4fd341a4e4a089 Mon Sep 17 00:00:00 2001 From: Benjamin Moody Date: Wed, 5 Jul 2023 13:24:37 -0400 Subject: [PATCH 3/3] run-tests.yml: add python 3.11 to matrix. Python 3.11 is the latest stable version; add it to the GitHub test matrix. --- .github/workflows/run-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index a6fb4d12..c1d170aa 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -17,7 +17,7 @@ jobs: strategy: matrix: os: [windows-latest, ubuntu-latest, macos-latest] - python-version: ["3.8", "3.9", "3.10"] + python-version: ["3.8", "3.9", "3.10", "3.11"] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }}