Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions phylib/io/traces.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,9 @@ def _memmap_flat(path, dtype=None, n_channels=None, offset=0, mode='r+'):
assert n_channels > 0
fsize = path.stat().st_size
item_size = np.dtype(dtype).itemsize
assert (fsize - offset) % (item_size * n_channels) == 0,\
'Inconsistent number of channels between the params file and the binary dat file'
if (fsize - offset) % (item_size * n_channels) != 0:
logger.warning('Inconsistent number of channels between the '
'params file and the binary dat file')
n_samples = (fsize - offset) // (item_size * n_channels)
shape = (n_samples, n_channels)
return np.memmap(path, dtype=dtype, offset=offset, shape=shape, mode=mode)
Expand Down