Skip to content

Commit

Permalink
Merge pull request NCAR#300 from justin-richling/comp-table-website-fix
Browse files Browse the repository at this point in the history
Fix missing comparison tables
  • Loading branch information
nusbaume authored Apr 30, 2024
2 parents 2ddd16b + 3e0a43d commit 536325f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scripts/analysis/amwg_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ def amwg_table(adf):
#-----------------------------------------

#Loop over CAM cases:
#Initialize list of case name csv files for case comparison check later
csv_list = []
for case_idx, case_name in enumerate(case_names):

#Convert output location string to a Path object:
Expand Down Expand Up @@ -306,6 +308,9 @@ def amwg_table(adf):
print(f"\n\tAMWG table for '{case_name}' not created.\n")
#End try/except

#Keep track of case csv files for comparison table check later
csv_list.extend(sorted(output_location.glob(f"amwg_table_{case_name}.csv")))

#End of model case loop
#----------------------

Expand All @@ -314,7 +319,7 @@ def amwg_table(adf):
#Check if observations are being compared to, if so skip table comparison...
if not adf.get_basic_info("compare_obs"):
#Check if all tables were created to compare against, if not, skip table comparison...
if len(sorted(output_location.glob("*.csv"))) != len(case_names):
if len(csv_list) != len(case_names):
print("\tNot enough cases to compare, skipping comparison table...")
else:
#Create comparison table for both cases
Expand Down

0 comments on commit 536325f

Please sign in to comment.