-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
37 changed files
with
217,982 additions
and
306 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
#!/bin/bash | ||
function version_gt() { test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1"; } | ||
# Check if EnergyPlus env variables exist already. If not use these defaults | ||
if [[ -z "${ENERGYPLUS_VERSION}" ]]; then | ||
export ENERGYPLUS_VERSION=9.2.0 | ||
fi | ||
if [[ -z "${ENERGYPLUS_SHA}" ]]; then | ||
export ENERGYPLUS_SHA=921312fa1d | ||
fi | ||
if [[ -z "${ENERGYPLUS_INSTALL_VERSION}" ]]; then | ||
export ENERGYPLUS_INSTALL_VERSION=9-2-0 | ||
fi | ||
|
||
if [[ "$OSTYPE" == "linux-gnu"* ]]; then | ||
if version_gt $ENERGYPLUS_VERSION 9.3.0; then | ||
export EXT="sh" | ||
export PLATFORM=Linux-Ubuntu18.04 | ||
else | ||
export EXT="sh" | ||
export PLATFORM=Linux | ||
fi | ||
export ATTCHBASE=67022360382 | ||
export ATTCHNUM="multipletransitionidfversionupdater-lin.tar.gz" | ||
elif [[ "$OSTYPE" == "darwin"* ]]; then | ||
if version_gt $ENERGYPLUS_VERSION 9.3.0; then | ||
export EXT=dmg | ||
export PLATFORM=Darwin-macOS10.15 | ||
else | ||
export EXT=dmg | ||
export PLATFORM=Darwin | ||
fi | ||
export ATTCHBASE=67022360547 | ||
export ATTCHNUM="idfversionupdater-macos-v8.4.0.zip" | ||
elif [[ "$OSTYPE" == "win"* || "$OSTYPE" == "msys"* ]]; then | ||
export EXT=zip | ||
export PLATFORM=Windows | ||
export ATTCHBASE=67022360088 | ||
export ATTCHNUM="multipletransitionidfversionupdater-win.zip" | ||
fi | ||
# Download EnergyPlus executable | ||
ENERGYPLUS_DOWNLOAD_BASE_URL=https://github.com/NREL/EnergyPlus/releases/download/v$ENERGYPLUS_VERSION | ||
ENERGYPLUS_DOWNLOAD_FILENAME=EnergyPlus-$ENERGYPLUS_VERSION-$ENERGYPLUS_SHA-$PLATFORM-x86_64 | ||
ENERGYPLUS_DOWNLOAD_URL=$ENERGYPLUS_DOWNLOAD_BASE_URL/$ENERGYPLUS_DOWNLOAD_FILENAME.$EXT | ||
echo "$ENERGYPLUS_DOWNLOAD_URL" | ||
curl --fail -SL -C - "$ENERGYPLUS_DOWNLOAD_URL" -o "$ENERGYPLUS_DOWNLOAD_FILENAME".$EXT | ||
|
||
# Extra downloads | ||
EXTRAS_DOWNLOAD_URL=https://energyplushelp.freshdesk.com/helpdesk/attachments/$ATTCHBASE | ||
curl --fail -SL -C - $EXTRAS_DOWNLOAD_URL -o $ATTCHNUM | ||
|
||
# Install EnergyPlus and Extra Downloads | ||
if [[ "$OSTYPE" == "linux-gnu"* ]]; then | ||
sudo chmod +x "$ENERGYPLUS_DOWNLOAD_FILENAME".$EXT | ||
printf "y\r" | sudo ./"$ENERGYPLUS_DOWNLOAD_FILENAME".$EXT | ||
sudo tar zxvf $ATTCHNUM -C /usr/local/EnergyPlus-"$ENERGYPLUS_INSTALL_VERSION"/PreProcess/IDFVersionUpdater | ||
sudo chmod -R a+rwx /usr/local/EnergyPlus-"$ENERGYPLUS_INSTALL_VERSION"/PreProcess/IDFVersionUpdater | ||
sudo chmod -R a+rwx /usr/local/EnergyPlus-"$ENERGYPLUS_INSTALL_VERSION"/ExampleFiles | ||
# cleanup | ||
sudo rm "$ENERGYPLUS_DOWNLOAD_FILENAME".$EXT | ||
sudo rm $ATTCHNUM | ||
elif [[ "$OSTYPE" == "darwin"* ]]; then | ||
# getting custom install script https://github.com/NREL/EnergyPlus/pull/7615 | ||
curl -SL -C - https://raw.githubusercontent.com/jmarrec/EnergyPlus/40afb275f66201db5305f54df6c070d0b0cb4fc3/cmake/qtifw/install_script.qs -o install_script.qs | ||
sudo hdiutil attach "$ENERGYPLUS_DOWNLOAD_FILENAME".$EXT | ||
sudo /Volumes/"$ENERGYPLUS_DOWNLOAD_FILENAME"/"$ENERGYPLUS_DOWNLOAD_FILENAME".app/Contents/MacOS/"$ENERGYPLUS_DOWNLOAD_FILENAME" --verbose --script install_script.qs | ||
sudo tar zxvf $ATTCHNUM -C /Applications/EnergyPlus-"$ENERGYPLUS_INSTALL_VERSION"/PreProcess | ||
sudo chmod -R a+rwx /Applications/EnergyPlus-"$ENERGYPLUS_INSTALL_VERSION"/PreProcess/IDFVersionUpdater | ||
sudo chmod -R a+rwx /Applications/EnergyPlus-"$ENERGYPLUS_INSTALL_VERSION"/ExampleFiles | ||
# cleanup | ||
sudo rm install_script.qs | ||
sudo rm "$ENERGYPLUS_DOWNLOAD_FILENAME".$EXT | ||
sudo rm $ATTCHNUM | ||
elif [[ "$OSTYPE" == "win"* || "$OSTYPE" == "msys"* ]]; then | ||
# On windows, we are simply extracting the zip file to c:\\ | ||
echo "Extracting and Copying files to... C:\\" | ||
powershell Expand-Archive -Path $ENERGYPLUS_DOWNLOAD_FILENAME.$EXT -DestinationPath C:\\ | ||
powershell Rename-Item -Path c:\\$ENERGYPLUS_DOWNLOAD_FILENAME -NewName EnergyPlusV"$ENERGYPLUS_INSTALL_VERSION" | ||
# extract extra downloads to destination | ||
DEST=C:\\EnergyPlusV"$ENERGYPLUS_INSTALL_VERSION"\\PreProcess\\IDFVersionUpdater | ||
echo "Extracting and Copying files to... $DEST" | ||
powershell Expand-Archive -Path $ATTCHNUM -DestinationPath "$DEST" -Force | ||
# cleanup | ||
rm -v $ENERGYPLUS_DOWNLOAD_FILENAME.$EXT | ||
rm -v $ATTCHNUM | ||
IDD=C:\\EnergyPlusV"$ENERGYPLUS_INSTALL_VERSION"\\Energy+.idd | ||
if [ -f "$IDD" ]; then | ||
echo "$IDD" exists | ||
else | ||
echo "$IDD" does not exist | ||
travis_terminate 1 | ||
fi | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | ||
|
||
name: eppy package | ||
|
||
on: | ||
push: | ||
branches: ["master", "develop" ,] | ||
inputs: | ||
energyplus-version: | ||
description: 'EnergyPlus major.minor.patch version' | ||
required: true | ||
default: 9.2.0 | ||
energyplus-sha: | ||
description: 'EnergyPlus version SHA' | ||
required: true | ||
default: 921312fa1d | ||
energyplus-install: | ||
description: 'EnergyPlus major-minor-patch version' | ||
default: 9-2-0 | ||
required: true | ||
|
||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.11", ] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install pytest==7.1.3 | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
- run: echo Installing EnergyPlusV${{ inputs.energyplus-version }}... | ||
shell: bash | ||
- run: echo "${{ github.action_path }}" >> $GITHUB_PATH | ||
shell: bash | ||
- run: bash .github/workflows/install.sh | ||
shell: bash | ||
env: | ||
ENERGYPLUS_VERSION: ${{ inputs.energyplus-version }} | ||
ENERGYPLUS_SHA: ${{ inputs.energyplus-sha }} | ||
ENERGYPLUS_INSTALL_VERSION: ${{ inputs.energyplus-install }} | ||
|
||
- name: Test with pytest | ||
env: | ||
ENERGYPLUS_VERSION: 9.2.0 | ||
ENERGYPLUS_SHA: ${{ inputs.energyplus-sha }} | ||
ENERGYPLUS_INSTALL_VERSION: 9-2-0 | ||
EPPY_INTEGRATION: TRUE | ||
run: | | ||
pytest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,30 +15,41 @@ | |
|
||
__author__ = """Santosh Philip""" | ||
__email__ = "[email protected]" | ||
__version__ = "0.5.63" | ||
__version__ = "0.5.66" | ||
|
||
|
||
from io import StringIO | ||
import eppy | ||
from eppy import modeleditor | ||
from eppy.modeleditor import IDF | ||
|
||
|
||
def newidf(version=None): | ||
"""open a new idf file | ||
easy way to open a new idf file for particular version. Works only id Energyplus of that version is installed. | ||
easy way to open a new idf file for particular version. Works only if Energyplus of that version is installed. | ||
- newidf(version=None) or newidf() will workif the IDD has already been set | ||
- newidf(version=some_version) will work | ||
- if some_version matches the IDD already set | ||
- OR if no IDD has been set | ||
Parameters | ||
---------- | ||
version: string | ||
version of the new file you want to create. Will work only if this version of Energyplus has been installed. | ||
version of the new file you want to create. Will work only if this version of Energyplus has been installed OR if it matches the IDD already set. | ||
Returns | ||
------- | ||
idf | ||
file of type eppy.modelmake.IDF | ||
""" # noqa: E501 | ||
import eppy.easyopen as easyopen | ||
|
||
if not version: | ||
version = "8.9" | ||
return IDF(StringIO("")) | ||
# return easyopen.easyopen(StringIO("")) | ||
|
||
import eppy.easyopen as easyopen | ||
|
||
idfstring = " Version,{};".format(str(version)) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.