From 75fc450773f1b744e30ba3fe87e1032fb1a42b5b Mon Sep 17 00:00:00 2001 From: aradhakrishnanGFDL Date: Thu, 24 Oct 2024 12:57:26 -0400 Subject: [PATCH 1/2] error checking --- catalogbuilder/intakebuilder/getinfo.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/catalogbuilder/intakebuilder/getinfo.py b/catalogbuilder/intakebuilder/getinfo.py index a99dd30..c81f10d 100644 --- a/catalogbuilder/intakebuilder/getinfo.py +++ b/catalogbuilder/intakebuilder/getinfo.py @@ -111,11 +111,10 @@ def getInfoFromGFDLFilename(filename,dictInfo,logger,configyaml): sys.exit("No output_path_template found. Check configuration.") if( "static" in filename ): ## For static we handle this differently . The GFDL PP expected pattern is atmos.static.nc - #TODO figure out better ways to set this and use fixed for frequency and table_id output_file_template = ['realm'] - dictInfo["variable_id"] = "fixed" #TODO verify if variable_id is a key - dictInfo["frequency"] = "fx" - dictInfo["table_id"] = "fixed" + if "variable_id" in dictInfo.keys(): dictInfo["variable_id"] = "fixed" + if "frequency" in dictInfo.keys(): dictInfo["frequency"] = "fx" + if "table_id" in dictInfo.keys(): dictInfo["table_id"] = "fixed" ## nlen = len(output_file_template) for i in range(nlen-1,-1,-1): #nlen = 3 From 540cd38c0e2938a2b2c62e0aa8d21f6a6242c5a5 Mon Sep 17 00:00:00 2001 From: aradhakrishnanGFDL Date: Fri, 25 Oct 2024 10:42:07 -0400 Subject: [PATCH 2/2] table_id fx --- catalogbuilder/intakebuilder/getinfo.py | 2 +- catalogbuilder/intakebuilder/gfdlcrawler.py | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/catalogbuilder/intakebuilder/getinfo.py b/catalogbuilder/intakebuilder/getinfo.py index c81f10d..7bed7de 100644 --- a/catalogbuilder/intakebuilder/getinfo.py +++ b/catalogbuilder/intakebuilder/getinfo.py @@ -114,7 +114,7 @@ def getInfoFromGFDLFilename(filename,dictInfo,logger,configyaml): output_file_template = ['realm'] if "variable_id" in dictInfo.keys(): dictInfo["variable_id"] = "fixed" if "frequency" in dictInfo.keys(): dictInfo["frequency"] = "fx" - if "table_id" in dictInfo.keys(): dictInfo["table_id"] = "fixed" + if "table_id" in dictInfo.keys(): dictInfo["table_id"] = "fx" ## nlen = len(output_file_template) for i in range(nlen-1,-1,-1): #nlen = 3 diff --git a/catalogbuilder/intakebuilder/gfdlcrawler.py b/catalogbuilder/intakebuilder/gfdlcrawler.py index 919ae5a..6cacdab 100644 --- a/catalogbuilder/intakebuilder/gfdlcrawler.py +++ b/catalogbuilder/intakebuilder/gfdlcrawler.py @@ -82,8 +82,6 @@ def crawlLocal(projectdir, dictFilter,dictFilterIgnore,logger,configyaml,slow): if ((len(filename.split('.'))-1) != len(set_ftemplate)): logger.debug("Skipping "+filename) continue - else: - print("tmp debugging static", filename) logger.debug(dirpath+"/"+filename) dictInfo = {} dictInfo = getinfo.getProject(projectdir, dictInfo) @@ -94,14 +92,12 @@ def crawlLocal(projectdir, dictFilter,dictFilterIgnore,logger,configyaml,slow): dictInfo = getinfo.getInfoFromFilename(filename,dictInfo, logger) else: dictInfo = getinfo.getInfoFromGFDLFilename(filename,dictInfo, logger,configyaml) - print("1. ", dictInfo) if "variable_id" in dictInfo.keys(): if dictInfo["variable_id"] is not None: variable_id = dictInfo["variable_id"] else: variable_id = "" dictInfo = getinfo.getInfoFromGFDLDRS(dirpath, projectdir, dictInfo,configyaml,variable_id) - print("2.", dictInfo) list_bad_modellabel = ["","piControl","land-hist","piClim-SO2","abrupt-4xCO2","hist-piAer","hist-piNTCF","piClim-ghg","piClim-OC","hist-GHG","piClim-BC","1pctCO2"] list_bad_chunklabel = ['DO_NOT_USE'] if "source_id" in dictInfo: