Skip to content

Commit

Permalink
Merge pull request #1635 from alejoe91/fix-edf
Browse files Browse the repository at this point in the history
Fix edfrawio for pyedflib>=0.1.39
  • Loading branch information
alejoe91 authored Jan 27, 2025
2 parents b1f227f + 1e8302d commit 1ef2a98
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion neo/rawio/edfrawio.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ def _parse_header(self):
for ch_idx, sig_dict in enumerate(self.signal_headers):
ch_name = sig_dict["label"]
chan_id = ch_idx
sr = sig_dict["sample_rate"] # Hz
# pyedf >= 0.1.39 uses sample_frequency, pyedf < 0.1.39 uses sample_rate
sr = sig_dict.get("sample_frequency") or sig_dict.get("sample_rate") # Hz
dtype = "int16" # assume general int16 based on edf documentation
units = sig_dict["dimension"]
physical_range = sig_dict["physical_max"] - sig_dict["physical_min"]
Expand Down Expand Up @@ -160,6 +161,7 @@ def _parse_header(self):
"label",
"dimension",
"sample_rate",
"sample_frequency",
"physical_min",
"physical_max",
"digital_min",
Expand Down

0 comments on commit 1ef2a98

Please sign in to comment.