[Bug]: No ImportError when calling from neuroconv.utils import NWBMetaDataEncoder
#1141
Open
2 tasks done
Labels
What happened?
In #1050, some classes such as
NWBMetaDataEncoder
were renamed_NWBMetaDataEncoder
. This breaks code in NWB GUIDE that callsfrom neuroconv.utils import NWBMetaDataEncoder
. Because of the override to__getitem__
inneuroconv/utils/__init__.py
(#1033), the linefrom neuroconv.utils import NWBMetaDataEncoder
now fails silently. It should return something likeImportError: cannot import name 'AA' from 'collections' (/Users/rly/mambaforge/envs/test/lib/python3.12/collections/__init__.py)
butNWBMetaDataEncoder
is set to None without an error. This was confusing to debug.I suggest changing
__getitem__
to end with something like:ref: https://peps.python.org/pep-0562/
I am also in favor of making
NWBMetaDataEncoder
public again since it is used by NWB GUIDE. But if not, I can just copy the code over to NeuroConv...Steps to Reproduce
Traceback
No response
Operating System
macOS
Python Executable
Python
Python Version
3.12
Package Versions
neuroconv==0.6.5
Code of Conduct
The text was updated successfully, but these errors were encountered: