Skip to content

Commit

Permalink
Merge branch 'develop' into feature/ConditioningFix
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelduchesne committed Apr 16, 2020
2 parents 1518e5a + 32fe87c commit 07f53a0
Show file tree
Hide file tree
Showing 9 changed files with 171 additions and 181 deletions.
5 changes: 4 additions & 1 deletion .github/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ template: |
$CONTRIBUTORS
categories:
- title: 'Features'
- title: 'New Features'
labels:
- 'feature'
- 'enhancement'
Expand All @@ -17,5 +17,8 @@ categories:
- 'fix'
- 'bugfix'
- 'bug'
- title: 'Under the hood refactoring ⚙'
labels:
- 'refactoring'
name-template: 'v$NEXT_PATCH_VERSION 🌈'
tag-template: 'v$NEXT_PATCH_VERSION'
116 changes: 44 additions & 72 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,81 +1,53 @@
# Don't use language: python; this gives us an unnecessary virtualenv
language: c

language: python
env:
global:
- ARCHETYPAL_INTEGRATION=True ENERGYPLUS_VERSION=9.2.0 ENERGYPLUS_SHA=921312fa1d ENERGYPLUS_INSTALL_VERSION=9-2-0 MINICONDA_VERSION=latest

- ARCHETYPAL_INTEGRATION=True ENERGYPLUS_VERSION=9.2.0 ENERGYPLUS_SHA=921312fa1d
ENERGYPLUS_INSTALL_VERSION=9-2-0 MINICONDA_VERSION=latest
addons:
apt:
packages:
- wine
- libgfortran3

- wine
- libgfortran3
jobs:
include:
- os: linux
env: TRAVIS_PYTHON_VERSION=3.7
- os: osx
env: TRAVIS_PYTHON_VERSION=3.7

- name: Python 3.8 on Xenial Linux
python: 3.8 # this works for Linux but is ignored on macOS or Windows
script: py.test --cov=archetypal --verbose tests/
after_success:
- coverage report -m
- coveralls
- name: Python 3.8 on macOS
os: osx
osx_image: xcode11.2
language: objective-c
script: py.test --cov=archetypal --verbose tests/
- name: "Python 3.8 on Windows"
os: windows # Windows 10.0.17134 N/A Build 17134
language: shell # 'language: python' is an error on Travis CI Windows
script: py.test --cov=archetypal --verbose tests/
- stage: deploy
script: echo "Deploying to PyPi and GitHub releases ..."
deploy:
- provider: pypi
user: __token__
password:
secure: cVK75OF2LPDNdPuocxRmuWu4XUgdd81kNo5u/zah7XQf0oKW3TqgVSRhp06XYdQlnCSJZMfe8VJuHoBoCETTDdXFYZMIe6OBlSZeg1xclOtg+Wf4s4zkQ7gMSdzlUKJn9zkINUo7NwRn8Q0GGZCvldJvODzR0xDTcmbeVpeG3WHV8GNosYD7xWNscGBYrF3xVB0euLOHkPyJuFlxzpEhW2XFE7bdMk1/4gwOtfUcCgivpok4dWpgITVEdxRhcBI+ea9NDgpKlJfYHdRX9bBTSFoy8qLEQyvGeNG5cFXW3p+XwsPOKVPnEZv1e2nSYk3Od+sNa+45jte5PNkI43FcIdGaZJadUGck5SUQB9dCWFyLHMQgCtJg4fFLfWBHW5xrfxgOWMK5nqn93qbqOJbLrlw52eNimepfb0FksUpgdkLErkSWGvM5vOSK20Vb4nySjht6PJO88VSUixBd7cdGsioz8X0a69WfVVQhIdYlrjO2N0EGXXi3wh4QTp5VywZue3/cVvC5ainjFq8wuLiBg+LLCObwjj++Qp0OKr9Iw00942HpWhWKEZfpuepMowet8KVCE5SYh5lpKXtZv3+YNrkVy6jfzdZiw4QvMs3VAuQxCdNvILI7h/ktXntwdMT2CIUTKbQrX2uvuSuiwUgo6yRWX+5TkmRVCULpz4qE0lY=
on:
distributions: sdist bdist_wheel
repo: samuelduchesne/archetypal
branch: master
tags: true
before_install:
# download EnergyPlus
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then EXT=dmg; PLATFORM=Darwin; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then EXT=sh; PLATFORM=Linux; fi
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then EXT=exe; PLATFORM=Windows; fi
- 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
- curl -SLO $ENERGYPLUS_DOWNLOAD_URL
# download extras
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ATTCHBASE=97; ATTCHNUM=8230; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ATTCHBASE=98; ATTCHNUM=8232; fi
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then ATTCHBASE=86; ATTCHNUM=8231; fi
- EXTRAS_DOWNLOAD_URL=http://energyplus.helpserve.com/Knowledgebase/Article/GetAttachment/$ATTCHBASE/$ATTCHNUM
- curl -SL $EXTRAS_DOWNLOAD_URL -o $ATTCHNUM.zip
# install EnergyPlus
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
sudo chmod +x $ENERGYPLUS_DOWNLOAD_FILENAME.$EXT;
echo "y\r" | sudo ./$ENERGYPLUS_DOWNLOAD_FILENAME.$EXT;
sudo tar zxvf $ATTCHNUM.zip -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; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then
curl -SLO https://raw.githubusercontent.com/NREL/EnergyPlus/3cf5e1c8e6944e8a7760b80078c6945073cc8364/cmake/qtifw/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.zip -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; fi
- if [ "$TRAVIS_OS_NAME" == "windows" ]; then
sudo chmod +x $ENERGYPLUS_DOWNLOAD_FILENAME.$EXT;
echo "y\r" | sudo ./$ENERGYPLUS_DOWNLOAD_FILENAME.$EXT; fi
# remove install files
- sudo rm $ENERGYPLUS_DOWNLOAD_FILENAME.$EXT
- sudo rm $ATTCHNUM.zip

# Install python for Linux and macOS
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then MINICONDA_OS=Linux; else MINICONDA_OS=MacOSX; fi
- wget https://repo.anaconda.com/miniconda/Miniconda3-$MINICONDA_VERSION-$MINICONDA_OS-x86_64.sh -O miniconda.sh
- bash miniconda.sh -b -p "$HOME"/miniconda
- source "$HOME"/miniconda/etc/profile.d/conda.sh

# create and activate environment
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda;
# Useful for debugging any issues with conda
- conda info -a
# new env
- conda env update -q -n test-env python=$TRAVIS_PYTHON_VERSION -f environment.yml
- conda activate test-env

# Main script
- source install_energyplus.sh
- wget https://raw.githubusercontent.com/trichter/conda4travis/latest/conda4travis.sh -O conda4travis.sh
- source conda4travis.sh
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
- conda info -a
- conda env update -q -n test-env python=$TRAVIS_PYTHON_VERSION -f environment.yml
- conda activate test-env
- python --version
install:
- pip install --upgrade setuptools
- pip install --upgrade pip
- pip install .[dev]
script:
- py.test --cov=archetypal --verbose tests/
after_success:
- coverage report -m
- coveralls
- pip install --upgrade pip
- pip install --upgrade setuptools
- pip install .[dev]
83 changes: 0 additions & 83 deletions appveyor.yml

This file was deleted.

