Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

index error when .nev file getdata() #31

Open
JunHao-Huang opened this issue Nov 13, 2023 · 2 comments
Open

index error when .nev file getdata() #31

JunHao-Huang opened this issue Nov 13, 2023 · 2 comments

Comments

@JunHao-Huang
Copy link

Hi, thanks for your code. It's great but I met a problem below and do not know what happened.
I am using brpylib ver 2.0.3. Error below occationally happens for some .nev files, not all.

Thanks for your time.

*******\20231110\TR141\OP02\datafile.nev opened
Traceback (most recent call last):

File ~.conda\envs\ephys\lib\site-packages\spyder_kernels\py3compat.py:356 in compat_exec
exec(code, globals, locals)

File h:\filez\hjh\hjhcode\hjhprivate.py:14
b = a.getdata()

File ~.conda\envs\ephys\lib\brpylib.py:737 in getdata
trueCommentsidx = np.asarray(commentPackets)[trueComments]

IndexError: arrays used as indices must be of integer (or boolean) type

@cboulay
Copy link
Contributor

cboulay commented Nov 13, 2023

Can you please share a .nev file that has this problem?

@JunHao-Huang
Copy link
Author

JunHao-Huang commented Nov 22, 2023

Hi, here's a sample file attached. Would you please have a look into it? With exactly the same recording config, some but not all .nev files go wrong, like below.
Oh plus, those files can be open with NPMK.
datafile(1).zip

import brpylib
from pathlib imort Path
fpath = Path(r'I:datafile(1).nev')
a = brpylib.NevFile(str(fpath))
b = a.getdata('Tracking')


runcell('TESTing nev xy', 'I:/HJHcode/HJHprivate.py')

I:datafile(1).nev opened

*** WARNING: Electrode IDs must be 'all', a single integer, or a list of integers.
Setting elec_ids to 'all'
Traceback (most recent call last):

File ~.conda\envs\ephys\lib\site-packages\spyder_kernels\py3compat.py:356 in compat_exec
exec(code, globals, locals)

File i:\hjhcode\hjhprivate.py:23
b = a.getdata()

File ~.conda\envs\ephys\lib\brpylib.py:737 in getdata
trueCommentsidx = np.asarray(commentPackets)[trueComments]

IndexError: arrays used as indices must be of integer (or boolean) type

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants