diff --git a/energyplus_regressions/__init__.py b/energyplus_regressions/__init__.py index 27b5621..3485064 100644 --- a/energyplus_regressions/__init__.py +++ b/energyplus_regressions/__init__.py @@ -1,2 +1,2 @@ NAME = 'energyplus_regressions' -VERSION = '2.1.5' +VERSION = '2.1.6' diff --git a/energyplus_regressions/diffs/table_diff.py b/energyplus_regressions/diffs/table_diff.py index c509270..6930d1b 100755 --- a/energyplus_regressions/diffs/table_diff.py +++ b/energyplus_regressions/diffs/table_diff.py @@ -100,6 +100,8 @@ def thresh_abs_rel_diff(abs_thresh: float, rel_thresh: float, x: str, y: str) -> try: fx = float(x) fy = float(y) + if fx == fy: + return 0, 0, 'equal' abs_diff = abs(fx - fy) rel_diff = abs((fx - fy) / fx) if abs(fx) > abs(fy) else abs((fy - fx) / fy) diff = 'equal' diff --git a/energyplus_regressions/tests/diffs/tbl_resources/eplustbl_no_diff_different_spaces_base.htm b/energyplus_regressions/tests/diffs/tbl_resources/eplustbl_no_diff_different_spaces_base.htm new file mode 100644 index 0000000..dfac1a1 --- /dev/null +++ b/energyplus_regressions/tests/diffs/tbl_resources/eplustbl_no_diff_different_spaces_base.htm @@ -0,0 +1,100 @@ + + +
+Program Version:EnergyPlus, Version 9.0.1-a7c9cc14ce, YMD=2018.11.20 17:26
+Tabular Output Report in Format: HTML
+Building: Bldg
+Environment: DENVER CENTENNIAL ANN CLG 1% CONDNS DB=>MWB **
+Simulation Timestamp: 2018-11-20 + 17:26:37
+Report: Annual Building Utility Performance Summary
+For: Entire Facility
+Timestamp: 2018-11-20 + 17:26:37
+Values gathered over 0.00 hours| + | Total Energy [GJ] | +Energy Per Total Building Area [MJ/m2] | +Energy Per Conditioned Building Area [MJ/m2] | +
| Total Site Energy | +0.00 | +0.00 | +0.00 | +
| Net Site Energy | +0.00 | +0.00 | +0.00 | +
| Total Source Energy | +0.00 | +0.00 | +0.00 | +
| Net Source Energy | +0.00 | +0.00 | +0.00 | +
| + | Site=>Source Conversion Factor | +
| Electricity | +3.167 | +
| Natural Gas | +1.084 | +
| + | Area [m2] | +
| Total Building Area | +232.26 | +
| Net Conditioned Building Area | +232.26 | +
| Unconditioned Building Area | +0.00 | +
Program Version:EnergyPlus, Version 9.0.1-a7c9cc14ce, YMD=2018.11.20 17:26
+Tabular Output Report in Format: HTML
+Building: Bldg
+Environment: DENVER CENTENNIAL ANN CLG 1% CONDNS DB=>MWB **
+Simulation Timestamp: 2018-11-20 + 17:26:37
+Report: Annual Building Utility Performance Summary
+For: Entire Facility
+Timestamp: 2018-11-20 + 17:26:37
+Values gathered over 0.00 hours| + | Total Energy [GJ] | +Energy Per Total Building Area [MJ/m2] | +Energy Per Conditioned Building Area [MJ/m2] | +
| Total Site Energy | +0.00 | +0.00 | +0.00 | +
| Net Site Energy | +0.00 | +0.00 | +0.00 | +
| Total Source Energy | +0.00 | +0.00 | +0.00 | +
| Net Source Energy | +0.00 | +0.00 | +0.00 | +
| + | Site=>Source Conversion Factor | +
| Electricity | +3.167 | +
| Natural Gas | +1.084 | +
| + | Area [m2] | +
| Total Building Area | +232.26 | +
| Net Conditioned Building Area | +232.26 | +
| Unconditioned Building Area | +0.00 | +