Beispiel #1
0
def summary_template():
    version = versions.get_version()
    template_file = os.path.join(get_dir(version), 'run_summary.py')
    template_py = open(template_file).read()

    template_file = os.path.join(get_dir(version), 'run_summary.sh')
    template_sh = open(template_file).read()
    return template_py, template_sh
Beispiel #2
0
def getTemplateFilename(city, template):
    version = versions.get_version()
    if not template in templates[city]:
        logging.error("Template {} not found for city {}".\
                      format(city, template))
        exit(1)
    template_file = templates[city][template]
    return template_file
Beispiel #3
0
def get(city, template):
    version = versions.get_version()
    if not template in templates[city]:
        logging.error("Template {} not found for city {}".\
                      format(city, template))
        exit(1)
    template_file = get_dir(version) + templates[city][template]
    template = open(template_file).read()
    return template
Beispiel #4
0
                        default='1',
                        help='trigger type')
    return parser


#get options
args = get_parser().parse_args()
#set logging level
if args.debug:
    logging.basicConfig(level=logging.DEBUG)
else:
    logging.basicConfig(level=logging.INFO)
logging.debug("Input arguments: {}".format(args))

#get tags
version = versions.get_version()
templates_dir = templates.get_dir(version)
ic_tag = versions.get_ic_tag(templates_dir)
ceres_tag = versions.get_ceres_tag()
versions = data.Versions(ic=ic_tag,
                         ceres=ceres_tag,
                         config=args.type,
                         version=version)
logging.debug(versions)
logging.info(
    "You are running {} version with IC tag {} and CERES tag {}".format(
        version, ic_tag, ceres_tag))

#IO dirs
path_in = utils.get_input_path(args, version)
base_dir = '/analysis/{}/hdf5/{}/{}/{}/'.format(args.run, version, ic_tag,
Beispiel #5
0
def exec_template():
    version = versions.get_version()
    template_file = os.path.join(get_dir(version), 'exec.sh')
    template = open(template_file).read()
    return template