Skip to content

Commit

Permalink
Merge 3c9ae01 into 6382334
Browse files Browse the repository at this point in the history
  • Loading branch information
Myoldmopar committed Oct 22, 2020
2 parents 6382334 + 3c9ae01 commit 9c53ad1
Show file tree
Hide file tree
Showing 52 changed files with 2,857 additions and 2,985 deletions.
12 changes: 3 additions & 9 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
[run]
source =
epregressions
[report]
omit =
/usr/*
.tox/*
*/.pyenv/*
*/virtualenv/*
*/virtualenvs/*
epregressions/try_treeview.py
epregressions/runner.py
epregressions/tk_window.py
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,16 @@ epregressions/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
deploy
eplus_regression_runner.spec
cover/
runner.spec
111 changes: 77 additions & 34 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,79 @@
os: linux
language: python
virtualenv:
system_site_packages: true

addons:
apt:
packages:
- xvfb
- python-gi
- python-gi-cairo
- python3-gi
- python3-gi-cairo
- gir1.2-gtk-3.0

install:
- pip install --upgrade pip
- pip install -r requirements.txt

matrix:
jobs:
include:
- name: "Python 2 Unit Test"
python: 2.7
env: TEST_COMMAND=test
- name: "Python 3 Unit Tests"
python: 3.5
env: TEST_COMMAND=test
- name: "Python 3 Code Quality"
python: 3.5
env: TEST_COMMAND=flake8

script:
- xvfb-run coverage run setup.py $TEST_COMMAND
- os: linux
name: Ubuntu 18.04 Tests
env: BUILD=UBUNTU18
dist: bionic
language: python
python: 3.6
before_script: pip3 install -r requirements.txt
script: nosetests
before_deploy: ./scripts/build.sh Ubuntu18
- os: linux
name: Ubuntu 20.04 Tests (with coverage)
env: BUILD=UBUNTU20
dist: focal
language: python
python: 3.6
before_script: pip3 install -r requirements.txt
script: nosetests --with-coverage --cover-package epregressions # --cover-html for local html results
after_script: coveralls
before_deploy: ./scripts/build.sh Ubuntu20
after_success: coveralls
- os: osx
name: Mac 10.15 Tests
env: BUILD=MAC
osx_image: xcode11.4
before_script: pip3 install --user -r requirements.txt
script: "/Users/travis/Library/Python/3.7/bin/nosetests"
before_deploy: ./scripts/build.sh Mac
- os: windows
name: Windows Tests
env: BUILD=WINDOWS PATH=/c/Python36:/c/Python36/Scripts:$PATH
language: cpp
before_script:
- choco install 7zip
- choco install python --version 3.6.8
- pip3 install -r requirements.txt
script: nosetests
before_deploy: ./scripts/build.sh Windows
- os: linux
name: Flake8
env: BUILD=FLAKE8
dist: bionic
language: python
python: 3.6
before_script: pip3 install -r requirements.txt
script: flake8 epregressions
- os: linux
name: PyPi Packaging
dist: focal
env: BUILD=PYPI
language: python
python: 3.6
before_script: pip3 install -r requirements.txt
script: python3 setup.py bdist_wheel sdist

after_success:
- test $TEST_COMMAND = "test" && coveralls
deploy:
- provider: releases
api_key:
secure: dtm5qvOwBnYI37k0X5bQ1tJweOs5UTV65vv1vGa+TaU8eAE1KHmTIhNedZg7aRWYSpLRz/hdhGPjVBxid7VIvtIqFI4HX6wJ9Mf6aFL6uoFM5mUhtBrBo7TkcYG+oSQ5eftCDVO0449iKi0mzXgfl5szNXns1/VthK15+MGBQr12hNu+l0aWG3gWyweUnpJ3x4nORXU01v3yLTl+4J/UNOBzJvziXNub/7idF+v//hsoesLJuwKUjUBRmCackTFEiO/t9Atr4fMbI9Fksd+8TBaYplwz6ZwqKKtI1itrAe9af2PRTic7ZWmLI36U5KrGkH6yERFY2MAOgwHmirlkKfPknW1zLxaBMtgimdMhM9iVhNShC6+D1OpwFxiQEleQvS7ASFGLHeBuK2YK5QTH/4e9j1hGcaIrBg/J3JCPr9EYcqS2shUu0DxOyfQzI/M5vWDcY/suwZb0hijqXYDg9T+qIxdmlzV7RFwj6cSsVKvpLJSoAgZmoEAruze+iCp4jKdP/mEyvslbcLYt4MeGv8BydcX6jaLTgqMFYg3cZuWKATT6KVc6DaaL+Ptc5kIhw7GHMfkFyVe9lRAKiDDvvV1VIrnSyYcJ1m+i5XdSe5/IeCMuj0aTx1iTa0gi4CoKLIdWYvAbbGGjj9s8VT7nxH4c4WPosKabPyM1pt7MDPk=
file_glob: true
file: deploy/*
skip_cleanup: true # remove later when Travis DPL2 becomes default, it will default to not cleaning up
overwrite: true
on:
tags: true
repo: NREL/EnergyPlusRegressionTool
condition: $BUILD != PYPI
- provider: pypi
skip_cleanup: true # remove later when Travis DPL2 becomes default, it will default to not cleaning up
upload_docs: false
username: Myoldmopar
distributions: sdist bdist_wheel
password:
secure: "OuBZMCgJ3LZerXhE/Zvp3Qy6adpkyRo0GKR+ZSt28ggna3T3Ejd2y+GNdeJxqx05UCPfSJVuH4bqs0ILDXf8TzwyAWCRhQvZNZOR/vhWMha/zvx5czGrqUEgm+YdmxUsCTIUBIoFdn5He1C4e5qQ49Epn5o0EK6OrBfYoTu/hT5sP054WByX3u2VPL31gtQ9wyOOG85bBY2obl7tA0M/rdP2Xg28PyxhdSQLbfIz28r7ud/8+jfuFoDD2MWYrr97lPD4vVuf7tUWfSnRf5sVS+i0brOQI0g48nTuKd7WLYEqRj0jEDxAAaBwt3ZS90EH4Y7164TIjT2GwfmTB65Ev6QNeKlLX9JjyVSjOdjglKXFrcDPXqgvVxCJ36ds37q2iUaqIqIKFePamWp5cfHV/7VT4hEasc28G9HM6KXtLIjm+85fRn+v2/5+R7l4Pv6En+b9BkrTKu5GU/DvV7/BMMhS/4I5CBar1B7oeFQh6XmWtSWv3oglwb5nGzp1j9HHy0Uhda0FXLlHEOdvToeabpHnCoOMLK4Un+QPBwjrve+DOVUkD1Iy9a4CpE4cV3v5C+JYiKYOPRtt08CVAot7/gTZUAzARJZDFOd4IjvT7fhxU+OhDpxzh3IA5iXijqaqm/4geWzzS3cJrnASUuarE9TpysispFRQW7GEVE20GXw="
on:
tags: true
repo: NREL/EnergyPlusRegressionTool
condition: $BUILD = PYPI
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
recursive-include epregressions *.config
121 changes: 23 additions & 98 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,121 +6,46 @@

## Overview

This library is provides tools for performing regressions between EnergyPlus builds.
This library provides tools for performing regressions between EnergyPlus builds.
Developers often propose changes to EnergyPlus for:

- New feature development
- Defect repair
- Refactoring for structure or performance
- etc.

When a developer proposes these changes, they must be tested.
The continuous integration system over on EnergyPlus handles this, and provides results, but there can be a long time delay waiting on those results, depending on how busy CI is at that moment.
This tool provides a way to run these regressions locally.
In addition, because this tool isn't intermingled with the CI structure, enhancements to the regression analysis can be added quickly to this tool to provide developers with more information.
These can be rolled upstream into the CI code, but must be done with much more care to avoid breaking CI.
When a developer proposes these changes, those code changes must be tested prior to accepting them into the main branch.
A continuous integration system runs the tests and provides results, but there can be a sometimes lengthy delay waiting on those results, depending on how busy the system is at that time.
This set of tools provides a way to run these regressions locally.

## Platform Support
## Usage

This tool is written to be functional on all three major platforms, but Windows and Mac have known issues.
On Windows the multiprocessing code does not work, causing the runs to be executed serially, which means a long testing time.
On Mac there are a number of theme icons missing, causing the results tab to appear to be empty after a run, when in fact the icons are there just not rendered.
This tool works on all three major platforms: Windows, Mac, and Ubuntu LTS (18.04 and 20.04).
Travis runs tests on all the platforms, and it is regularly used on all three as well.

In general, this tool works amazingly well on Ubuntu 18.04.
And it is super easy to set up an EnergyPlus build development environment on Ubuntu.
So if at all possible, use this platform, in a VM or whatever, to use this tool.
I'll keep pushing on the tool on all these platforms, but my focus will always be on Ubuntu for the time being.

## Installation

For setting up a development environment to actually _work_ on this tool, see the next section.
If you are not interested in _developing_ this tool, and only looking to _use_ it for your EnergyPlus work, read on here.

For this case, the dependencies for this tool are typically installed into the _system_ Python 3 installation, and this _system_ Python 3 is used to execute the program.
Instructions for this are actually really simple, and follow a few steps for each platform:
- Install Python
- Install GTK/PyGTK
- Clone the regression repo
- Install regression dependencies
- Run the regression tool

### Ubuntu

These are based on a fresh new installation of Ubuntu 18.04.
If you are on a different distribution or version, or you are installing into a system that already has other dependencies installed, your mileage will vary.

So, starting with Ubuntu 18.04:

- Follow the [PyGObject install instructions page](https://pygobject.readthedocs.io/en/latest/getting_started.html) and install the GObject dependencies:
- `sudo apt-get install python-gi python-gi-cairo python3-gi python3-gi-cairo gir1.2-gtk-3.0`
- Optionally test this: run `python3` and try to execute `import gi`. It should just do it without error. Press `ctrl-d` to exit.
- Install a couple other dependencies that we'll use in the next steps:
- `sudo apt-get install git python3-pip`
- Download the regression tool and install python dependencies:
- `git clone https://github.com/NREL/EnergyPlusRegressionTool`
- `cd EnergyPlusRegressionTool`
- `pip3 install -r requirements.txt`
- Optionally test this: run `python3 eplus_regression_runner`. It should run the GUI. Close it.
- Install the program into your applications:
- `python3 epregressions/install_desktop`

You should now be able to press the "Windows key" on your keyboard, start typing EnergyPl.., and it will find the tool and you can press enter, as shown here:

![ActivitiesSearchImage](/media/activities_search.png?raw=true "ActivitiesSearchImage")

You can then right click on the icon in the taskbar and save it as a favorite to reopen anytime.

![AddToFavorites](/media/add_to_favorites.png?raw=true "AddToFavorites")

Then to get an update to the program, then only thing you have to do is update your clone:

- `cd EnergyPlusRegressionTool`
- `git pull`

In the rare event that a dependency has changed, you may have to re-run the `pip` install command, but specific instructions will be offered if that happens.

### Windows

This was tested on Windows 7, and thanks to the PyGI packaging, it's not too hard.
You just need to make sure you have a valid version of Python and then install PyGI into it.

- Download and install a **valid** Python version from Python.org:
- **Valid Versions**: Up to 3.4, not newer, 32-or-64-bit)
- https://www.python.org/downloads/windows/
- Then grab the PyGI installer from here:
- https://sourceforge.net/projects/pygobjectwin32/
- During that install:
- Select your Python 3.4 installation folder
- Select the GTK+ entry in the first list
- That Python version will now have PyGTK in it.
- Next you need to get the regression tool.
- The easiest way to do this is to get it using Git, which is also convenient because you'll be able to pull down updates using a Git Pull.
- Find a place to clone it on your machine, and do it:
- `git clone https://github.com/NREL/EnergyPlusRegressionTool`
- Change into that directory:
- `cd EnergyPlusRegressionTool`
- Install the dependencies for the Regression tool using Pip:
- `C:\Python34\Scripts\pip3.exe install -r requirements.txt`
- Run the tool!
- `C:\Python34\python.exe eplus_regression_runner`
There are two ways to install this tool:
- Download a pre-built (by Travis) binary package
- Downloaded from the Github release [page](https://github.com/NREL/EnergyPlusRegressionTool/releases/latest).
- The user should not need any extra tools, including Python itself.
- The downloaded package should be extracted and then the extracted binary should be run directly.
- Install the library into an existing Python install from [Pypi](https://pypi.org/project/EnergyPlusRegressionTool/1.8.7/)
- Download using Pip (`pip install energyplusregressiontool`).
- Obviously the user will need the existing Python install, but other dependencies are automatically installed by Pip.
- Once installed into the Python install, there will be a binary available to run: `eplus_regression_runner`.

## Development

For the case of developing this tool, you should start by installing the dependencies listed in the installation section.
Then you will generally set up a separate Python environment to install the dependencies so you don't mess with the _system_ Python.
This gets a bit trickier than usual though because of the interplay between the system level dependencies installed with apt and the virtual environment isolation.
The instructions over on GObject's website are perfect.
I was skeptical because I have struggled with this in the past, but in this case, they work great.
So follow the instructions here: https://pygobject.readthedocs.io/en/latest/devguide/dev_environ.html#devenv
For setting up a development environment to do _work_ on this tool, the steps are pretty minimal:
- Install Python, if needed
- Clone this repository (`git clone https://github.com/NREL/EnergyPlusRegressionTool`)
- Install dependencies (`pip3 install -r requirements.txt`)

## Documentation

Further program documentation, including user guide and typical workflows, are available in the documentation.
Program documentation, including user guide and typical workflows, are available in the documentation.
This documentation is written using RST with Sphinx, and published on [ReadTheDocs](https://energyplusregressiontool.readthedocs.io/en/latest/).

## Testing

Exhaustive unit tests have been added to the codebase.
The "underneath the hood" code, like the functions that calculate diffs and run builds, are fully tested.
A major chunk of the GUI code itself has been unit tested, but that's difficult to do, so it's not so exhaustive.
Exhaustive unit tests have been added to the "underneath the hood" code, like the functions that calculate diffs and run builds.
The unit tests are run by [Travis](https://travis-ci.org/NREL/EnergyPlusRegressionTool).
The GUI code is not unit tested, but tested routinely on all platforms.
Binary file modified docs/Images/ScreenShotFirstOpen.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/Images/ScreenshotLog.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/Images/ScreenshotSummary.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9c53ad1

Please sign in to comment.