41 from pkg_resources
import get_distribution
43 __version__ = get_distribution(
'modena').version
45 MODENA_INSTALL_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
46 MODENA_WORKING_DIR = os.path.realpath(os.getcwd())
48 from Strategy
import BackwardMappingScriptTask, ModenaFireTask
49 from SurrogateModel
import CFunction, IndexSet, \
50 SurrogateModel, ForwardMappingModel, BackwardMappingModel, \
51 ModenaFireTask, MODENA_PARSED_URI
58 def find_module(target, startsearch=MODENA_WORKING_DIR):
60 pth = os.path.abspath(startsearch)
61 while target
not in os.listdir(pth):
62 pth = os.path.abspath(os.path.join(pth,
'..'))
63 if os.path.ismount(pth):
68 sys.path.insert(0, os.path.join(pth,target))
70 print "Could not find directory: %s" %(target)
73 from os.path
import dirname
79 fp, pathname, description = imp.find_module(
81 [ find_module(
"modena", os.path.join(MODENA_INSTALL_DIR,
"..",
"..")) ]
88 _mod = imp.load_module(
'libmodena', fp, pathname, description)
94 find_module(
"MoDeNaModels")
95 libmodena = import_helper()