def cli(ctx, basepath, workflow_name, step, save, use_input):
    ctx.obj["structure"] = Structure(basepath=basepath,
                                     name=workflow_name,
                                     step=step)
    ctx.obj["json"] = False
    ctx.obj["save"] = save
    ctx.obj["use_input"] = use_input
def cli(ctx, basepath, workflow_name, step, save, use_input,
        prototype_cache_preloaded_only):
    ctx.obj["structure"] = Structure(basepath=basepath,
                                     name=workflow_name,
                                     step=step)
    ctx.obj["json"] = True
    ctx.obj["save"] = save
    ctx.obj["use_input"] = use_input
    ctx.obj["prototype_cache_preloaded_only"] = prototype_cache_preloaded_only
예제 #3
0
def cli(ctx, basepath, workflow_name, step, save, use_input, configuration):
    ctx.obj["structure"] = Structure(basepath=basepath,
                                     name=workflow_name,
                                     step=step)
    ctx.obj["save"] = save
    ctx.obj["use_input"] = use_input
    config_module = ctx.obj["structure"].configuration_module()
    importlib.import_module(config_module)
    configdict = sys.modules[config_module]
    ctx.obj["configurations"] = configdict.configurations
def cli(ctx, basepath, workflow_name, step, configuration, save, use_input):
    ctx.obj["structure"] = Structure(basepath=basepath,
                                     name=workflow_name,
                                     step=step)
    ctx.obj["json"] = True
    ctx.obj["save"] = save
    ctx.obj["use_input"] = use_input
    configdict = {}
    execfile(configuration or ctx.obj["structure"].configuration_file_path(),
             configdict)
    ctx.obj["configurations"] = configdict["configurations"][:]
예제 #5
0
def cli(ctx, basepath, workflow_name, step, configuration, start, maximum,
        json, hdf, save, use_input):
    if not hdf and json:
        ctx.obj["json"] = True
    else:
        ctx.obj["hdf"] = hdf
        ctx.obj["json"] = json
    if ctx.obj.get("json", False):
        ctx.obj["file_type"] = "json"
    elif ctx.obj.get("hdf", False):
        ctx.obj["file_type"] = "h5"
    ctx.obj["save"] = save
    ctx.obj["use_input"] = use_input
    ctx.obj["start"] = start
    ctx.obj["maximum"] = maximum
    ctx.obj["structure"] = Structure(basepath=basepath,
                                     name=workflow_name,
                                     step=step)
    config_module = ctx.obj["structure"].configuration_module()
    importlib.import_module(config_module)
    configdict = sys.modules[config_module]
    ctx.obj["configurations"] = configdict.configurations
def cli(ctx, basepath, workflow_name, step, use_input):
    ctx.obj["structure"] = Structure(basepath=basepath,
                                     name=workflow_name,
                                     step=step)
    ctx.obj["use_input"] = use_input
def start(start, end):
    env_vars = json.load(
        open(
            os.path.join(os.path.dirname(__file__), os.pardir,
                         "base_configuration.json"), "r"))
    env_vars.update(
        json.load(
            open(
                os.path.join(os.path.dirname(__file__),
                             "workflow_configuration.json"), "r")))
    if env_vars["DISS_BASEPATH"].startswith(
            "./") or env_vars["DISS_BASEPATH"] == ".":
        env_vars["DISS_BASEPATH"] = os.path.abspath(
            os.path.join(os.path.dirname(__file__), os.pardir,
                         env_vars["DISS_BASEPATH"][1:]))
    if env_vars["DISS_BASEPATH"] == "..":
        env_vars["DISS_BASEPATH"] = os.path.abspath(
            os.path.join(os.path.dirname(__file__), os.pardir, os.pardir,
                         env_vars["DISS_BASEPATH"][2:]))
    if env_vars["DISS_WORKFLOWFOLDER_NAME"] == ".":
        env_vars["DISS_WORKFLOWFOLDER_NAME"] = os.path.basename(
            os.path.abspath(os.path.join(os.path.dirname(__file__),
                                         os.pardir)))
    workflow = Workflow()
    workflow.add_task(
        cli_path=Structure.data_selection_cli(),
        cmd="index-valid-hdf-trees",
        save=True,
        pcount=1,
        trees=[
            os.path.join(
                os.path.dirname(__file__), os.pardir,
                "data/trees/Bd_Kpi_mdst_000001_prod00006875_task00000001.h5"),
            os.path.join(
                os.path.dirname(__file__), os.pardir,
                "data/trees/Bd_Kspi0_mdst_000001_prod00006201_task00000001.h5")
        ],
        name="Index valid HDF trees")
    workflow.prepare_intermediate_as_input(reference="Index valid HDF trees")
    workflow.add_task(cli_path=Structure.workflow_cli(),
                      cmd="process-as-matrix",
                      save=True,
                      hdf=True,
                      use_input=True,
                      name="Generate Distance Matrix",
                      pcount=16)
    workflow.add_task(
        cli_path=Structure.data_selection_cli(),
        cmd="index-valid-hdf-trees",
        save=True,
        pcount=1,
        representatives=[
            os.path.join(
                os.path.dirname(__file__), os.pardir,
                "data/trees/Bd_Kpi_mdst_000001_prod00006875_task00000001.h5"),
            os.path.join(
                os.path.dirname(__file__), os.pardir,
                "data/trees/Bd_Kspi0_mdst_000001_prod00006201_task00000001.h5")
        ],
        trees=[
            os.path.join(os.path.dirname(__file__), os.pardir,
                         "data/trees/toy_B-Kpi/1110020000_Kpi_Dplus.h5"),
            os.path.join(os.path.dirname(__file__), os.pardir,
                         "data/trees/toy_B-Kpi/1110020000_Kpi_Dstar.h5"),
            os.path.join(os.path.dirname(__file__), os.pardir,
                         "data/trees/toy_B-Kpi/1110026100_Kspi0_Dplus.h5"),
            os.path.join(os.path.dirname(__file__), os.pardir,
                         "data/trees/toy_B-Kpi/1110026100_Kspi0_Dstar.h5")
        ],
        name="Index trees and representatives")
    workflow.prepare_intermediate_as_input(
        reference="Index trees and representatives")
    workflow.add_task(cli_path=Structure.workflow_cli(),
                      cmd="batch-process-as-vector",
                      save=True,
                      hdf=True,
                      use_input=True,
                      name="Generate Distance Vectors",
                      pcount=16)
    # finalise results
    workflow.finalise(file_type="h5", reference="Generate Distance Matrix")
    workflow.finalise(file_type="h5", reference="Generate Distance Vectors")
    workflow.execute(env_vars, start=start, end=end)
예제 #8
0
def cli(ctx, basepath, workflow_name, step):
    ctx.obj["structure"] = Structure(basepath=basepath,
                                     name=workflow_name,
                                     step=step)