1- from .logger import *
1+ """REINVENT4
2+
3+ Namespace setup and backward compatibility
4+ """
5+
6+ import sys
7+
8+ from .logger import *
9+ from reinvent import models
10+ from reinvent .models .libinvent .models import vocabulary # not sure why needed
11+
12+
13+ # support compatibility with older model files
14+ PATH_MAP = (
15+ # R3
16+ ("reinvent_models.reinvent_core" , models .reinvent ),
17+ ("reinvent_models.reinvent_core.models" , models .reinvent .models ),
18+ ("reinvent_models.reinvent_core.models.vocabulary" , models .reinvent .models .vocabulary ),
19+ ("reinvent_models.lib_invent" , models .libinvent ),
20+ ("reinvent_models.lib_invent.models" , models .libinvent .models ),
21+ ("reinvent_models.lib_invent.models.vocabulary" , models .libinvent .models .vocabulary ),
22+ ("reinvent_models.link_invent" , models .linkinvent ),
23+ ("reinvent_models.link_invent.model_vocabulary" , models .linkinvent .model_vocabulary ),
24+ (
25+ "reinvent_models.link_invent.model_vocabulary.vocabulary" ,
26+ models .linkinvent .model_vocabulary .vocabulary ,
27+ ),
28+ (
29+ "reinvent_models.link_invent.model_vocabulary.model_vocabulary" ,
30+ models .linkinvent .model_vocabulary .model_vocabulary ,
31+ ),
32+ (
33+ "reinvent_models.link_invent.model_vocabulary.paired_model_vocabulary" ,
34+ models .linkinvent .model_vocabulary .paired_model_vocabulary ,
35+ ),
36+ )
37+
38+ for module , path in PATH_MAP :
39+ if path is None :
40+ sys .modules [module ] = sys .modules [__name__ ]
41+ else :
42+ sys .modules [module ] = path
0 commit comments