From f710dfd7507dc8a1f0c9c718ef5c915f9a0167a3 Mon Sep 17 00:00:00 2001 From: Michael Boniface <mjbonifa@soton.ac.uk> Date: Fri, 7 Mar 2025 17:59:26 +0000 Subject: [PATCH] (docs) started to write the docstrings --- acmc/phen.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/acmc/phen.py b/acmc/phen.py index 39568d5..86131c2 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}" ) -- GitLab