Skip to content

Commit

Permalink
Merge pull request #99 from NREL/PolishingAgain
Browse files Browse the repository at this point in the history
Polishing again
  • Loading branch information
Myoldmopar authored Mar 2, 2023
2 parents e24dda7 + 415ba30 commit 0a788cf
Show file tree
Hide file tree
Showing 140 changed files with 92 additions and 87 deletions.
6 changes: 3 additions & 3 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[run]
source = epregressions
source = energyplus_regressions

[report]
omit =
epregressions/runner.py
epregressions/tk_window.py
energyplus_regressions/runner.py
energyplus_regressions/tk_window.py
2 changes: 1 addition & 1 deletion .github/workflows/flake8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ jobs:
run: pip install flake8

- name: Run Flake8
run: flake8 epregressions
run: flake8 energyplus_regressions
22 changes: 11 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,29 @@
tex_docs
Pipfile
*.lock
epregressions/files_to_run.json
epregressions/files_to_run.txt
energyplus_regressions/files_to_run.json
energyplus_regressions/files_to_run.txt
docs/_build
venv
.python-version
.coverage
EnergyPlusRegressionTool.egg-info
aa_testSuite_error.txt
htmlcov
epregressions/tests/diffs/results.json
energyplus_regressions/tests/diffs/results.json
.DS_Store
results.json
.eggs
build
dist
/epregressions/tests/resources/epmacro.spec
/epregressions/tests/resources/expandobjects.spec
/epregressions/tests/resources/parametric.spec
/epregressions/tests/resources/readvars.spec
/epregressions/tests/resources/slab.spec
/epregressions/tests/resources/energyplus.spec
/epregressions/tests/resources/basement.spec
/energyplus_regressions/tests/resources/epmacro.spec
/energyplus_regressions/tests/resources/expandobjects.spec
/energyplus_regressions/tests/resources/parametric.spec
/energyplus_regressions/tests/resources/readvars.spec
/energyplus_regressions/tests/resources/slab.spec
/energyplus_regressions/tests/resources/energyplus.spec
/energyplus_regressions/tests/resources/basement.spec
deploy
eplus_regression_runner.spec
energyplus_regression_runner.spec
cover/
runner.spec
4 changes: 2 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
recursive-include epregressions *.config
recursive-include epregressions *.png
recursive-include energyplus_regressions *.config
recursive-include energyplus_regressions *.png
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ To install the tool, simply `pip` install it into your Python environment (eithe
The project page on PyPi is: https://pypi.org/project/EnergyPlusRegressionTool/.

- Download using Pip (`pip install energyplusregressiontool`).
- Once installed into the Python install, there will be a binary available to run: `eplus_regression_runner`.
- Once installed into the Python install, there will be a binary available to run: `energyplus_regression_runner`.

## Development

Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
language = 'en'

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
Expand Down
2 changes: 1 addition & 1 deletion docs/run_cli.rst
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ usage of the script is available here:

::

$ ./epregressions/runtests.py --help
$ ./energyplus_regressions/runtests.py --help
usage: runtests.py [-h] [-a] [-b] [-f {DD,Annual}] [-j J] [-t]
a_src a_build b_src b_build idf_list_file

Expand Down
4 changes: 2 additions & 2 deletions docs/run_gui.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ Starting the GUI program will depend on how the package is installed/downloaded.
- Downloaded binary from Github release page:
- In this case, the user will simply run the downloaded binary
- Installed via Pip:
- In this case, a binary (`eplus_regression_runner`) will be installed with the package that will allow running the GUI
- In this case, a binary (`energyplus_regression_runner`) will be installed with the package that will allow running the GUI
- Cloned the repo for development:
- In this case, the user will run the `epregressions/runner.py` script at the root of the repo
- In this case, the user will run the `energyplus_regressions/runner.py` script at the root of the repo

In some cases, a command window is launched prior to showing the graphical interface.
This can be ignored. When the GUI launches, it should look similar to this figure.
Expand Down
1 change: 1 addition & 0 deletions energyplus_regressions/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VERSION = '1.9.9'
4 changes: 4 additions & 0 deletions energyplus_regressions/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from energyplus_regressions.runner import main_gui


main_gui()
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ def down_select_idf_list(self):
if len(idf_list) <= self.config.random: # just take all of them
pass
else: # down select randomly
indeces_to_take = sorted(random.sample(range(len(idf_list)), self.config.random))
idf_list = [idf_list[i] for i in indeces_to_take]
indexes_to_take = sorted(random.sample(range(len(idf_list)), self.config.random))
idf_list = [idf_list[i] for i in indexes_to_take]
# return the trimmed list
self.selected_input_file_set = idf_list
return idf_list
Expand Down Expand Up @@ -240,7 +240,7 @@ def my_print(self, msg): # pragma: no cover
args = parser.parse_args()

# these were originally inputs, but that is really bulky
# they are now hardwired and can be manipulated outside of the script if needed
# they are now hardwired and can be manipulated outside the script if needed
args.master_data_file = os.path.join(script_dir, "full_file_set_details.csv")
args.output_file = os.path.join(script_dir, "files_to_run.json")

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os

from epregressions.builds.base import BaseBuildDirectoryStructure
from epregressions.ep_platform import exe_extension
from energyplus_regressions.builds.base import BaseBuildDirectoryStructure
from energyplus_regressions.ep_platform import exe_extension


class EPlusInstallDirectory(BaseBuildDirectoryStructure):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os

from epregressions.builds.base import BaseBuildDirectoryStructure
from epregressions.ep_platform import exe_extension
from energyplus_regressions.builds.base import BaseBuildDirectoryStructure
from energyplus_regressions.ep_platform import exe_extension


class CMakeCacheMakeFileBuildDirectory(BaseBuildDirectoryStructure):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os

from epregressions.builds.base import BaseBuildDirectoryStructure
from energyplus_regressions.builds.base import BaseBuildDirectoryStructure


class CMakeCacheVisualStudioBuildDirectory(BaseBuildDirectoryStructure):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
import sys
from datetime import datetime

# add the root of the repo to the python path so it can find things relative to it like the epregressions package
# add the root of the repo to the python path so it can find things relative to it
# like the energyplus_regressions package
from os.path import dirname, realpath

sys.path.append(os.path.join(dirname(realpath(__file__)), '..', '..'))

from epregressions.builds.install import EPlusInstallDirectory
from epregressions.runtests import SuiteRunner, TestRunConfiguration, TestEntry
from epregressions.structures import ForceRunType, ReportingFreq
from epregressions.structures import TextDifferences
from energyplus_regressions.builds.install import EPlusInstallDirectory
from energyplus_regressions.runtests import SuiteRunner, TestRunConfiguration
from energyplus_regressions.structures import ForceRunType, ReportingFreq, TextDifferences, TestEntry


def get_diff_files(out_dir):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@
import os
import sys

from epregressions.diffs import mycsv
from epregressions.diffs.thresh_dict import ThreshDict
from energyplus_regressions.diffs import mycsv
from energyplus_regressions.diffs.thresh_dict import ThreshDict

help_message = __doc__

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def transpose2d(mtx):
[3,6]
]
"""
trmtx = [[] for i in mtx[0]]
trmtx = [[] for _ in mtx[0]]
for i in range(len(mtx)):
for j in range(len(mtx[i])):
trmtx[j].append(mtx[i][j])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
import os.path

from bs4 import BeautifulSoup, NavigableString, Tag
from epregressions.diffs.thresh_dict import ThreshDict
from energyplus_regressions.diffs.thresh_dict import ThreshDict

help_message = __doc__

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import shutil
import subprocess

from epregressions.structures import ForceRunType
from energyplus_regressions.structures import ForceRunType

path = os.path.dirname(__file__)
script_dir = os.path.abspath(path)
Expand All @@ -24,7 +24,7 @@ def __init__(self, build_tree, entry_name, test_run_directory,

# noinspection PyBroadException
def execute_energyplus(e_args: ExecutionArguments):
# setup a few paths
# set up a few paths
energyplus = e_args.build_tree['energyplus']
basement = e_args.build_tree['basement']
idd_path = e_args.build_tree['idd_path']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ Comment=An EnergyPlus test suite utility
Exec={PATH_TO_PYTHON} {RUNNER_SCRIPT}
Icon={ICON_PATH}
Terminal=false
StartupWMClass=eplus_regression_runner
StartupWMClass=energyplus_regression_runner
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


def main_gui():
from epregressions.tk_window import MyApp
from energyplus_regressions.tk_window import MyApp
app = MyApp()
app.run()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@

from difflib import unified_diff # python's own diff library

from epregressions.diffs import math_diff, table_diff, thresh_dict as td
from epregressions.energyplus import ExecutionArguments, execute_energyplus
from epregressions.structures import (
from energyplus_regressions.diffs import math_diff, table_diff, thresh_dict as td
from energyplus_regressions.energyplus import ExecutionArguments, execute_energyplus
from energyplus_regressions.structures import (
ForceRunType,
TextDifferences,
EndErrSummary,
Expand Down Expand Up @@ -1224,7 +1224,7 @@ def interrupt_please(self): # pragma: no cover


if __name__ == "__main__": # pragma: no cover
from epregressions.builds.makefile import CMakeCacheMakeFileBuildDirectory
from energyplus_regressions.builds.makefile import CMakeCacheMakeFileBuildDirectory

# parse command line arguments
parser = argparse.ArgumentParser(
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import tempfile
import unittest

from epregressions.builds.base import BaseBuildDirectoryStructure, autodetect_build_dir_type, KnownBuildTypes
from energyplus_regressions.builds.base import BaseBuildDirectoryStructure, autodetect_build_dir_type, KnownBuildTypes


class TestAutoDetectBuildType(unittest.TestCase):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import tempfile
import unittest

from epregressions.builds.install import EPlusInstallDirectory
from energyplus_regressions.builds.install import EPlusInstallDirectory


class TestEPInstallBuildMethods(unittest.TestCase):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import tempfile
import unittest

from epregressions.builds.makefile import CMakeCacheMakeFileBuildDirectory
from energyplus_regressions.builds.makefile import CMakeCacheMakeFileBuildDirectory


class TestMakefileBuildMethods(unittest.TestCase):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import tempfile
import unittest

from epregressions.builds.visualstudio import CMakeCacheVisualStudioBuildDirectory
from energyplus_regressions.builds.visualstudio import CMakeCacheVisualStudioBuildDirectory


class TestVisualStudioBuildMethods(unittest.TestCase):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
except ImportError:
from io import StringIO # Python 3, will use unicode based overridden stdout

from epregressions.diffs.ci_compare_script import cleanup, get_diff_files, main_function, print_message, process_diffs
from epregressions.runtests import TestEntry
from epregressions.structures import MathDifferences
from energyplus_regressions.diffs.ci_compare_script import cleanup, get_diff_files, main_function, print_message, \
process_diffs
from energyplus_regressions.runtests import TestEntry
from energyplus_regressions.structures import MathDifferences


@contextmanager
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import tempfile
import unittest

from epregressions.diffs.math_diff import math_diff, DuplicateHeaderException
from epregressions.diffs.thresh_dict import ThreshDict
from energyplus_regressions.diffs.math_diff import math_diff, DuplicateHeaderException
from energyplus_regressions.diffs.thresh_dict import ThreshDict


class TestMathDiff(unittest.TestCase):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import tempfile
import unittest

from epregressions.diffs.mycsv import (
from energyplus_regressions.diffs.mycsv import (
MyCsv,
BadInput,
BadMatrice,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
import tempfile
import unittest

from epregressions.diffs.table_diff import table_diff
from epregressions.diffs.thresh_dict import ThreshDict
from energyplus_regressions.diffs.table_diff import table_diff
from energyplus_regressions.diffs.thresh_dict import ThreshDict


class TestMathDiff(unittest.TestCase):
class TestTableDiff(unittest.TestCase):

def setUp(self):
self.cur_dir_path = os.path.dirname(os.path.realpath(__file__))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import tempfile
import unittest

from epregressions.diffs.thresh_dict import ThreshDict
from energyplus_regressions.diffs.thresh_dict import ThreshDict


class TestThreshDict(unittest.TestCase):
Expand Down Expand Up @@ -64,7 +64,7 @@ def test_lookup(self):
self.assertTupleEqual((0.0, 0.0), t.lookup('My Variable Name {Hourly}'))
self.assertTupleEqual((8640, 0.005), t.lookup('My Variable Name [J]{Daily}'))

# check some that don't exist in the list - first call it and it will use the natural default
# check some that don't exist in the list - first call it, and it will use the natural default
self.assertTupleEqual((0.0, 0.0), t.lookup('My Variable Name [Q]{Daily}'))
# then add a global default to the list of thresholds and retry - it will use the user-defined default
t.thresholds['*|*'] = (2, 2)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ These are extremely lightweight executable scripts that mimic the actual E+ tool
There are also other files in here such as example weather files and E+ run files.

The windows versions of these are prebuilt using pyinstaller and placed in the `dist/` directory
To rebuild them, ensure you have pyinstaller on Windows, change dir into the `epregressions/tests/resources` directory, and run:
To rebuild them, ensure you have pyinstaller on Windows, change dir into the `energyplus_regressions/tests/resources` directory, and run:

```
PYTHONPATH=. ../../../venv/Scripts/pyinstaller.exe --onefile --log-level=WARN -n basement dummy.basement.py
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import tempfile
import unittest

from epregressions.build_files_to_run import CsvFileEntry, FileListBuilder, FileListBuilderArgs
from energyplus_regressions.build_files_to_run import CsvFileEntry, FileListBuilder, FileListBuilderArgs


class TestCsvFileEntry(unittest.TestCase):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import tempfile
import unittest

from epregressions.energyplus import ExecutionArguments, execute_energyplus
from epregressions.structures import ReportingFreq, ForceRunType
from energyplus_regressions.energyplus import ExecutionArguments, execute_energyplus
from energyplus_regressions.structures import ReportingFreq, ForceRunType


class TestEnergyPlus(unittest.TestCase):
Expand Down
Loading

0 comments on commit 0a788cf

Please sign in to comment.