builtins.profile = lambda f: f #warning: this needs to be before importing h5py os.environ["MV2_ENABLE_AFFINITY"] = "0" frameworkDir = os.path.dirname(os.path.abspath(__file__)) # library handler is in scripts sys.path.append(os.path.join(frameworkDir, '..', "scripts")) import library_handler as LH sys.path.pop() #remove scripts path for cleanliness from utils import utils import utils.TreeStructure as TS utils.find_crow(frameworkDir) utils.add_path(os.path.join(frameworkDir, 'contrib', 'AMSC')) utils.add_path(os.path.join(frameworkDir, 'contrib')) ##TODO REMOVE PP3 WHEN RAY IS AVAILABLE FOR WINDOWS utils.add_path_recursively(os.path.join(frameworkDir, 'contrib', 'pp')) #Internal Modules from Simulation import Simulation from Application import __QtAvailable from Interaction import Interaction #Internal Modules #------------------------------------------------------------- Driver def printStatement(): """ Method to print the BEA header
#External Modules------------------------------------------------------------------------------------ import os from glob import glob import inspect #External Modules End-------------------------------------------------------------------------------- #Internal Modules------------------------------------------------------------------------------------ from utils import utils #Internal Modules End-------------------------------------------------------------------------------- __moduleInterfaceList = [] startDir = os.path.join(os.path.dirname(__file__), 'CodeInterfaces') for dirr, _, _ in os.walk(startDir): __moduleInterfaceList.extend(glob(os.path.join(dirr, "*.py"))) utils.add_path(dirr) __moduleImportedList = [] """ Interface Dictionary (factory) (private) """ __base = 'Code' __interFaceDict = {} for moduleIndex in range(len(__moduleInterfaceList)): if 'class' in open(__moduleInterfaceList[moduleIndex]).read(): __moduleImportedList.append( utils.importFromPath(__moduleInterfaceList[moduleIndex], False)) for key, modClass in inspect.getmembers(__moduleImportedList[-1], inspect.isclass): # in this way we can get all the class methods classMethods = [ method for method in dir(modClass)
""" import sys import os import inspect frameworkFolder = os.path.realpath( os.path.join(os.path.dirname(inspect.getfile(inspect.currentframe())), "..", "..")) if frameworkFolder not in sys.path: sys.path.insert(0, frameworkFolder) from utils.utils import add_path_recursively, add_path, find_crow find_crow(frameworkFolder) #add_path_recursively(os.path.join(frameworkFolder,'contrib')) add_path_recursively(os.path.join(frameworkFolder, 'contrib', 'pp')) #add_path_recursively(os.path.join(frameworkFolder,'contrib','StringIO')) add_path(os.path.join(frameworkFolder, 'contrib', 'AMSC')) add_path(os.path.join(frameworkFolder, 'contrib')) #filepath = os.path.dirname(os.path.abspath(inspect.getsourcefile(lambda _: None))) #sys.path.append(os.path.abspath(os.path.join(filepath,'..'+os.path.sep+'..'+os.path.sep ,'utils'))) #frameworkDir = os.path.abspath(os.path.join(filepath,'..'+os.path.sep+'..'+os.path.sep)) #from utils import add_path_recursively #add_path_recursively(frameworkDir) import StringIO #import dill as pickle #import cPickle as pickle import pickle import cloudpickle import pptransport copyright = "Copyright (c) 2005-2012 Vitalii Vanovschi. All rights reserved"