h2integrate.core.supported_models#
- class h2integrate.core.supported_models._ModelRegistry#
A dict subclass that imports model classes on first access.
Stores entries as
"ClassName": "relative.module.path:ClassName"strings, where the module path is relative to theh2integratepackage (theh2integrate.prefix is prepended automatically). On first__getitem__,get, or iteration over values, the class is imported, cached, and returned. This avoids importing every model module (and their heavy transitive dependencies) at package-load time, reducing computational cost of imports and running tests.- _PKG_PREFIX = 'h2integrate.'#
- _resolve(key)#
Import and cache the class for
key, returning the resolved class.
- get(key, default=None)#
Return the model class for key, or default if not present.
- copy()#
Return a new _ModelRegistry with the same (still-deferred) entries.