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

Cannot save bad channels #89

Closed
cbin-cnl opened this issue May 19, 2020 · 14 comments · Fixed by #92
Closed

Cannot save bad channels #89

cbin-cnl opened this issue May 19, 2020 · 14 comments · Fixed by #92

Comments

@cbin-cnl
Copy link

Originally had the issue that I couldn't open a nwb file without a "bad" channel column, but it looks like that has been addressed in #85 , so I installed the newest version of ecogVIS using the "setup.py" file. Is there a way of saving bad channels without having an existing bad channels column?

@luiztauffer
Copy link
Member

hi @cbin-cnl , did the problem of opening a file get solved on your end?
Do you get any specific error when trying to save a new file? If yes, can you copy the error track (printed in the terminal)?

@cbin-cnl
Copy link
Author

Hi Luiz,

Yes I can open the file and add channels, but the gui crashes once I try to save. The error message is below:
Traceback (most recent call last): File "/home/cbin-user/tdt2nwb/ecogvis/lib/python3.6/site-packages/ecogvis-1.0.1-py3.6.egg/ecogvis/ecogvis.py", line 530, in save_badchannel self.model.BadChannelSave() File "/home/cbin-user/tdt2nwb/ecogvis/lib/python3.6/site-packages/ecogvis-1.0.1-py3.6.egg/ecogvis/functions/subFunctions.py", line 748, in BadChannelSave self.nwb.electrodes['bad'].data[indices] = aux File "/home/cbin-user/tdt2nwb/ecogvis/lib/python3.6/site-packages/hdmf/common/table.py", line 504, in __getitem__ raise KeyError(key) KeyError: 'bad'

@luiztauffer
Copy link
Member

thanks for the report! I'll check it

@luiztauffer
Copy link
Member

@cbin-cnl it seems like you're not using the most updated code, could you please try installing the current repo version of EcogVIS in your working environment?

$ pip uninstall ecogvis
$ git clone https://github.com/catalystneuro/ecogVIS.git
$ cd ecogVIS
$ pip install .

I couldn't reproduce the error locally, this is probably because of some changes in ecogvis that were not published to pypi yet. If it's not urgent, you can also wait a couple of days max and I'll be releasing a new version, so you can upgrade through pip.

@cbin-cnl
Copy link
Author

Hi Luiz, thanks for the quick response.

Unfortunately updating the code did not work, I still get the following error:

File "/home/cbin-user/tdt2nwb/ecogvis/lib/python3.6/site-packages/ecogvis/ecogvis.py", line 530, in save_badchannel  
self.model.BadChannelSave()   
File "/home/cbin-user/tdt2nwb/ecogvis/lib/python3.6/site-packages/ecogvis/functions/subFunctions.py", line 744, in BadChannelSave
self.nwb.electrodes['bad'].data[:] = aux
File "/home/cbin-user/tdt2nwb/ecogvis/lib/python3.6/site-packages/hdmf/common/table.py", line 504, in __getitem__
    raise KeyError(key)
KeyError: 'bad'

To clarify, I can open the file fine, but cannot save the channels unless the NWB file already has a "bad" electrodes column.

Thanks again

@luiztauffer
Copy link
Member

of course, I can see it now
I'll put a fix for this in the current PR and let you know once it's merged!

@cbin-cnl
Copy link
Author

Great thanks so much!

@luiztauffer
Copy link
Member

@cbin-cnl it took a bit, sorry, the merge is in place.
could you please confirm this solved the problem on your end?

@cbin-cnl
Copy link
Author

cbin-cnl commented Jun 5, 2020

Hi Luiz,

Unfortunately it still looks like there is a problem with adding a column to an existing Electrode table. I'm getting the following error:

    self.model.BadChannelSave()
  File "/home/cbin-user/tdt2nwb/ecogvis/lib/python3.6/site-packages/ecogvis-1.1.0-py3.6.egg/ecogvis/functions/subFunctions.py", line 765, in BadChannelSave
    data=aux,
  File "/home/cbin-user/tdt2nwb/ecogvis/lib/python3.6/site-packages/hdmf/utils.py", line 483, in func_call
    return func(args[0], **parsed['args'])
  File "/home/cbin-user/tdt2nwb/ecogvis/lib/python3.6/site-packages/pynwb/file.py", line 494, in add_electrode_column
    call_docval_func(self.electrodes.add_column, kwargs)
  File "/home/cbin-user/tdt2nwb/ecogvis/lib/python3.6/site-packages/hdmf/utils.py", line 364, in call_docval_func
    return func(*fargs, **fkwargs)
  File "/home/cbin-user/tdt2nwb/ecogvis/lib/python3.6/site-packages/hdmf/utils.py", line 483, in func_call
    return func(args[0], **parsed['args'])
  File "/home/cbin-user/tdt2nwb/ecogvis/lib/python3.6/site-packages/hdmf/common/table.py", line 462, in add_column
    raise ValueError("column must have the same number of rows as 'id'")
ValueError: column must have the same number of rows as 'id'
Aborted (core dumped)

However, I think I can just ensure I have a "bad" channels column in my electrode table. Thank you.

@luiztauffer luiztauffer reopened this Jun 6, 2020
@luiztauffer
Copy link
Member

I'll get this fix, thanks for reporting it

@luiztauffer
Copy link
Member

@cbin-cnl I managed to reproduce your error now
is it the case that your electricalseries is mapped to a subset of electrodes smaller than the total number of electrodes? Just to make sure we found the same problem
I'll fix it

@cbin-cnl
Copy link
Author

Thanks Luiz, sorry just looking at this now. Thanks for making the change. Just wanted to check, the "save bad channels" button has been removed? Is the intention to just save a new NWB file with the bad channel annotation?

@luiztauffer
Copy link
Member

@cbin-cnl that's correct. Do you have the specific need of saving it in the same file?

@cbin-cnl
Copy link
Author

Hi Luiz, no, that should be fine, just wanted to make sure that was the intention.

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

Successfully merging a pull request may close this issue.

2 participants