Skip to content

Commit

Permalink
fix(read_edf): ignore event_types not found in discrete (#7)
Browse files Browse the repository at this point in the history
LGTM, thanks @ttngu207 !
  • Loading branch information
ttngu207 authored Jul 24, 2024
1 parent f48b933 commit 710b655
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ share/python-wheels/
.installed.cfg
*.egg
MANIFEST
.idea/

# PyInstaller
# Usually these files are written by a python script from a template
Expand Down
2 changes: 2 additions & 0 deletions eyelinkio/edf/read_edf.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@ def _read_raw_edf(fname):
assert np.array_equal(orig_times, np.sort(orig_times))
times = np.arange(len(orig_times), dtype=np.float64) / info["sfreq"]
for key in event_types:
if key not in discrete:
continue
for sub_key in ("stime", "etime"):
if sub_key in discrete[key].dtype.names:
_adjust_time(discrete[key][sub_key], orig_times, times)
Expand Down

0 comments on commit 710b655

Please sign in to comment.