From 744c3a5519e45982f72afdc4df30e4fa5c168ce8 Mon Sep 17 00:00:00 2001 From: kiihne-noaa Date: Thu, 14 Nov 2024 14:21:48 -0500 Subject: [PATCH] documentation and version changes --- fre/pp/checkoutScript.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/fre/pp/checkoutScript.py b/fre/pp/checkoutScript.py index 491ca7c0..c0877331 100644 --- a/fre/pp/checkoutScript.py +++ b/fre/pp/checkoutScript.py @@ -36,8 +36,11 @@ def _checkoutTemplate(experiment, platform, target, branch=None): # branch and version parameters default_tag = subprocess.run(["fre","--version"],capture_output=True, text=True).stdout.split()[2] + if default_tag == '2024.1': #hard coded solution to current discrepencies with fre --version + default_tag = '2024.01' + if branch is not None: - if os.path.isdir(name): #scenario 4 + if os.path.isdir(name): #scenario 4 os.chdir(name) name_path_tag=subprocess.run(["git","describe","--tags"],capture_output=True, text=True).stdout.split('*') name_path_branch=subprocess.run(["git","branch"],capture_output=True, text=True).stdout @@ -47,9 +50,14 @@ def _checkoutTemplate(experiment, platform, target, branch=None): stop_report = f"Tag and branch of prexisting directory {directory}/{name} does not match fre --version or branch requested" sys.exit(stop_report) return 1 + print('directory exists, and branch requested matches branch in use') + else: #scenario 2 - subprocess.run(['git', 'clone', f'--branch={branch}', '--recursive', 'https://github.com/NOAA-GFDL/fre-workflows.git', f'{name}']) + clone_output = subprocess.run(['git', 'clone', f'--branch={branch}', '--recursive', 'https://github.com/NOAA-GFDL/fre-workflows.git', f'{name}'], capture_output=True, text=True) + print('output of fre pp checkouts git clone command is as follows:',clone_output) else: + print('the default tag for directory ',directory,'/',name, ' is ', default_tag) + if os.path.isdir(name): #scenario 3 os.chdir(name) name_path_tag=subprocess.run(["git","describe","--tags"],capture_output=True, text=True).stdout.split()[0] @@ -58,9 +66,11 @@ def _checkoutTemplate(experiment, platform, target, branch=None): stop_report = f"Tag of prexisting directory {diretory}/{name} does not match fre --version" sys.exit(stop_report) return 1 + print('directory exists, and its branch matches default tag') + else: #scenario 1 - subprocess.run(['git', 'clone', '-b',f'{default_tag}', '--recursive', 'https://github.com/NOAA-GFDL/fre-workflows.git', f'{name}']) - + clone_output = subprocess.run(['git', 'clone', '-b',f'{default_tag}', '--recursive', 'https://github.com/NOAA-GFDL/fre-workflows.git', f'{name}'], capture_output=True, text=True) + print('output of fre pp checkouts git clone command is as follows:',clone_output) #############################################