You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the function TypeMap.get_container_cls function in hdmf.build.manager the internal helper function TypeMap.__get_container_cls call initially returns None for classes from hdmf.common. When importing a container class from hdmf.common this results in a sequence of calls where first Container classes are autogenerated and the later on the correct custom classes from hdmf.common are detected. When I add a print(cls, namespace, data_type) in TypeMap.get_container_cls and import DynamicTable I get the following:
I.e., there is a first round where TypeMap.__get_container_cls returns None which in turn triggers the automatic class generation and then in a second round the correct classes are found.
While the end-behavior for the user is correct but having classes autogenerated for all types seems like an unnecessary that could slow down import of HDMF. I found this behavior as part of PR #551 to integrate AlignedDynamicTable , because automatic class generation currently fails for this type (see Issue #554) and the behavior described in this issues triggers that behavior.
Steps to Reproduce
from hdmf.common.table import DynamicTable
Environment
Python Executable: Installed HDMF from latest dev
Python Version: Python 3.8
Operating System: macOS
HDMF Version: dev
Checklist
Have you ensured the bug was not already reported ?
Have you included a brief and descriptive title?
Have you included a clear description of the problem you are trying to solve?
Have you included a minimal code snippet that reproduces the issue you are encountering?
Description
In the function
TypeMap.get_container_cls
function inhdmf.build.manager
the internal helper functionTypeMap.__get_container_cls
call initially returnsNone
for classes fromhdmf.common
. When importing a container class fromhdmf.common
this results in a sequence of calls where first Container classes are autogenerated and the later on the correct custom classes fromhdmf.common
are detected. When I add aprint(cls, namespace, data_type)
inTypeMap.get_container_cls
and importDynamicTable
I get the following:I.e., there is a first round where
TypeMap.__get_container_cls
returnsNone
which in turn triggers the automatic class generation and then in a second round the correct classes are found.While the end-behavior for the user is correct but having classes autogenerated for all types seems like an unnecessary that could slow down import of HDMF. I found this behavior as part of PR #551 to integrate
AlignedDynamicTable
, because automatic class generation currently fails for this type (see Issue #554) and the behavior described in this issues triggers that behavior.Steps to Reproduce
from hdmf.common.table import DynamicTable
Environment
Checklist
The text was updated successfully, but these errors were encountered: