Skip to content

Commit 1ef2a98

Browse files
authored
Merge pull request #1635 from alejoe91/fix-edf
Fix edfrawio for pyedflib>=0.1.39
2 parents b1f227f + 1e8302d commit 1ef2a98

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

neo/rawio/edfrawio.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ def _parse_header(self):
100100
for ch_idx, sig_dict in enumerate(self.signal_headers):
101101
ch_name = sig_dict["label"]
102102
chan_id = ch_idx
103-
sr = sig_dict["sample_rate"] # Hz
103+
# pyedf >= 0.1.39 uses sample_frequency, pyedf < 0.1.39 uses sample_rate
104+
sr = sig_dict.get("sample_frequency") or sig_dict.get("sample_rate") # Hz
104105
dtype = "int16" # assume general int16 based on edf documentation
105106
units = sig_dict["dimension"]
106107
physical_range = sig_dict["physical_max"] - sig_dict["physical_min"]
@@ -160,6 +161,7 @@ def _parse_header(self):
160161
"label",
161162
"dimension",
162163
"sample_rate",
164+
"sample_frequency",
163165
"physical_min",
164166
"physical_max",
165167
"digital_min",

0 commit comments

Comments
 (0)