From 6efa81d4a7150c20319d6d11d9e0657f95559097 Mon Sep 17 00:00:00 2001 From: justin-richling Date: Mon, 28 Oct 2024 11:51:45 -0600 Subject: [PATCH] Update adf_web.py Remove check for existing table file, just remake every time. Also update test case name call for page headers. --- lib/adf_web.py | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/lib/adf_web.py b/lib/adf_web.py index ed21e655c..966646f60 100644 --- a/lib/adf_web.py +++ b/lib/adf_web.py @@ -619,18 +619,16 @@ def jinja_list(seas_list): #Check if the mean plot type page exists for this case (or for multi-case): mean_table_file = table_pages_dir / "mean_tables.html" - if not mean_table_file.exists(): - #Construct mean_table.html - mean_table_tmpl = jinenv.get_template('template_mean_tables.html') - #Reuse the rend_kwarg_dict, but ignore certain keys - #since all others are the same - new_dict = {k: rend_kwarg_dict[k] for k in rend_kwarg_dict.keys() - {'table_name', 'table_html'}} - mean_table_rndr = mean_table_tmpl.render(new_dict) - #Write mean diagnostic tables HTML file: - with open(mean_table_file, 'w', encoding='utf-8') as ofil: - ofil.write(mean_table_rndr) - #End with - #End if + #Construct mean_table.html + mean_table_tmpl = jinenv.get_template('template_mean_tables.html') + #Reuse the rend_kwarg_dict, but ignore certain keys + #since all others are the same + new_dict = {k: rend_kwarg_dict[k] for k in rend_kwarg_dict.keys() - {'table_name', 'table_html'}} + mean_table_rndr = mean_table_tmpl.render(new_dict) + #Write mean diagnostic tables HTML file: + with open(mean_table_file, 'w', encoding='utf-8') as ofil: + ofil.write(mean_table_rndr) + #End with #End if (tables) else: #Plot image @@ -716,7 +714,7 @@ def jinja_list(seas_list): index_title = "AMP Diagnostics Prototype" index_tmpl = jinenv.get_template('template_index.html') index_rndr = index_tmpl.render(title=index_title, - case_name=web_data.case, + case_name=case1, base_name=data_name, case_yrs=case_yrs, baseline_yrs=baseline_yrs,