Skip to content

Commit

Permalink
bug fix: import expand_dims
Browse files Browse the repository at this point in the history
  • Loading branch information
szorowi1 committed Aug 24, 2019
1 parent c7d1e56 commit 8be5f90
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion nivlink/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Niv Lab software for preprocessing eyelink eyetracking data."""

__version__ = '0.2.2'
__version__ = '0.2.3'

from .raw import (Raw)
from .epochs import (Epochs)
Expand Down
7 changes: 3 additions & 4 deletions nivlink/edf/edfread.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os
from numpy import array, float64, unicode_, searchsorted
from numpy import array, expand_dims, float64, unicode_, searchsorted
from datetime import datetime
from ctypes import byref, c_int, create_string_buffer, string_at
from .edfapi import (edf_open_file, edf_close_file, edf_get_next_data,
Expand Down Expand Up @@ -37,7 +37,6 @@ def edf_parse_preamble(EDFFILE):

return info

#TODO: allow binocular recording
def edf_parse_sample(EDFFILE):
"""Return sample info: time, eye fixation, pupil size (left/right)."""
sample = edf_get_sample_data(EDFFILE).contents
Expand Down Expand Up @@ -141,10 +140,10 @@ def edf_read(fname):
## Extract data.
samples = array(samples, dtype=float64)
if info['eye'] == 'LEFT':
data = np.expand_dims(samples[:,1::2], 1)
data = expand_dims(samples[:,1::2], 1)
eye_names = ('LEFT')
elif info['eye'] == 'RIGHT':
data = np.expand_dims(samples[:,2::2], 1)
data = expand_dims(samples[:,2::2], 1)
eye_names = ('RIGHT')
else:
data = samples[:,1:].reshape(-1, 2, 3, order='F')
Expand Down

0 comments on commit 8be5f90

Please sign in to comment.