-
Notifications
You must be signed in to change notification settings - Fork 18
Fix Numerically-Identical Tables with Different Leading Spaces Causing Div by Zero Errors #120
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.5' | ||
| VERSION = '2.1.6' |
| 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,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> | ||
|
Collaborator
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. These entries have an extra leading space.
Member
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. 👍 |
||
| <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 |
|---|---|---|
|
|
@@ -34,6 +34,26 @@ def test_identical_files(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_files_with_different_spaces(self): | ||
|
Collaborator
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. Copy/paste from test above. |
||
| response = table_diff( | ||
| self.thresh_dict, | ||
| os.path.join(self.diff_files_dir, 'eplustbl_no_diff_different_spaces_base.htm'), | ||
| os.path.join(self.diff_files_dir, 'eplustbl_no_diff_different_spaces_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(0, response[2]) # big diffs | ||
| self.assertEqual(0, response[3]) # small diffs | ||
| self.assertEqual(17, response[4]) # equals | ||
| self.assertEqual(0, response[5]) # string diffs | ||
| self.assertEqual(0, 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 | ||
|
Comment on lines
+48
to
+55
Member
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 completed run and no diffs, excellent. |
||
|
|
||
| def test_skips_some_tables(self): | ||
| response = table_diff( | ||
| self.thresh_dict, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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.
Likely will only ever hit this on
0.0 == 0.0cases, which is fine.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.
Interesting. Are there cases where this can still fall through and be a divide by zero? I guess maybe not because if one was non-zero then the IF/ELSE a couple lines below would catch the right direction? Yeah, it looks good.