-
Notifications
You must be signed in to change notification settings - Fork 18
Throw big table diffs for missing tables or size diffs #118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| NAME = 'energyplus_regressions' | ||
| VERSION = '2.1.4' | ||
| VERSION = '2.1.5' | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -467,6 +467,8 @@ def table_diff( | |
| if uheading1 not in uhset_match: | ||
| table_not_in_2 = 1 | ||
| count_of_not_in_2 += table_not_in_2 | ||
| table_big_diff = 1 | ||
| count_of_big_diff += table_big_diff | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A table that is missing in the mod branch is now going to also report a table big diff. |
||
| make_err_table_row(err_soup, tabletag, uheading1, count_of_tables, abs_diff_file, rel_diff_file, | ||
| table_small_diff, table_big_diff, table_equal, table_string_diff, table_size_error, | ||
| table_not_in_1, table_not_in_2) | ||
|
|
@@ -479,6 +481,8 @@ def table_diff( | |
| if len(table1('tr')) != len(table2('tr')) or len(table1('td')) != len(table2('td')): | ||
| table_size_error = 1 | ||
| count_of_size_error += table_size_error | ||
| table_big_diff = 1 | ||
| count_of_big_diff += table_big_diff | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A table that has a mismatched size (row count change, column count change, empty, etc.), will now also report a table big diff. |
||
| make_err_table_row(err_soup, tabletag, uheading1, count_of_tables, abs_diff_file, rel_diff_file, | ||
| table_small_diff, table_big_diff, table_equal, table_string_diff, table_size_error, | ||
| table_not_in_1, table_not_in_2) | ||
|
|
||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. New test base file. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,100 @@ | ||
| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd"> | ||
| <html> | ||
| <head> | ||
| <title> Bldg DENVER CENTENNIAL ANN CLG 1% CONDNS DB=>MWB ** | ||
| 2018-11-20 | ||
| 17:26:37 | ||
| - EnergyPlus</title> | ||
| </head> | ||
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | ||
| <body> | ||
| <p><a href="#toc" style="float: right">Table of Contents</a></p> | ||
| <a name=top></a> | ||
| <p>Program Version:<b>EnergyPlus, Version 9.0.1-a7c9cc14ce, YMD=2018.11.20 17:26</b></p> | ||
| <p>Tabular Output Report in Format: <b>HTML</b></p> | ||
| <p>Building: <b>Bldg</b></p> | ||
| <p>Environment: <b>DENVER CENTENNIAL ANN CLG 1% CONDNS DB=>MWB ** </b></p> | ||
| <p>Simulation Timestamp: <b>2018-11-20 | ||
| 17:26:37</b></p> | ||
| <hr> | ||
| <p><a href="#toc" style="float: right">Table of Contents</a></p> | ||
| <a name=AnnualBuildingUtilityPerformanceSummary::EntireFacility></a> | ||
| <p>Report:<b> Annual Building Utility Performance Summary</b></p> | ||
| <p>For:<b> Entire Facility</b></p> | ||
| <p>Timestamp: <b>2018-11-20 | ||
| 17:26:37</b></p> | ||
| <b>Values gathered over 0.00 hours</b><br><br> | ||
| <b>WARNING: THE REPORT DOES NOT REPRESENT A FULL ANNUAL SIMULATION.</b><br><br> | ||
| <b></b><br><br> | ||
| <b>Site and Source Energy</b><br><br> | ||
| <!-- FullName:Annual Building Utility Performance Summary_Entire Facility_Site and Source Energy--> | ||
| <table border="1" cellpadding="4" cellspacing="0"> | ||
| <tr><td></td> | ||
| <td align="right">Total Energy [GJ]</td> | ||
| <td align="right">Energy Per Total Building Area [MJ/m2]</td> | ||
| <td align="right">Energy Per Conditioned Building Area [MJ/m2]</td> | ||
| </tr> | ||
| <tr> | ||
| <td align="right">Total Site Energy</td> | ||
| <td align="right"> 0.00</td> | ||
| <td align="right"> 0.00</td> | ||
| <td align="right"> 0.00</td> | ||
| </tr> | ||
| <tr> | ||
| <td align="right">Net Site Energy</td> | ||
| <td align="right"> 0.00</td> | ||
| <td align="right"> 0.00</td> | ||
| <td align="right"> 0.00</td> | ||
| </tr> | ||
| <tr> | ||
| <td align="right">Total Source Energy</td> | ||
| <td align="right"> 0.00</td> | ||
| <td align="right"> 0.00</td> | ||
| <td align="right"> 0.00</td> | ||
| </tr> | ||
| <tr> | ||
| <td align="right">Net Source Energy</td> | ||
| <td align="right"> 0.00</td> | ||
| <td align="right"> 0.00</td> | ||
| <td align="right"> 0.00</td> | ||
| </tr> | ||
| </table> | ||
| <br><br> | ||
| <b>Site to Source Energy Conversion Factors</b><br><br> | ||
| <!-- FullName:Annual Building Utility Performance Summary_Entire Facility_Site to Source Energy Conversion Factors--> | ||
| <table border="1" cellpadding="4" cellspacing="0"> | ||
| <tr><td></td> | ||
| <td align="right">Site=>Source Conversion Factor</td> | ||
| </tr> | ||
| <tr> | ||
| <td align="right">Electricity</td> | ||
| <td align="right"> 3.167</td> | ||
| </tr> | ||
| <tr> | ||
| <td align="right">Natural Gas</td> | ||
| <td align="right"> 1.084</td> | ||
| </tr> | ||
| </table> | ||
| <br><br> | ||
| <b>Building Area</b><br><br> | ||
| <!-- FullName:Annual Building Utility Performance Summary_Entire Facility_Building Area--> | ||
| <table border="1" cellpadding="4" cellspacing="0"> | ||
| <tr><td></td> | ||
| <td align="right">Area [m2]</td> | ||
| </tr> | ||
| <tr> | ||
| <td align="right">Total Building Area</td> | ||
| <td align="right"> 232.26</td> | ||
| </tr> | ||
| <tr> | ||
| <td align="right">Net Conditioned Building Area</td> | ||
| <td align="right"> 232.26</td> | ||
| </tr> | ||
| <tr> | ||
| <td align="right">Unconditioned Building Area</td> | ||
| <td align="right"> 0.00</td> | ||
| </tr> | ||
| </table> | ||
| <br><br> | ||
| </body> | ||
| </html> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd"> | ||
| <html> | ||
| <head> | ||
| <title> Bldg DENVER CENTENNIAL ANN CLG 1% CONDNS DB=>MWB ** | ||
| 2018-11-20 | ||
| 17:26:37 | ||
| - EnergyPlus</title> | ||
| </head> | ||
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | ||
| <body> | ||
| <p><a href="#toc" style="float: right">Table of Contents</a></p> | ||
| <a name=top></a> | ||
| <p>Program Version:<b>EnergyPlus, Version 9.0.1-a7c9cc14ce, YMD=2018.11.20 17:26</b></p> | ||
| <p>Tabular Output Report in Format: <b>HTML</b></p> | ||
| <p>Building: <b>Bldg</b></p> | ||
| <p>Environment: <b>DENVER CENTENNIAL ANN CLG 1% CONDNS DB=>MWB ** </b></p> | ||
| <p>Simulation Timestamp: <b>2018-11-20 | ||
| 17:26:37</b></p> | ||
| <hr> | ||
| <p><a href="#toc" style="float: right">Table of Contents</a></p> | ||
| <a name=AnnualBuildingUtilityPerformanceSummary::EntireFacility></a> | ||
| <p>Report:<b> Annual Building Utility Performance Summary</b></p> | ||
| <p>For:<b> Entire Facility</b></p> | ||
| <p>Timestamp: <b>2018-11-20 | ||
| 17:26:37</b></p> | ||
| <b>Values gathered over 0.00 hours</b><br><br> | ||
| <b>WARNING: THE REPORT DOES NOT REPRESENT A FULL ANNUAL SIMULATION.</b><br><br> | ||
| <b></b><br><br> | ||
| <b>Site and Source Energy</b><br><br> | ||
| <!-- FullName:Annual Building Utility Performance Summary_Entire Facility_Site and Source Energy--> | ||
| <table border="1" cellpadding="4" cellspacing="0"> | ||
| <tr><td></td> | ||
| <td align="right">Total Energy [GJ]</td> | ||
| <td align="right">Energy Per Total Building Area [MJ/m2]</td> | ||
| <td align="right">Energy Per Conditioned Building Area [MJ/m2]</td> | ||
| </tr> | ||
| <tr> | ||
| <td align="right">Total Site Energy</td> | ||
| <td align="right"> 0.00</td> | ||
| <td align="right"> 0.00</td> | ||
| <td align="right"> 0.00</td> | ||
| </tr> | ||
| <tr> | ||
| <td align="right">Net Site Energy</td> | ||
| <td align="right"> 0.00</td> | ||
| <td align="right"> 0.00</td> | ||
| <td align="right"> 0.00</td> | ||
| </tr> | ||
| <tr> | ||
| <td align="right">Total Source Energy</td> | ||
| <td align="right"> 0.00</td> | ||
| <td align="right"> 0.00</td> | ||
| <td align="right"> 0.00</td> | ||
| </tr> | ||
| <tr> | ||
| <td align="right">Net Source Energy</td> | ||
| <td align="right"> 0.00</td> | ||
| <td align="right"> 0.00</td> | ||
| <td align="right"> 0.00</td> | ||
| </tr> | ||
| </table> | ||
| <br><br> | ||
| <b>Site to Source Energy Conversion Factors</b><br><br> | ||
| <!-- FullName:Annual Building Utility Performance Summary_Entire Facility_Site to Source Energy Conversion Factors--> | ||
| <table border="1" cellpadding="4" cellspacing="0"> | ||
| <tr><td></td> | ||
| <td align="right">Site=>Source Conversion Factor</td> | ||
| </tr> | ||
| <tr> | ||
| <td align="right">Electricity</td> | ||
| <td align="right"> 3.167</td> | ||
| </tr> | ||
| <tr> | ||
| <td align="right">Natural Gas</td> | ||
| <td align="right"> 1.084</td> | ||
| </tr> | ||
| </table> | ||
| <br><br> | ||
| <b>Building Area</b><br><br> | ||
| <!-- FullName:Annual Building Utility Performance Summary_Entire Facility_Building Area--> | ||
| <table border="1" cellpadding="4" cellspacing="0"> | ||
| <tr><td></td> | ||
| <td align="right">Area [m2]</td> | ||
| </tr> | ||
| <tr> | ||
| <td align="right">None</td> | ||
| <td align="right"></td> | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. New test mod file, I've cleared out the building area table here to represent a size change. |
||
| </tr> | ||
| </table> | ||
| <br><br> | ||
| </body> | ||
| </html> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -54,6 +54,26 @@ def test_skips_some_tables(self): | |
| self.assertEqual(0, response[7]) # in file 2 but not in file 1 | ||
| self.assertEqual(0, response[8]) # in file 1 but not in file 2 | ||
|
|
||
| def test_mod_file_has_empty_table(self): | ||
| response = table_diff( | ||
| self.thresh_dict, | ||
| os.path.join(self.diff_files_dir, 'eplustbl_empty_table_base.htm'), | ||
| os.path.join(self.diff_files_dir, 'eplustbl_empty_table_mod.htm'), | ||
| os.path.join(self.temp_output_dir, 'abs_diff.htm'), | ||
| os.path.join(self.temp_output_dir, 'rel_diff.htm'), | ||
| os.path.join(self.temp_output_dir, 'math_diff.log'), | ||
| os.path.join(self.temp_output_dir, 'summary.htm'), | ||
| ) | ||
| self.assertEqual('', response[0]) # diff status | ||
| self.assertEqual(3, response[1]) # count_of_tables | ||
| self.assertEqual(1, response[2]) # big diffs | ||
| self.assertEqual(0, response[3]) # small diffs | ||
| self.assertEqual(14, response[4]) # equals | ||
| self.assertEqual(0, response[5]) # string diffs | ||
| self.assertEqual(1, response[6]) # size errors | ||
| self.assertEqual(0, response[7]) # in file 2 but not in file 1 | ||
| self.assertEqual(0, response[8]) # in file 1 but not in file 2 | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And the new unit test, noting a size error and also a big diff. |
||
|
|
||
| def test_invalid_file_1(self): | ||
| response = table_diff( | ||
| self.thresh_dict, | ||
|
|
@@ -106,7 +126,7 @@ def test_second_file_missing_a_table(self): | |
| ) | ||
| self.assertEqual('', response[0]) # diff status | ||
| self.assertEqual(3, response[1]) # count_of_tables | ||
| self.assertEqual(0, response[2]) # big diffs | ||
| self.assertEqual(1, response[2]) # big diffs | ||
| self.assertEqual(0, response[3]) # small diffs | ||
| self.assertEqual(14, response[4]) # equals | ||
| self.assertEqual(0, response[5]) # string diffs | ||
|
|
@@ -146,7 +166,7 @@ def test_second_file_has_table_with_different_size(self): | |
| ) | ||
| self.assertEqual('', response[0]) # diff status | ||
| self.assertEqual(3, response[1]) # count_of_tables | ||
| self.assertEqual(0, response[2]) # big diffs | ||
| self.assertEqual(1, response[2]) # big diffs | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test is also sufficient, really, and needed to bump it up to include the big diff. |
||
| self.assertEqual(0, response[3]) # small diffs | ||
| self.assertEqual(14, response[4]) # equals | ||
| self.assertEqual(0, response[5]) # string diffs | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bump version