From 4f5aa56e5f38d704f4c5ddaeb25b0d5147bbd12c Mon Sep 17 00:00:00 2001 From: Duncan Bark Date: Mon, 15 Aug 2022 09:58:53 -0700 Subject: [PATCH] small fixes for V4r4 checkpoint --- aws/configs/created_jobs.txt | 2 +- aws/configs/jobs.txt | 2 +- aws/src/ecco_v4_py/ecco_utils.py | 15 +++++++++------ aws/src/utils/jobs_utils.py | 2 +- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/aws/configs/created_jobs.txt b/aws/configs/created_jobs.txt index 43056f7..8620232 100644 --- a/aws/configs/created_jobs.txt +++ b/aws/configs/created_jobs.txt @@ -1 +1 @@ -[0,'latlon','AVG_MON',[15, 16, 17, 18, 19]] +[15,'native','AVG_MON',12] diff --git a/aws/configs/jobs.txt b/aws/configs/jobs.txt index 288692c..079a310 100644 --- a/aws/configs/jobs.txt +++ b/aws/configs/jobs.txt @@ -1,6 +1,6 @@ #grouping_to_process,product_type,output_frequency,num_time_steps_to_process -[0,'latlon','AVG_MON',[15, 16, 17, 18, 19]] +10,latlon,AVG_MON,12 done [0,'latlon','AVG_MON',[15, 16, 17, 18, 19]] diff --git a/aws/src/ecco_v4_py/ecco_utils.py b/aws/src/ecco_v4_py/ecco_utils.py index 28461b3..85c74ee 100644 --- a/aws/src/ecco_v4_py/ecco_utils.py +++ b/aws/src/ecco_v4_py/ecco_utils.py @@ -55,14 +55,17 @@ def add_global_metadata(metadata, G, dataset_dim, less_output=True): # if we do add the field, we have to convert to the # appropriate data type if add_field == True: - if mtype == 's': + if isinstance(mc['value'], str) and 'TBD_' in mc['value']: G.attrs[mname] = mc['value'] - elif mtype == 'f': - G.attrs[mname] = float(mc['value']) - elif mtype == 'i': - G.attrs[mname] = np.int32(mc['value']) else: - print('INVALID MTYPE ! ', mtype) + if mtype == 's': + G.attrs[mname] = mc['value'] + elif mtype == 'f': + G.attrs[mname] = float(mc['value']) + elif mtype == 'i': + G.attrs[mname] = np.int32(mc['value']) + else: + print('INVALID MTYPE ! ', mtype) # else: # print('\t> not adding ', mc) diff --git a/aws/src/utils/jobs_utils.py b/aws/src/utils/jobs_utils.py index f52f737..eb3e5e7 100644 --- a/aws/src/utils/jobs_utils.py +++ b/aws/src/utils/jobs_utils.py @@ -12,7 +12,7 @@ from collections import defaultdict # Local imports -main_path = Path(__file__).parent.parent.resolve() +main_path = Path(__file__).parent.parent.parent.resolve() sys.path.append(f'{main_path / "src"}') sys.path.append(f'{main_path / "src" / "utils"}') import file_utils as file_utils