Пример #1
0
from __future__ import division, print_function, unicode_literals, absolute_import
import warnings
warnings.simplefilter('default',DeprecationWarning)

import xml.etree.ElementTree as ET
import sys, os
import pickle as pk
import numpy as np
import xarray as xr

# find location of crow, message handler
frameworkDir = os.path.abspath(os.path.join(*([os.path.dirname(__file__)]+[os.pardir]*4+['framework'])))
sys.path.append(frameworkDir)

from utils.utils import find_crow
find_crow(frameworkDir)
import MessageHandler

# find location of data objects
sys.path.append(os.path.join(frameworkDir,'DataObjects'))

import HistorySet

mh = MessageHandler.MessageHandler()
mh.initialize({'verbosity':'debug', 'callerLength':10, 'tagLength':10})

print('Module undergoing testing:')
print(HistorySet )
print('')

def createElement(tag,attrib=None,text=None):
Пример #2
0
#For future compatibility with Python 3
from __future__ import division, print_function, unicode_literals, absolute_import
import warnings

warnings.simplefilter('default', DeprecationWarning)

import xml.etree.ElementTree as ET
import sys, os
import pickle as pk
import numpy as np

frameworkDir = os.path.dirname(os.path.abspath(sys.argv[0]))

from utils.utils import find_crow

find_crow(os.path.dirname(os.path.abspath(sys.argv[0])))

import Distributions
import MessageHandler

mh = MessageHandler.MessageHandler()
mh.initialize({'verbosity': 'debug'})

print(Distributions)


def createElement(tag, attrib={}, text={}):
    """
    Method to create a dummy xml element readable by the distribution classes
    @ In, tag, string, the node tag
    @ In, attrib, dict, optional, the attribute of the xml node
Пример #3
0
    # profiler not preset, so pass through
    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():
    """
Пример #4
0
Parallel Python Software, PP Worker

http://www.parallelpython.com - updates, documentation, examples and support
forums
"""
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