Open yarikoptic opened 4 years ago
@yarikoptic Thanks for the bug report. I can reproduce the bug with PyNWB 1.0.3 and HDMF 1.1.2. Could you try this with PyNWB 1.1.0 installed or the dev branch of PyNWB installed? Your MWE runs fine using the dev branch of PyNWB on my machine.
eh, apparently the file url was butchered. I have adjusted it -- should be downloadable now.
With 1.1.1 -- the same.
@yarikoptic In your MWE, please move your print(nwbfile)
statement to be within the with
file context manager. The file needs to be open because the contents are read lazily.
Doing that made your code work for me with PyNWB 1.1.1.
@rly THANKS! confirming -- works for me too!
Having said that, repr
shouldn't fail either within or outside of the context handler.
Since repr
here is not really a "string representation of an object" here anyways, I would recommend to fix this issue but making repr
not crash even if file is no longer open (outside of the context manager) by adding N/A - closed file
to those fields value for which is no longer available. It would make it (more) obvious of naive new users like me what I have done "wrong".
But getting back to keywords
specifically - since it is not that heavy of an object, it might be worth making it loaded non-lazily.
Description
helper script:
Steps to Reproduce
I believe that file was generated using pynwb. All scripts are within aforementioned repo. Singularity image with the used pynwb etc is available via git-annex/datalad as well there.
Upon playing with minimalistic code, it was possible to reproduce it with a minimalistic example:
Having keywords there is a trigger (comment out and see it pass)
Environment
Checklist