-
Notifications
You must be signed in to change notification settings - Fork 86
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
Define a dedicated Exception class to report missing neural datatypes #1144
Comments
…ing exception with AIBS_ecephys listed missing Ultimate solution should IMHO be implemented within PyNWB itself. See NeurodataWithoutBorders/pynwb#1143 feature request. Also related - dedicated exception (NeurodataWithoutBorders/pynwb#1144) With this change we should be able to deal with neuropixels files from Allen
@yarikoptic Do you mean something like this? class HDMFMissingNamespaceException(Exception):
def __init__(self, namespace):
self.namespace = namespace
super().init("'{}' not a namespace".format(namespaace)) |
I would suggest transferring this issue to HDMF and potentially merging it with hdmf-dev/hdmf#340 At that point we should also add support to add additional details to the message to allow us to address #1143 |
Yes, I agree, but I don't think I have transfer permissions to that repo |
I will start a new issue in hdmf and link back to this. |
Scratch that. We can just add to hdmf-dev/hdmf#340 |
ATM:
so it is a very generic
KeyError
, so until #1143 is implemented, for programmatic handling of such situations it requires regex matching of the exception message to decide that it is indeed the exception reporting missing type, and extracting the name. Ideally it should be a dedicated exception with ease access to the name of missing type (e.g. via attribute of that exception).The text was updated successfully, but these errors were encountered: