self._ns_specs has not been defined for a loaded model and therefore it isn't possible to check types.
Normally the last thing that is done when initializing a model is to infer types using self.infer_types(). But when loading a model that should be linked to cpp, the types should be infered before linking to cpp.
One way to make it possible to load models linked to cpp is to infer the types just before linking. I suggest changing this line
https://github.com/NumEconCopenhagen/EconModel/blob/8cc7c8b4858a32079066faed2ef608dc27fc4048/EconModel/EconModel.py#L327C11-L327C11
from:
to:
if hasattr(self,'_ns_specs'):
self.check_types()
else:
self.infer_types()
self._ns_specs has not been defined for a loaded model and therefore it isn't possible to check types.
Normally the last thing that is done when initializing a model is to infer types using self.infer_types(). But when loading a model that should be linked to cpp, the types should be infered before linking to cpp.
One way to make it possible to load models linked to cpp is to infer the types just before linking. I suggest changing this line
https://github.com/NumEconCopenhagen/EconModel/blob/8cc7c8b4858a32079066faed2ef608dc27fc4048/EconModel/EconModel.py#L327C11-L327C11
from:
to: