Beispiel #1
0
def clone_pipeline(
    template: str,
    out_dir: Path,
) -> None:
    """
    Clones pipeline from empty pipeline template or from demo pipelines
    available in Git repos of Catalyst Team.

    Args:
        template (str): type of pipeline you want to clone.
            empty/classification/segmentation
        out_dir (pathlib.Path): path where pipeline directory should be cloned
    Returns:
        None
    """
    if template == "empty" or template is None:
        utils.copy_directory(PATH_TO_TEMPLATE, out_dir)
    else:
        url = URL[template]
        repo.clone_from(url, out_dir / "__git_temp")
        shutil.rmtree(out_dir / "__git_temp" / ".git")
        if (out_dir / "__git_temp" / ".gitignore").exists():
            (out_dir / "__git_temp" / ".gitignore").unlink()

        utils.copy_directory(out_dir / "__git_temp", out_dir)
        shutil.rmtree(out_dir / "__git_temp")
Beispiel #2
0
def load_pipeline(
    url: str,
    out_dir: Path,
) -> None:
    repo.clone_from(url, out_dir / "__git_temp")
    shutil.rmtree(out_dir / "__git_temp" / ".git")
    if (out_dir / "__git_temp" / ".gitignore").exists():
        (out_dir / "__git_temp" / ".gitignore").unlink()

    utils.copy_directory(out_dir / "__git_temp", out_dir)
    shutil.rmtree(out_dir / "__git_temp")
Beispiel #3
0
def load_empty(out_dir: Path) -> None:
    utils.copy_directory(PATH_TO_TEMPLATE, out_dir)