예제 #1
0
파일: run_tests.py 프로젝트: kidaak/gaia
def runTests(project_file):
    # open the yaml file describing the analysis to perform
    try:
        project_file = os.path.abspath(project_file)
    except:
        print "ERROR: You need to specify a yaml project file..."
        print "Exiting..."
        sys.exit(1)

    logging.getLogger("gaia2.classification").setLevel(debugLevel)
    if debugLevel == logging.DEBUG:
        cvar.verbose = True
    else:
        cvar.verbose = False

    # move to the project file directory so all paths can be relative
    olddir = os.getcwd()
    try:
        os.chdir(os.path.split(project_file)[0])
    except OSError:
        pass

    test = ClassificationTaskManager(project_file)
    test.run()

    try:
        os.chdir(olddir)
    except OSError:
        pass
예제 #2
0
def runTests():
    parser = OptionParser(usage = '%prog [options] project_file')

    options, args = parser.parse_args()

    try:
        project_file = args[0]
    except:
        parser.print_help()
        sys.exit(1)

    # open the yaml file describing the analysis to perform
    try:
        project_file = os.path.abspath(sys.argv[1])
    except:
        print 'ERROR: You need to specify a yaml project file...'
        print 'Exiting...'
        sys.exit(1)

    logging.getLogger('gaia2.classification').setLevel(debugLevel)
    if debugLevel == logging.DEBUG:
        cvar.verbose = True
    else:
        cvar.verbose = False

    # move to the project file directory so all paths can be relative
    try:
        os.chdir(os.path.split(project_file)[0])
    except OSError:
        pass

    test = ClassificationTaskManager(project_file)
    test.run()
예제 #3
0
파일: run_tests.py 프로젝트: sildeag/gaia
def runTests(project_file):
    # open the yaml file describing the analysis to perform
    try:
        project_file = os.path.abspath(project_file)
    except:
        print('ERROR: You need to specify a yaml project file...')
        print('Exiting...')
        sys.exit(1)

    logging.getLogger('gaia2.classification').setLevel(debugLevel)
    if debugLevel == logging.DEBUG:
        cvar.verbose = True
    else:
        cvar.verbose = False

    # move to the project file directory so all paths can be relative
    olddir = os.getcwd()
    try:
        os.chdir(os.path.split(project_file)[0])
    except OSError:
        pass

    test = ClassificationTaskManager(project_file)
    test.run()

    try:
        os.chdir(olddir)
    except OSError:
        pass
예제 #4
0
def runTests():
    parser = OptionParser(usage='%prog [options] project_file')

    options, args = parser.parse_args()

    try:
        project_file = args[0]
    except:
        parser.print_help()
        sys.exit(1)

    # open the yaml file describing the analysis to perform
    try:
        project_file = os.path.abspath(sys.argv[1])
    except:
        print 'ERROR: You need to specify a yaml project file...'
        print 'Exiting...'
        sys.exit(1)

    logging.getLogger('gaia2.classification').setLevel(debugLevel)
    if debugLevel == logging.DEBUG:
        cvar.verbose = True
    else:
        cvar.verbose = False

    # move to the project file directory so all paths can be relative
    try:
        os.chdir(os.path.split(project_file)[0])
    except OSError:
        pass

    test = ClassificationTaskManager(project_file)
    test.run()
예제 #5
0
def checkErrors(collectionName, resultsDir):
    collec = gaia2.mtgdb.MtgdbCollection(collectionName)
    collecDir = join(resultsDir, collectionName)
    sigsDir = join(collecDir, 'descriptors')
    evalDir = join(collecDir, 'evaluation')
    evalProject = join(evalDir, collectionName + '.yaml')

    # 1- check that all sig files could be correctly computed
    sigfiles = [p[1] for p in gaia2.essentia.sigfileList(collec, sigsDir)]

    missingSigs = []
    for sig in sigfiles:
        if not os.path.exists(sig):
            missingSigs.append(sig)

    # 2- check that all eval combinations could be computed
    missingEvals = []
    cm = ClassificationTaskManager(evalProject)

    nec = len(cm.evalconfigs)

    for conf in cm.allconfigs:
        resultFile = join(
            dirname(evalProject), cm.conf['resultsDirectory'],
            cm.conf['className'] + str(taskhash(conf)) + '_%d.result')

        for i in range(nec):
            if not exists(resultFile % i):
                missingEvals.append(conf)

    # 3- summary
    print '-' * 120
    print 'For collection %s' % collectionName
    print
    if missingSigs:
        print 'Some files failed to be analyzed:'
        for sig in sorted(missingSigs):
            print ' - %s' % sig
    else:
        print 'All sigfiles computed successfully!'

    if missingEvals:
        print 'Some evaluations failed:'
        for evaluation in missingEvals:
            print ' - %s' % evaluation
    else:
        print 'All evaluations completed successfully!'

    print '-' * 120
예제 #6
0
파일: run_tests.py 프로젝트: DomT4/gaia
import os, os.path
import sys
import logging

debugLevel = logging.INFO

if __name__ == '__main__':
    # open the yaml file describing the analysis to perform
    try:
        yamlfile = os.path.abspath(sys.argv[1])
    except:
        print 'ERROR: You need to specify a yaml project file...'
        print 'Exiting...'
        sys.exit(1)

    logging.getLogger('gaia2.classification').setLevel(debugLevel)
    if debugLevel == logging.DEBUG:
        cvar.verbose = True
    else:
        cvar.verbose = False

    # move to the project file directory so all paths can be relative
    try:
        os.chdir(os.path.split(yamlfile)[0])
    except OSError:
        pass

    test = ClassificationTaskManager(yamlfile)
    test.run()