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

Fail gracefully if stimulus trace does not exist in _nwb_reader_BBP #88

Open
lvsltz opened this issue Sep 2, 2022 · 4 comments
Open
Assignees

Comments

@lvsltz
Copy link
Contributor

lvsltz commented Sep 2, 2022

_nwb_reader_BBP on BPE2 branch assumes current trace exists, but this is not always the case and fails with

warning: tag '2.0.0' is really '2.0' here
Traceback (most recent call last):
   File "/home/sol/Documents/git/BluePyEfe/bluepyefe/cell.py", line 108, in read_recordings
    for reader_data in self.reader(config_data, recording_reader):
  File "/home/sol/Documents/git/BluePyEfe/bluepyefe/cell.py", line 67, in reader
    return nwb_reader(config_data)
  File "/home/sol/Documents/git/BluePyEfe/bluepyefe/reader.py", line 331, in nwb_reader
    return _nwb_reader_BBP(content, target_protocols, in_data.get("repetition", None))
  File "/home/sol/Documents/git/BluePyEfe/bluepyefe/reader.py", line 297, in _nwb_reader_BBP
    current=content["stimulus"]["presentation"][key_current]["data"],
  File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
  File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
  File "/home/sol/miniconda3/envs/etype/lib/python3.10/site-packages/h5py/_hl/group.py", line 328, in __getitem__
    oid = h5o.open(self.id, self._e(name), lapl=self._lapl)
  File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
  File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
  File "h5py/h5o.pyx", line 190, in h5py.h5o.open
KeyError: "Unable to open object (object 'ics__IDRest__038' doesn't exist)"

A graceful exit should be provided instead.

@DrTaDa
Copy link
Contributor

DrTaDa commented Sep 2, 2022

Thank you for the report, I am on it.

@DrTaDa
Copy link
Contributor

DrTaDa commented Sep 2, 2022

@lvsltz Would you prefer if to crash or to skip this recording ?

@DrTaDa DrTaDa self-assigned this Sep 2, 2022
@lvsltz
Copy link
Contributor Author

lvsltz commented Sep 2, 2022

I am not sure. It should behave in line with the other BPE scenarios when ton, toff and other important params are missing.

@DrTaDa DrTaDa mentioned this issue Sep 2, 2022
@DrTaDa
Copy link
Contributor

DrTaDa commented Sep 2, 2022

Could you try #89 ?

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