Exemple #1
0
    def load_stage(cls, dvcfile, name, stage_data, lock_data):
        from . import PipelineStage, Stage, loads_from

        path, wdir = resolve_paths(dvcfile.path,
                                   stage_data.get(Stage.PARAM_WDIR))
        stage = loads_from(PipelineStage, dvcfile.repo, path, wdir, stage_data)
        stage.name = name

        deps = project(stage_data, [stage.PARAM_DEPS, stage.PARAM_PARAMS])
        fill_stage_dependencies(stage, **deps)

        outs = project(
            stage_data,
            [stage.PARAM_OUTS, stage.PARAM_METRICS, stage.PARAM_PLOTS],
        )
        stage.outs = lcat(
            output.load_from_pipeline(stage, data, typ=key)
            for key, data in outs.items())

        if lock_data:
            stage.cmd_changed = lock_data.get(
                Stage.PARAM_CMD) != stage_data.get(Stage.PARAM_CMD)
            cls.fill_from_lock(stage, lock_data)

        return stage
Exemple #2
0
    def load_stage(cls, dvcfile, d, stage_text):
        from dvc.stage import Stage, loads_from

        path, wdir = resolve_paths(dvcfile.path, d.get(Stage.PARAM_WDIR))
        stage = loads_from(Stage, dvcfile.repo, path, wdir, d)
        stage._stage_text = stage_text
        stage.deps = dependency.loadd_from(stage,
                                           d.get(Stage.PARAM_DEPS) or [])
        stage.outs = output.loadd_from(stage, d.get(Stage.PARAM_OUTS) or [])
        return stage
Exemple #3
0
    def load_stage(cls, dvcfile, name, stage_data, lock_data):
        from . import PipelineStage, Stage, loads_from

        path, wdir = resolve_paths(dvcfile.path,
                                   stage_data.get(Stage.PARAM_WDIR))
        stage = loads_from(PipelineStage, dvcfile.repo, path, wdir, stage_data)
        stage.name = name
        stage._fill_stage_dependencies(**stage_data)
        stage._fill_stage_outputs(**stage_data)
        if lock_data:
            stage.cmd_changed = lock_data.get(
                Stage.PARAM_CMD) != stage_data.get(Stage.PARAM_CMD)
            cls._fill_lock_checksums(stage, lock_data)

        return stage
Exemple #4
0
    def load_stage(cls, dvcfile, name, stage_data, lock_data):
        from . import PipelineStage, Stage, loads_from

        path, wdir = resolve_paths(
            dvcfile.path, stage_data.get(Stage.PARAM_WDIR)
        )
        stage = loads_from(PipelineStage, dvcfile.repo, path, wdir, stage_data)
        stage.name = name
        stage.deps, stage.outs = [], []

        cls._load_outs(stage, stage_data.get("outs", []))
        cls._load_deps(stage, stage_data.get("deps", []))
        cls._load_params(stage, stage_data.get("params", []))

        if lock_data:
            stage.cmd_changed = lock_data.get(
                Stage.PARAM_CMD
            ) != stage_data.get(Stage.PARAM_CMD)
            cls.fill_from_lock(stage, lock_data)

        return stage