Skip to content

Commit

Permalink
Merge pull request #108 from NREL/FixWindowHeightOnLinux
Browse files Browse the repository at this point in the history
Window Height Fix and Table Diff String Count Handling
  • Loading branch information
Myoldmopar committed Jun 7, 2024
2 parents b1884bf + 089ace0 commit 7448610
Show file tree
Hide file tree
Showing 21 changed files with 1,265 additions and 46 deletions.
1 change: 1 addition & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ source = energyplus_regressions

[report]
omit =
energyplus_regressions/__main__.py
energyplus_regressions/runner.py
energyplus_regressions/configure.py
energyplus_regressions/tk_window.py
6 changes: 3 additions & 3 deletions .github/workflows/flake8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ on: [push]

jobs:
flake8:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v2

- name: Set up Python 3.8
- name: Set up Python 3.12
uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435 # v4.5.0
with:
python-version: 3.8
python-version: 3.12

- name: Install Pip Dependencies
run: pip install flake8
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ on:

jobs:
release:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v2

- name: Set up Python
uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435 # v4.5.0
with:
python-version: 3.8
python-version: 3.12

- name: Install Pip Dependencies
shell: bash
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@ jobs:
unit_tests:
strategy:
matrix:
os: [ windows-latest, macos-11, ubuntu-20.04, ubuntu-22.04 ] # macos-12 is not playing well with Tk
os: [ windows-latest, macos-11, ubuntu-22.04 ] # macos-12 is not playing well with Tk
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v2
- name: Set up Python 3.8
- name: Set up Python 3.12
uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435 # v4.5.0
with:
python-version: 3.8
python-version: 3.12
- name: Install Pip Dependencies
run: pip install -r requirements.txt
- name: Run Tests
run: nosetests
run: coverage run -m pytest && coverage report
- name: Coveralls
if: ${{ matrix.os == 'ubuntu-22.04' }}
# if: ${{ matrix.os == 'ubuntu-22.04' }}
run: coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 0 additions & 4 deletions MANIFEST.in

This file was deleted.

