Ejemplo n.º 1
0
 def __init__(self, verbosity):
     self.logger = wrapLogger(loggerName = __name__ + 'logger', streamVerb = verbosity.upper(), logFile = __name__ + '.log')
Ejemplo n.º 2
0
from analyzeOverviewTable import anaOne4eachPair, anaOne4eachCtry, anaOne4all, nlcOne4eachCtry, nlcOne4eachPair, nlcOne4all, plotPopOne4eachCtry
import combineOverviews
from difEvoKenPrice import *

# verbosity levels for logbook
##CRITICAL = 6
##ERROR = 5
##WARNING = 4
##NOTICE = 3
##INFO = 2
##DEBUG = 1
##NOTSET = 0

# Set up logger
#self.streamVerb = solverVerb
logger = wrapLogger(loggerName = 'gParaSearchLogger', streamVerb = 'INFO', logFile = os.path.join(os.getcwd(), 'gParaSearch.log'))


class gParaSearchDriver(SequentialTaskCollection):

    def __init__(self, pathToExecutable, pathToStageDir, architecture, baseDir, xVars, initialPop,
                 nPopulation, domain, solverVerb, problemType, pathEmpirical,
                 itermax, xConvCrit, yConvCrit,
                 makePlots, optStrategy, fWeight, fCritical, ctryList, analyzeResults, nlc, plot3dTable, combOverviews,
                 output_dir = '/tmp', **extra_args):

        '''
          pathToExecutable: Path to main executable. 
          pathToStageDir  : Path to directory in which the action takes place. Usually set to os.getcwd(). 
          architecture    : Set the architecture used. 
          baseDir         : Directory in which the input files are assembled. This directory is sent as input to the cluseter. 
Ejemplo n.º 3
0
import gc3libs.application.apppot
import re, os
import numpy as np
from supportGc3 import lower, flatten, str2tuple, getIndex, extractVal, str2vals
from supportGc3 import format_newVal, update_parameter_in_file, safe_eval, str2mat, mat2str, getParameter
from paraLoop import paraLoop

from gc3libs import Application, Run
from gc3libs.quantity import Memory, kB, MB, GB, Duration, hours, minutes, seconds
import shutil

import logbook, sys
from supportGc3 import wrapLogger

logger = wrapLogger(loggerName=__name__ + 'logger',
                    streamVerb='DEBUG',
                    logFile=__name__ + '.log')


class idRiskApplication(Application):
    application_name = 'idrisk'

    _invalid_chars = re.compile(r'[^_a-zA-Z0-9]+', re.X)

    def __init__(self, executable, arguments, inputs, outputs, output_dir,
                 **extra_args):
        Application.__init__(self,
                             executable,
                             arguments,
                             inputs,
                             outputs,
Ejemplo n.º 4
0
import gc3libs.debug
import gc3libs.application.apppot
import re, os
import numpy as np
from supportGc3 import lower, flatten, str2tuple, getIndex, extractVal, str2vals
from supportGc3 import format_newVal, update_parameter_in_file, safe_eval, str2mat, mat2str, getParameter
from paraLoop import paraLoop

from gc3libs import Application, Run
import shutil

import logbook, sys
from supportGc3 import wrapLogger

logger = wrapLogger(loggerName = __name__ + 'logger', streamVerb = 'DEBUG', logFile = __name__ + '.log')

class idRiskApplication(Application):

    application_name = 'idrisk'

    _invalid_chars = re.compile(r'[^_a-zA-Z0-9]+', re.X)

    def __init__(self, executable, arguments, inputs, outputs, output_dir, **extra_args):
        Application.__init__(self, executable, arguments, inputs, outputs, output_dir, **extra_args)

    def fetch_output_error(self, ex):

        if self.execution.state == Run.State.TERMINATING:
        # do notify task/main application that we're done
        # ignore error, let's continue
Ejemplo n.º 5
0
 def __init__(self, verbosity):
     self.logger = wrapLogger(
         loggerName=__name__ + "logger", streamVerb=verbosity.upper(), logFile=__name__ + ".log"
     )
Ejemplo n.º 6
0
from analyzeOverviewTable import anaOne4eachPair, anaOne4eachCtry, anaOne4all, nlcOne4eachCtry, nlcOne4eachPair, nlcOne4all, plotPopOne4eachCtry
import combineOverviews
from difEvoKenPrice import *

# verbosity levels for logbook
##CRITICAL = 6
##ERROR = 5
##WARNING = 4
##NOTICE = 3
##INFO = 2
##DEBUG = 1
##NOTSET = 0

# Set up logger
#self.streamVerb = solverVerb
logger = wrapLogger(loggerName = 'gParaSearchLogger', streamVerb = 'INFO', logFile = os.path.join(os.getcwd(), 'gParaSearch.log'))


class gParaSearchDriver(SequentialTaskCollection):

    def __init__(self, pathToExecutable, pathToStageDir, architecture, baseDir, xVars, initialPop,
                 nPopulation, domain, solverVerb, problemType, pathEmpirical,
                 itermax, xConvCrit, yConvCrit,
                 makePlots, optStrategy, fWeight, fCritical, ctryList, analyzeResults, nlc, plot3dTable, combOverviews,
                 output_dir = '/tmp', **extra_args):

        '''
          pathToExecutable: Path to main executable. 
          pathToStageDir  : Path to directory in which the action takes place. Usually set to os.getcwd(). 
          architecture    : Set the architecture used. 
          baseDir         : Directory in which the input files are assembled. This directory is sent as input to the cluseter. 
Ejemplo n.º 7
0
# import personal libraries
path2SrcPy = os.path.join(os.path.dirname(__file__), "../src")
if not sys.path.count(path2SrcPy):
    sys.path.append(path2SrcPy)
from plotSimulation import plotSimulation
from plotAggregate import makeAggregatePlot
from pymods.classes.tableDict import tableDict
from plotOwnership import plotOwnerProfiles

path2Pymods = os.path.join(os.path.dirname(__file__), "../")
if not sys.path.count(path2Pymods):
    sys.path.append(path2Pymods)
from pymods.support.support import getParameter

logger = wrapLogger(loggerName=__name__ + "logger", streamVerb="DEBUG", logFile=__name__ + ".log")


class housingApplication(Application):

    application_name = "housing"

    _invalid_chars = re.compile(r"[^_a-zA-Z0-9]+", re.X)

    def __init__(self, executable, arguments, inputs, outputs, output_dir, **extra_args):
        #        extra_args.setdefault('requested_walltime', 2*hours)
        Application.__init__(self, executable, arguments, inputs, outputs, output_dir, **extra_args)

    def fetch_output_error(self, ex):

        if self.execution.state == Run.State.TERMINATING: