Skip to content

Commit 171cd7d

Browse files
authored
Merge pull request #38 from cortex-lab/traces_warning
Traces warning
2 parents efbf8e6 + 53fe162 commit 171cd7d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

phylib/io/traces.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,9 @@ def _memmap_flat(path, dtype=None, n_channels=None, offset=0, mode='r+'):
158158
assert n_channels > 0
159159
fsize = path.stat().st_size
160160
item_size = np.dtype(dtype).itemsize
161-
assert (fsize - offset) % (item_size * n_channels) == 0,\
162-
'Inconsistent number of channels between the params file and the binary dat file'
161+
if (fsize - offset) % (item_size * n_channels) != 0:
162+
logger.warning('Inconsistent number of channels between the '
163+
'params file and the binary dat file')
163164
n_samples = (fsize - offset) // (item_size * n_channels)
164165
shape = (n_samples, n_channels)
165166
return np.memmap(path, dtype=dtype, offset=offset, shape=shape, mode=mode)

0 commit comments

Comments
 (0)