9 changes: 7 additions & 2 deletions archetypal/template/building_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def __init__(
Windows=None,
Lifespan=60,
PartitionRatio=0.35,
DefaultWindowToWallRatio=0.4,
**kwargs
):
"""Initialize a :class:`BuildingTemplate` object with the following
Expand All @@ -63,8 +64,11 @@ def __init__(
Lifespan (float): The projected lifespan of the building template in
years. Used in various calculations such as embodied energy.
PartitionRatio (float): The number of lineal meters of partitions
(Floor to ceiling) present in average in the building floor
plan by m2.
(Floor to ceiling) present in average in the building floor plan
by m2.
DefaultWindowToWallRatio (float): The default Window to Wall Ratio
(WWR) for this template (same for all orientations). Number
between 0 and 1.
**kwargs: other optional keywords passed to other constructors.
"""
super(BuildingTemplate, self).__init__(**kwargs)
Expand All @@ -75,6 +79,7 @@ def __init__(
self.Perimeter = Perimeter
self.Structure = Structure
self.Windows = Windows
self.DefaultWindowToWallRatio = DefaultWindowToWallRatio

def __hash__(self):
return hash((self.__class__.__name__, self.Name, self.DataSource))
Expand Down
2 changes: 1 addition & 1 deletion archetypal/template/umi_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def __init__(
self.sql = sql
self.Category = Category
self.Comments = Comments
if DataSource is "":
if DataSource == "":
try:
self.DataSource = self.idf.building_name(use_idfname=True)
except:
Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ def setup(app):
"eppy": ("https://eppy.readthedocs.io/en/latest/", None),
"numpy": ("https://docs.scipy.org/doc/numpy/", None),
"networkx": (
"https://networkx.github.io/documentation/stable" "/index" ".html",
"https://networkx.github.io/objects.inv",
"https://networkx.github.io/documentation/stable/index.html",
"https://networkx.github.io/documentation/stable/objects.inv",
),
"umidocs": ("https://umidocs.readthedocs.io/en/latest/", None),
}
Expand Down
41 changes: 21 additions & 20 deletions docs/converter_bui.rst
Original file line number Diff line number Diff line change
Expand Up @@ -91,56 +91,57 @@ respectively.
4. `OPTIONS`: There are different options to the `convert` command. The first 3 manage the requested output files.
Users can chose to return a combination of flags

- if ``-i`` is added, the path to the modified IDF file is returned in the console, and the modified
IDF file is returned in the output folder. If ``-t`` is added, the path to the T3D file (converted from the IDF file) is returned.
If ``-d`` is added, the DCK file (TRNSYS input file) is returned in the output folder, and the path to this DCK file is returned in the console.
- if ``-i`` is added, the path to the modified IDF file is returned in the console, and the modified IDF file is
returned in the output folder. If ``-t`` is added, the path to the T3D file (converted from the IDF file) is
returned. If ``-d`` is added, the DCK file (TRNSYS input file) is returned in the output folder, and the path to
this DCK file is returned in the console.

.. code-block:: python
archetypal convert -i -t -d "/Users/Documents/NECB 2011 - Warehouse.idf" "/Users/Documents/WIP"
archetypal convert -i -t -d "/Users/Documents/NECB 2011 - Warehouse.idf" "/Users/Documents/CAN_PQ_Montreal.Intl.AP.716270_CWEC.epw" "/Users/Documents/WIP"
- ``--window_lib`` is the path of the window library (W74-lib.dat). This library must be in the same format as the
Berkeley Lab library used by default in TRNBuild. If nothing is passed, the "W74-lib.dat" file available in the
package "ressources" folder will be used.
Berkeley Lab library used by default in TRNBuild. If nothing is passed, the "W74-lib.dat" file available in the
package "ressources" folder will be used.

.. code-block:: python
archetypal convert --window-lib "/Users/Documents/W74-lib.dat" "/Users/Documents/NECB 2011 - Warehouse.idf" "/Users/Documents/WIP"
archetypal convert --window-lib "/Users/Documents/W74-lib.dat" "/Users/Documents/NECB 2011 - Warehouse.idf" "/Users/Documents/CAN_PQ_Montreal.Intl.AP.716270_CWEC.epw" "/Users/Documents/WIP"
- ``--trnsidf_exe`` is the path of the trnsidf.exe executable. Usually located in the TRNSYS18 folder under
"Building/trnsIDF/trnsidf.exe".
If nothing is passed, the following path will be used : "C:TRNSYS18\\Building\\trnsIDF\\trnsidf.exe".
"Building/trnsIDF/trnsidf.exe".
If nothing is passed, the following path will be used : "C:TRNSYS18\\Building\\trnsIDF\\trnsidf.exe".

.. code-block:: python
archetypal convert --trnsidf-exe "C:TRNSYS18\\Building\\trnsIDF\\trnsidf.exe" "/Users/Documents/NECB 2011 - Warehouse.idf" "/Users/Documents/WIP"
archetypal convert --trnsidf-exe "C:TRNSYS18\\Building\\trnsIDF\\trnsidf.exe" "/Users/Documents/NECB 2011 - Warehouse.idf" "/Users/Documents/CAN_PQ_Montreal.Intl.AP.716270_CWEC.epw" "/Users/Documents/WIP"
- ``--template`` is the path of the .d18 template file (usually in the same directory as the `trnsidf.exe` executable).
If nothing is passed, the following path will be used : "C:TRNSYS18\\Building\\trnsIDF\\NewFileTemplate.d18".
If nothing is passed, the following path will be used : "C:TRNSYS18\\Building\\trnsIDF\\NewFileTemplate.d18".

.. code-block:: python
archetypal convert --template "C:TRNSYS18\\Building\\trnsIDF\\NewFileTemplate.d18" "/Users/Documents/NECB 2011 - Warehouse.idf" "/Users/Documents/WIP"
archetypal convert --template "C:TRNSYS18\\Building\\trnsIDF\\NewFileTemplate.d18" "/Users/Documents/NECB 2011 - Warehouse.idf" "/Users/Documents/CAN_PQ_Montreal.Intl.AP.716270_CWEC.epw" "/Users/Documents/WIP"
- ``--log_clear_names`` if added, do not print log of "clear_names" (equivalence between old and new names) in
the console.
the console.

.. code-block:: python
archetypal convert --log-clear-names "/Users/Documents/NECB 2011 - Warehouse.idf" "/Users/Documents/WIP"
archetypal convert --log-clear-names "/Users/Documents/NECB 2011 - Warehouse.idf" "/Users/Documents/CAN_PQ_Montreal.Intl.AP.716270_CWEC.epw" "/Users/Documents/WIP"
- ``--window`` specifies the window properties <u_value (W/m²-K)> <shgc (-)> <t_vis (-)> <tolerance (-)> <fframe (-)> <uframe (kJ/m²-K-h)>.
If nothing is passed, the following values will be used : 2.2 0.65 0.8 0.05 0.15 8.17
If nothing is passed, the following values will be used : 2.2 0.65 0.8 0.05 0.15 8.17

.. code-block:: python
archetypal convert --window 2.2 0.65 0.8 0.05 0.15 8.17 "/Users/Documents/NECB 2011 - Warehouse.idf" "/Users/Documents/WIP"
archetypal convert --window 2.2 0.65 0.8 0.05 0.15 8.17 "/Users/Documents/NECB 2011 - Warehouse.idf" "/Users/Documents/CAN_PQ_Montreal.Intl.AP.716270_CWEC.epw" "/Users/Documents/WIP"
- ``--ordered`` sorts the idf object names

.. code-block:: python
archetypal convert --ordered "/Users/Documents/NECB 2011 - Warehouse.idf" "/Users/Documents/WIP"
archetypal convert --ordered "/Users/Documents/NECB 2011 - Warehouse.idf" "/Users/Documents/CAN_PQ_Montreal.Intl.AP.716270_CWEC.epw" "/Users/Documents/WIP"
- If ``--nonum`` is added, do not renumber surfaces in BUI. If ``--batchjob`` or ``-N`` is added, does BatchJob Modus when running trnsidf.exe.
``--geofloor`` must be followed by a float between 0 and 1, and generates GEOSURF values for distributing direct solar radiation where `geo_floor` % is directed to the floor,
Expand All @@ -149,7 +150,7 @@ Users can chose to return a combination of flags

.. code-block:: python
archetypal convert --nonum -N --geofloor 0.6 --refarea --volume --capacitance "/Users/Documents/NECB 2011 - Warehouse.idf" "/Users/Documents/WIP"
archetypal convert --nonum -N --geofloor 0.6 --refarea --volume --capacitance "/Users/Documents/NECB 2011 - Warehouse.idf" "/Users/Documents/CAN_PQ_Montreal.Intl.AP.716270_CWEC.epw" "/Users/Documents/WIP"
- ``-h`` Shows the "help" message

Expand All @@ -158,8 +159,8 @@ Users can chose to return a combination of flags
archetypal convert -h
.. [#] Archetype: building model representing a type of building based on its geometry, thermal properties and its
usage. Usually used to create urban building model by assigning different archetypes to represent at best the building
stock we want to model.
usage. Usually used to create urban building model by assigning different archetypes to represent at best the
building stock we want to model.
Equivalence between idf object names when converting a file
...........................................................
Expand Down
3 changes: 3 additions & 0 deletions docs/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ in case). You should see something like this:
Install EnergyPlus & Conversion Programs
........................................

Note: To follow this procedure, git must be installed beforehand with default installation parameters.
See https://git-scm.com/downloads to download git.

EnergyPlus is a prerequisite of archetypal. It must be installed beforehand. Moreover, archetypal contains routines that
may download IDF components that are coded in earlier versions of EnergyPlus (e.g., 7.1). For this reason, users should
also download the `supplementary conversion programs`_.
Expand Down
Loading

0 comments on commit 07f53a0

Please sign in to comment.