2 changes: 1 addition & 1 deletion energyplus_regressions/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
NAME = 'energyplus_regressions'
VERSION = '2.0.3'
VERSION = '2.0.4'
3 changes: 3 additions & 0 deletions energyplus_regressions/diffs/ci_compare_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,9 @@ def main_function(file_name, base_dir, mod_dir, base_sha, mod_sha, make_public,
elif entry.table_diffs.small_diff_count > 0:
has_small_diffs = True
print_message("Table small diffs.")
if entry.table_diffs.string_diff_count > 1: # There's always one...the time stamp
has_diffs = True
print_message("Table string diffs.")

if entry.idf_diffs and (entry.idf_diffs.diff_type != TextDifferences.EQUAL):
has_small_diffs = True
Expand Down
7 changes: 4 additions & 3 deletions energyplus_regressions/energyplus.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,10 @@ def execute_energyplus(e_args: ExecutionArguments):
os.environ["DDONLY"] = ""
os.environ["REVERSEDD"] = ""
os.environ["FULLANNUALRUN"] = ""
else:
pass
# nothing
else: # pragma: no cover
# it feel weird to try to test this path...have to set run_type to something invalid?
# should we just eliminate this else?
pass # do nothing?

# use the user-entered minimum reporting frequency
# (useful for limiting to daily outputs for annual simulation, etc.)
Expand Down
10 changes: 7 additions & 3 deletions energyplus_regressions/runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@


class TestRunConfiguration:
__test__ = False # so that PyTest doesn't try to run this as a class fixture

def __init__(self, force_run_type, num_threads, report_freq, build_a, build_b, single_test_run=False,
force_output_sql: ForceOutputSQL = ForceOutputSQL.NOFORCE,
force_output_sql_unitconv: ForceOutputSQLUnitConversion = ForceOutputSQLUnitConversion.NOFORCE):
Expand All @@ -55,6 +57,8 @@ def __init__(self, force_run_type, num_threads, report_freq, build_a, build_b, s


class TestCaseCompleted:
__test__ = False # so that PyTest doesn't try to run this as a class fixture

def __init__(self, run_directory, case_name, run_status, error_msg_reported_already, extra_message=""):
self.run_directory = run_directory
self.case_name = case_name
Expand Down Expand Up @@ -100,10 +104,10 @@ def __init__(self, run_config, these_entries, mute=False):
self.build_tree_b = run_config.buildB.get_build_tree()

# Settings/paths defined relative to this script
self.path_to_file_list = os.path.join(script_dir, "files_to_run.txt")
# self.path_to_file_list = os.path.join(script_dir, "files_to_run.txt")
self.thresh_dict_file = os.path.join(script_dir, 'diffs', "math_diff.config")
self.math_diff_executable = os.path.join(script_dir, "math_diff.py")
self.table_diff_executable = os.path.join(script_dir, "table_diff.py")
# self.math_diff_executable = os.path.join(script_dir, "math_diff.py")
# self.table_diff_executable = os.path.join(script_dir, "table_diff.py")

# Settings/paths defined relative to the buildA/buildB test directories
# the tests directory will be different based on forceRunType
Expand Down
7 changes: 5 additions & 2 deletions energyplus_regressions/structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def __init__(self, args_from_table_diff):
self.big_diff_count = args_from_table_diff[2]
self.small_diff_count = args_from_table_diff[3]
self.equal_count = args_from_table_diff[4]
self.string_diff_count = args_from_table_diff[5]
self.string_diff_count = args_from_table_diff[5] # There's always one...the time stamp
self.size_err_count = args_from_table_diff[6]
self.not_in_1_count = args_from_table_diff[7]
self.not_in_2_count = args_from_table_diff[8]
Expand All @@ -152,7 +152,7 @@ def to_dict(self):
response['big_diff_count'] = self.big_diff_count
response['small_diff_count'] = self.small_diff_count
response['equal_count'] = self.equal_count
response['string_diff_count'] = self.string_diff_count
response['string_diff_count'] = self.string_diff_count # There's always one...the time stamp
response['size_err_count'] = self.size_err_count
response['not_in_1_count'] = self.not_in_1_count
response['not_in_2_count'] = self.not_in_2_count
Expand Down Expand Up @@ -196,6 +196,7 @@ def to_dict(self):


class TestEntry:
__test__ = False # so that PyTest doesn't try to run this as a class fixture

def __init__(self, name_relative_to_testfiles_dir, epw):
self.name_relative_to_testfiles_dir = name_relative_to_testfiles_dir
Expand Down Expand Up @@ -452,6 +453,8 @@ def add_test_entry(self, this_entry):
self.big_table_diffs.add_to_data(this_entry.basename, "table")
elif this_entry.table_diffs.small_diff_count > 0:
self.small_table_diffs.add_to_data(this_entry.basename, "table")
if this_entry.table_diffs.string_diff_count > 1: # There's always one...the time stamp
self.big_table_diffs.add_to_data(this_entry.basename, "table")

# check the textual diffs
text_diff_hash = {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
<!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 18: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>
<td align="right">Design Day Name at Sensible Ideal Loads Peak</td>
</tr>
<tr>
<td align="right">STRING DIFF Total Site Energy</td>
<td align="right"> 100.00</td>
<td align="right"> 0.00</td>
<td align="right"> 0.00</td>
<td align="right"> UNKNOWN</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>
<td align="right"> UNKNOWN</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>
<td align="right"> UNKNOWN</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>
<td align="right"> UNKNOWN</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,105 @@
<!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 18: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>
<td align="right">Design Day Name at Sensible Ideal Loads Peak</td>
</tr>
<tr>
<td align="right">STRING DIFF Total Site Energy</td>
<td align="right"> 100.00</td>
<td align="right"> 0.00</td>
<td align="right"> 0.00</td>
<td align="right"> TUESDAY</td>
</tr>
<tr>
<td align="right">Net Site Energy</td>
<td align="right"> 20000.00</td>
<td align="right"> 0.00</td>
<td align="right"> 0.00</td>
<td align="right"> TUESDAY</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>
<td align="right"> TUESDAY</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>
<td align="right"> TUESDAY</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>
Loading

0 comments on commit 7448610

Please sign in to comment.