Exemplo n.º 1
0
def _collect_plots(repo, targets=None, rev=None):
    plots, path_infos = collect(
        repo, output_filter=_is_plot, targets=targets, rev=rev
    )
    result = {plot.path_info: _plot_props(plot) for plot in plots}
    result.update({path_info: {} for path_info in path_infos})
    return result
Exemplo n.º 2
0
def _collect_metrics(repo, targets, revision, recursive):
    metrics, path_infos = collect(
        repo,
        targets=targets,
        output_filter=_is_metric,
        recursive=recursive,
        rev=revision,
    )
    return [m.path_info for m in metrics] + list(path_infos)
Exemplo n.º 3
0
Arquivo: show.py Projeto: pmrowla/dvc
def _collect_metrics(repo, targets, revision, recursive):
    metrics, fs_paths = collect(
        repo,
        targets=targets,
        output_filter=_is_metric,
        recursive=recursive,
        rev=revision,
    )
    return _to_fs_paths(metrics) + list(fs_paths)
Exemplo n.º 4
0
def _collect_configs(repo: "Repo", rev, targets=None) -> List["DvcPath"]:
    params, path_infos = collect(
        repo,
        targets=targets or [],
        deps=True,
        output_filter=_is_params,
        rev=rev,
    )
    path_infos.update({p.path_info for p in params})
    if not targets:
        path_infos.add(
            PathInfo(repo.root_dir) / ParamsDependency.DEFAULT_PARAMS_FILE)
    return list(path_infos)
Exemplo n.º 5
0
Arquivo: show.py Projeto: vijay120/dvc
def _collect_configs(repo: "Repo", rev, targets=None) -> List["DvcPath"]:
    params, path_infos = collect(
        repo,
        targets=targets or [],
        deps=True,
        output_filter=_is_params,
        rev=rev,
    )
    path_infos.extend([p.path_info for p in params])
    if not targets:
        default_params = (PathInfo(repo.root_dir) /
                          ParamsDependency.DEFAULT_PARAMS_FILE)
        if default_params not in path_infos:
            path_infos.append(default_params)
    return list(path_infos)
Exemplo n.º 6
0
def _collect_plots(
    repo: "Repo",
    targets: List[str] = None,
    rev: str = None,
    recursive: bool = False,
) -> Dict[str, Dict]:
    plots, path_infos = collect(
        repo,
        output_filter=_is_plot,
        targets=targets,
        rev=rev,
        recursive=recursive,
    )
    result = {plot.path_info: _plot_props(plot) for plot in plots}
    result.update({path_info: {} for path_info in path_infos})
    return result
Exemplo n.º 7
0
Arquivo: show.py Projeto: jheister/dvc
def _collect_metrics(repo, targets, revision, recursive):
    try:
        metrics, path_infos = collect(
            repo,
            targets=targets,
            output_filter=_is_metric,
            recursive=recursive,
            rev=revision,
        )

        return _to_path_infos(metrics) + list(path_infos)

    except LockfileCorruptedError:
        logger.warning(
            "Corrupt lockfile at revision %s. Ignoring in metrics.", revision
        )
        return []
Exemplo n.º 8
0
def _collect_configs(
        repo: "Repo",
        rev,
        targets=None) -> Tuple[List["BaseOutput"], List["DvcPath"]]:
    params, path_infos = collect(
        repo,
        targets=targets or [],
        deps=True,
        output_filter=_is_params,
        rev=rev,
    )
    all_path_infos = path_infos + [p.path_info for p in params]
    if not targets:
        default_params = (PathInfo(repo.root_dir) /
                          ParamsDependency.DEFAULT_PARAMS_FILE)
        if default_params not in all_path_infos:
            path_infos.append(default_params)
    return params, path_infos
Exemplo n.º 9
0
def _collect_configs(repo: "Repo",
                     rev,
                     targets=None) -> Tuple[List["Output"], List[str]]:

    params, fs_paths = collect(
        repo,
        targets=targets or [],
        deps=True,
        output_filter=_is_params,
        rev=rev,
    )
    all_fs_paths = fs_paths + [p.fs_path for p in params]
    if not targets:
        default_params = repo.fs.path.join(
            repo.root_dir, ParamsDependency.DEFAULT_PARAMS_FILE)
        if default_params not in all_fs_paths and repo.fs.exists(
                default_params):
            fs_paths.append(default_params)
    return params, fs_paths
Exemplo n.º 10
0
def _collect_plots(
    repo: "Repo",
    targets: List[str] = None,
    rev: str = None,
    recursive: bool = False,
) -> Dict[str, Dict]:
    from dvc.repo.collect import collect

    plots, fs_paths = collect(
        repo,
        output_filter=_is_plot,
        targets=targets,
        rev=rev,
        recursive=recursive,
    )

    result = {plot.fs_path: _plot_props(plot) for plot in plots}
    result.update({fs_path: {} for fs_path in fs_paths})
    return result
Exemplo n.º 11
0
Arquivo: show.py Projeto: dudarev/dvc
def _collect_configs(repo: "Repo", rev) -> List[PathInfo]:
    params, _ = collect(repo, deps=True, output_filter=_is_params, rev=rev)
    configs = {p.path_info for p in params}
    configs.add(PathInfo(repo.root_dir) / ParamsDependency.DEFAULT_PARAMS_FILE)
    return list(configs)
Exemplo n.º 12
0
def test_no_file_on_target_rev(tmp_dir, scm, dvc, caplog):
    with caplog.at_level(logging.WARNING, "dvc"):
        collect(dvc, targets=["file.yaml"], rev="current_branch")

    assert "'file.yaml' was not found at: 'current_branch'." in caplog.text