diff --git a/acmc/phen.py b/acmc/phen.py index 39568d559f1e62ad904255c5958a8a8250c6bfbe..86131c282a72b4bf5cc8ea2fb0f723ba2cebac9e 100644 --- a/acmc/phen.py +++ b/acmc/phen.py @@ -170,6 +170,15 @@ def create_empty_git_dir(path): def check_delete_dir(path, msg): + """Checks on the command line if a user wants to delete a directory + + Args: + path (Path): path of the directory to be deleted + msg (str): message to be displayed to the user + + Returns: + Boolean: True if deleted + """ deleted = False user_input = input(f"{msg}").strip().lower() @@ -183,6 +192,19 @@ def check_delete_dir(path, msg): def fork(phen_dir, upstream_url, upstream_version, new_origin_url=None): + """Forks an upstream phenotype in a remote repo at a specific version to a local director, and optionally sets to a new remote origin" + + Args: + phen_dir (str): local directory path where the upstream repo is to be cloned + upstream_url (str): url to the upstream repo + upstream_version (str): version in the upstream repo to clone + new_origin_url (str, optional): url of the remote repo to set as the new origin. Defaults to None. + + Raises: + ValueError: if the specified version is not in the upstream repo + ValueError: if the upstream repo is not a valid phenotype repo + ValueError: if there's any other problems with Git + """ logger.info( f"Forking upstream repo {upstream_url} {upstream_version} into directory: {phen_dir}" )