Skip to content

Commit

Permalink
Merge pull request #58 from urbanopt/develop
Browse files Browse the repository at this point in the history
Prep 0.1.0
  • Loading branch information
nllong authored Apr 1, 2020
2 parents ce8f038 + 18cb0f7 commit 89e1738
Show file tree
Hide file tree
Showing 75 changed files with 4,461 additions and 710 deletions.
2 changes: 1 addition & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ source =
[report]
omit =
geojson_modelica_translator/cli.py

# Regexes for lines to exclude from consideration
exclude_lines =
# Have to re-enable the standard pragma
Expand Down
15 changes: 15 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!--Fill in the following information detailing the issue. Make sure to not disclose protected data (e.g. passwords). Screenshots are helpful.-->

### Expected Behavior

### Actual Behavior

### Steps to Reproduce

### Version Information

<!--If appropriate, fill in the versions of the dependencies that may be causing the issue.-->

Modelica Buildings Library: `7.0.0 or GithubBranch/SHA (e.g., issue1437_district_heating_cooling /SHA_XYZ)`
TEASER: `URBANopt/0.6.9`
Python: `3.6.5`
5 changes: 5 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#### Any background context you want to provide?
#### What does this PR accomplish?
#### How should this be manually tested?
#### What are the relevant tickets?
#### Screenshots (if appropriate)
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ downloads/
eggs/
.eggs/
lib/
!geojson_modelica_translator/modelica/lib
lib64/
parts/
sdist/
Expand Down Expand Up @@ -93,6 +94,11 @@ ENV/

# Test outputs
tests/output
tests/output_ets
tests/modelica/output
tests/model_connectors/output
tests/tests_13buildings_modelica/
tests/tests_13buildings_rc4/
/geojson_modelica_translator/modelica/buildingslibrary/
# TODO: this file shoud not be writtent out, but it is... fix this eventually
/geojson_modelica_translator/modelica/ets_cooling_indirect_templated.mo
32 changes: 32 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
exclude: |
(?x)(
^docs/conf.py|
^tests/modelica/|
^modelica_builder/modelica_parser/
)
repos:
- repo: git://github.com/pre-commit/pre-commit-hooks
rev: v2.2.3
hooks:
- id: trailing-whitespace
- id: check-added-large-files
- id: check-ast
- id: check-json
- id: check-merge-conflict
- id: check-xml
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
# - id: requirements-txt-fixer
- id: flake8
args: ['--max-line-length=140'] # default of Black
- id: mixed-line-ending


- repo: https://github.com/pre-commit/mirrors-isort
rev: v4.3.4
hooks:
- id: isort
args: ['-m 3'] # vertical hanging
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ env:
- TOX_ENV=python
- TOX_ENV=flake8
- TOX_ENV=docs
before_script:
- git clone --single-branch --branch issue1437_district_heating_cooling https://github.com/lbl-srg/modelica-buildings.git
- export MODELICAPATH=$(pwd)/modelica-buildings
script:
- tox -e $TOX_ENV
after_success:
Expand Down
1 change: 1 addition & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ Contributors
============

* Nicholas Long <[email protected]>
* Yanfei Li <[email protected]>
10 changes: 5 additions & 5 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Change Log
==========

Version 0.1
-----------
Version 0.1 (Unreleased)
------------------------

This is the initial release of the package and includes the following functionality:

* Create a ROM/RC model using Modelica 3.2.x, Modelica Buildings Library 7.0 and TEASER 0.6.8
* Create a Spawn-based models which loads an IDF file

* Initial implementation of a ModelicaRunner to call a Docker container to run the model.
* Create a ROM/RC model using Modelica 3.2.x, Modelica Buildings Library 7.0 and TEASER 0.7.2.
* Create a Spawn-based models which loads an IDF file.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
URBANopt, Copyright (c) 2019, Alliance for Sustainable Energy, LLC, and other contributors.
URBANopt, Copyright (c) 2019-2020, Alliance for Sustainable Energy, LLC, and other contributors.
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted
Expand Down
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ init:

test:
py.test

29 changes: 24 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,33 @@ The GeoJSON / Modelica Translator is still in early alpha-phase development and

If installing this package for development then you must run the `setup.py build` command in order to install the MBL in the right location.

currently you need python3 and pip3 to install/build the packages.

.. code-block:: bash
pip install -r requirements.txt
# or pip install .
python setup.py build
py.test
python setup.py test
The py.test tests should all pass assuming the libraries are installed correctly on your development computer. Also, there will be a set of Modelica models that are created and persisted into the `tests/output` folder.

Developers
**********

This project used `pre-commit <https://pre-commit.com/>`_ to ensure code consistency. To enable pre-commit, run the following from the command line.

.. code-block:: bash
pip install pre-commit
pre-commit install
To run pre-commit against the files without calling git commit, then run the following. This is useful when cleaning up the repo before committing.

.. code-block:: bash
pre-commit run --all-files
Modules
*******

Expand All @@ -53,7 +72,7 @@ The Simulation Mapper Class can operate at mulitple levels:
2. The Load Model Connection -- input: geojson+, output: multiple files related to building load models (spawn, rom, csv)
3. The Translation to Modelica -- input: custom format, output: .mo (example inputs: geojson+, system design parameters). The translators are implicit to the load model connectors as each load model requires different paramters to calculate the loads.

In some cases, the Level 3 case (transalation to Modelica) is a blackbox method (e.g. TEASER) which prevents a simulation mapper class from existing at that level.
In some cases, the Level 3 case (translation to Modelica) is a blackbox method (e.g. TEASER) which prevents a simulation mapper class from existing at that level.

Adjacency Matrix
++++++++++++++++
Expand All @@ -70,12 +89,13 @@ will automatically run the models without having to follow the steps below.

* Clone https://github.com/lbl-srg/docker-ubuntu-jmodelica and follow the set up instructions.
* Copy jmodelica.py (from docker-ubuntu-jmodelica) to root of project where you will simulate (e.g., geojson-modelica-translator/tests/model_connectors/output)
* Pull https://github.com/lbl-srg/modelica-buildings/tree/issue1442_loadCoupling
* Pull https://github.com/lbl-srg/modelica-buildings/tree/issue1437_district_heating_cooling
* **Make sure you have git-lfs installed**. You may need to checkout out the library again after install lfs.
* Please make sure you are in the issue1437_district_heating_cooling branch.
* Mac: `brew install git-lfs; git lfs install`
* Ubuntu: `sudo apt install git-lfs; git lfs install`
* Add the Buildings Library path to your MODELICAPATH environment variable (e.g., export MODELICAPATH=${MODELICAPATH}:/home/<user>/github/modelica-buildings).
* Example simulation:
* Example simulation:
* `jm_ipython.sh jmodelica.py spawn_two_building.Loads.B5a6b99ec37f4de7f94020090.building`
* `jm_ipython.sh jmodelica.py spawn_two_building/Loads/B5a6b99ec37f4de7f94020090/building.mo`
* Visualize the results by inspecting the resulting mat file using BuildingsPy.
Expand Down Expand Up @@ -139,7 +159,6 @@ Todos

* handle weather in Teaser
* Create a Script directory in the modelica_path class
* EBNF parsing
* Validate remaining schema objects
* AHU example
* runnable example
Loading

0 comments on commit 89e1738

Please sign in to comment.