Exemplo n.º 1
0
    sortedindexfile = open(sortedindexname, 'w')
    for record in records:
        (subdir, modelname, score) = record
        line = subdir + '#' + modelname + '#' + str(score)
        sortedindexfile.writelines([line, os.linesep])
    sortedindexfile.close()
    #end processing

    utils.sign_epoch(sortedindexfilestatus, 'Estimate')
    utils.store_status(sortedindexfilestatuspath, sortedindexfilestatus)

if __name__ == '__main__':
    parser = ArgumentParser(description='Estimate model candidates.')
    parser.add_argument('--modeldir', action='store', \
                            help='model directory', \
                            default=config.getModelDir())

    args = parser.parse_args()
    print(args)
    print("estimating")
    walkThroughModels(args.modeldir)
    print("gathering")
    indexname = os.path.join(args.modeldir, config.getEstimateIndex())
    gatherModels(args.modeldir, indexname)
    print("sorting")
    sortedindexname = os.path.join(args.modeldir, \
                                       config.getSortedEstimateIndex())
    sortModels(indexname, sortedindexname)
    print("done")
Exemplo n.º 2
0
    sortedindexfile = open(sortedindexname, 'w')
    for record in records:
        (subdir, modelname, score) = record
        line = subdir + '#' + modelname + '#' + str(score)
        sortedindexfile.writelines([line, os.linesep])
    sortedindexfile.close()
    #end processing

    utils.sign_epoch(sortedindexfilestatus, 'Estimate')
    utils.store_status(sortedindexfilestatuspath, sortedindexfilestatus)


if __name__ == '__main__':
    parser = ArgumentParser(description='Estimate model candidates.')
    parser.add_argument('--modeldir', action='store', \
                            help='model directory', \
                            default=config.getModelDir())

    args = parser.parse_args()
    print(args)
    print("estimating")
    walkThroughModels(args.modeldir)
    print("gathering")
    indexname = os.path.join(args.modeldir, config.getEstimateIndex())
    gatherModels(args.modeldir, indexname)
    print("sorting")
    sortedindexname = os.path.join(args.modeldir, \
                                       config.getSortedEstimateIndex())
    sortModels(indexname, sortedindexname)
    print("done")