Skip to content

Commit fcff50e

Browse files
committed
1 parent b479f50 commit fcff50e

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

recipe/meta.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ package:
88
source:
99
url: https://github.com/MIT-LCP/{{ name }}-python/archive/refs/tags/v{{ version }}.tar.gz
1010
sha256: c96c62b8abede8c0987c77d49285c923f114787a96d110cf95dac5e5d56360cd
11+
patches:
12+
# fix https://github.com/MIT-LCP/wfdb-python/pull/459
13+
- patches/0001_fix-numpy-valueerror.patch
1114

1215
build:
1316
number: 0
@@ -16,6 +19,9 @@ build:
1619
skip: true # [py<37 or s390x or win]
1720

1821
requirements:
22+
build:
23+
- patch # [not win]
24+
- m2-patch # [win]
1925
host:
2026
- pip
2127
- poetry-core >=1.0.0
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
From 0e23a49ddb34fadf72fe0457d23eef066e1a3532 Mon Sep 17 00:00:00 2001
2+
From: Alex Jadczak <[email protected]>
3+
Date: Tue, 27 Jun 2023 12:25:13 -0400
4+
Subject: [PATCH] bug-fix: Numpy ValueError when cheking empty list equality
5+
6+
FIX: https://github.com/MIT-LCP/wfdb-python/pull/459
7+
8+
Using the equality operator with an empty list will result in the
9+
following error.
10+
11+
ValueError: operands could not be broadcast together with shapes (28,) (0,)
12+
13+
Using len() and inverting the logic avoids this issue.
14+
---
15+
wfdb/io/annotation.py | 6 +++---
16+
1 file changed, 3 insertions(+), 3 deletions(-)
17+
18+
diff --git a/wfdb/io/annotation.py b/wfdb/io/annotation.py
19+
index 655d121..5cde1ed 100644
20+
--- a/wfdb/io/annotation.py
21+
+++ b/wfdb/io/annotation.py
22+
@@ -940,10 +940,10 @@ def wr_ann_file(self, write_fs, write_dir=""):
23+
core_bytes = self.calc_core_bytes()
24+
25+
# Mark the end of the special annotation types if needed
26+
- if fs_bytes == [] and cl_bytes == []:
27+
- end_special_bytes = []
28+
- else:
29+
+ if len(fs_bytes) or len(cl_bytes):
30+
end_special_bytes = [0, 236, 255, 255, 255, 255, 1, 0]
31+
+ else:
32+
+ end_special_bytes = []
33+
34+
# Write the file
35+
with open(

0 commit comments

Comments
 (0)