Skip to content

Commit

Permalink
Better error handling when variable_id/realm is unavailable
Browse files Browse the repository at this point in the history
  • Loading branch information
Ciheim Brown authored and Ciheim Brown committed Nov 25, 2024
1 parent 038de4d commit a5091a1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions catalogbuilder/scripts/gen_intake_gfdl.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,14 @@ def create_catalog(input_path=None, output_path=None, config=None, filter_realm=
#If we badly need standard name, we use gfdl cmip mapping tables especially when one does not prefer the slow option. Useful for MDTF runs
df = pd.read_csv(os.path.abspath(csv_path), sep=",", header=0,index_col=False)
list_variable_id = []
list_variable_id = df["variable_id"].unique().tolist()
list_realm = df["realm"].unique().tolist()
try:
list_variable_id = df["variable_id"].unique().tolist()
except:
print("Having trouble finding 'variable_id'... Be sure to add it to the output_path_template field of your configuration")
try:
list_realm = df["realm"].unique().tolist()
except:
print("Having trouble finding 'realm'... Be sure to add it to the output_path_template field of your configuration")
dictVarCF = getinfo.getStandardName(list_variable_id,list_realm)
#print("standard name from look-up table-", dictVarCF)
for k, v in dictVarCF.items():
Expand Down

0 comments on commit a5091a1

Please sign in to comment.