Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prep 0.4.1 #523

Merged
merged 180 commits into from
Jan 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
180 commits
Select commit Hold shift + click to select a range
f71c24d
Don't crash if missing reopt data, just warn and move on
vtnate May 17, 2022
bbee463
poetry update
vtnate May 17, 2022
586802c
update microgrid sys-params with modern opendss output
vtnate May 17, 2022
13156a9
Merge branch 'develop' into microgrid-lines
vtnate May 25, 2022
a919b6a
wip compile & run with spawn & optimica
vtnate Jun 7, 2022
81d2dcd
Merge branch 'develop' into spawn-optimica
vtnate Jun 9, 2022
d712804
flesh out spawn.py
vtnate Jun 9, 2022
bd8118f
tiny typo fix of web link in docstring
vtnate Jun 9, 2022
c2b38a5
add a little to spawn.py docstring
vtnate Jun 9, 2022
a4c4017
clarify comments in compile_fmu function
vtnate Jun 9, 2022
2f1cf6d
shell function to kill container if process is interrupted
vtnate Jun 10, 2022
b1871e1
Merge branch 'develop' into microgrid-lines
vtnate Jun 10, 2022
287bc22
enable simulating pre-built fmu with spawn
vtnate Jun 14, 2022
854697d
wip spawn_docker.sh, still missing docker run command
vtnate Jun 14, 2022
ff2107e
create spawn image
vtnate Jun 14, 2022
7e189f5
update comment. maybe a line of code is not needed?
vtnate Jun 14, 2022
c757d47
one tiny update from os.path to pathlib
vtnate Jun 14, 2022
2839975
itty bitty formatting & comment cleanup
vtnate Jun 15, 2022
0130730
clean up dockerfile
vtnate Jun 15, 2022
6f01af4
start docker-compose file
vtnate Jun 15, 2022
211f5a4
[skip ci] wip: clean up call to spawn_docker & spawn.py
vtnate Jun 15, 2022
ed453af
small step forward with docker-compose file
vtnate Jun 15, 2022
9ee2bf1
clean up subprocess call and add compiler parameter
vtnate Jun 15, 2022
91d616d
clean up dockerfile even more
vtnate Jun 15, 2022
44d66f4
add docker run command, and modelon license env var stuff
vtnate Jun 15, 2022
d3c4292
tiny comment change
vtnate Jun 15, 2022
19cc225
questions when building the spawn image
vtnate Jun 20, 2022
5f83cc3
questions when starting the spawn container
vtnate Jun 20, 2022
5125b5d
questions about calling the image in docker-compose
vtnate Jun 20, 2022
0afff96
ensure valid compiler is passed to spawn.py
vtnate Jun 21, 2022
ef08076
new path to spawn.py inside conatiner
vtnate Jun 21, 2022
6d0b6b8
functional docker-compose file
vtnate Jun 21, 2022
655f96e
trying to install spawn into docker image
vtnate Jun 21, 2022
d6f8e94
make the create-sys-param command slightly less brittle
vtnate Jun 30, 2022
f3b0c2b
cli build-sys-param command now does not break at residential buildings
vtnate Jun 30, 2022
a2ad120
[skip ci] replace os with pathlib in base_test_case
vtnate Jun 30, 2022
a0d22a5
Merge pull request #484 from urbanopt/cli-less-brittle
vtnate Jun 30, 2022
86cd53c
Merge branch 'develop' into spawn-optimica
vtnate Jun 30, 2022
2b84e93
Merge branch 'develop' into microgrid-lines
vtnate Jul 6, 2022
39b8f56
fix bug where district microgrid features were not processed
vtnate Jul 8, 2022
7c69ff9
include assertion for pv on a building, not just district
vtnate Jul 8, 2022
b833425
uncomment simulation commands now covered with "not simulation"
vtnate Jul 11, 2022
6180c3f
map from ditto-reader wires to mbl wires for templates
vtnate Jul 11, 2022
e0d53ea
use appropriate mbl wires in template
vtnate Jul 11, 2022
20e631c
add python to spawn container, default debugging, fix path passing
nllong Jul 14, 2022
f22864f
use mbl line names in the cables; add todo regarding wire mapping
vtnate Jul 14, 2022
7c97039
Mingzhe fixed my template
vtnate Jul 15, 2022
20e3bf6
move pytest marker definition to pyproject.toml
vtnate Jul 18, 2022
703c5cb
delete commented code that was moved to pyproject.toml
vtnate Jul 18, 2022
8f21868
poetry update
vtnate Jul 18, 2022
ec298a0
run with optimica, only works for bouncing ball right now
nllong Jul 21, 2022
9de568f
old version of spawn
nllong Jul 22, 2022
cbe5448
update issue template
nllong Jul 22, 2022
4811b6b
add pyfmi
nllong Jul 24, 2022
a69cbb6
enable successful type hinting in 3.8 & 3.9
vtnate Jul 25, 2022
c677a6e
make some spawn.py arguments specifically not required. Add some type…
vtnate Jul 25, 2022
0228a71
poetry update
vtnate Jul 25, 2022
a8f80d4
remove redundant Action trigger
vtnate Jul 25, 2022
51a4751
Revert "enable successful type hinting in 3.8 & 3.9"
vtnate Jul 25, 2022
9f0cd24
type hint for list only wants one instance of dict apparently
vtnate Jul 25, 2022
11c1862
positional arguments need a different way of being optional
vtnate Jul 25, 2022
aa0991e
Merge pull request #490 from urbanopt/fmu-runner
vtnate Jul 25, 2022
74fdb00
replace named arguments in spawn_docker.sh
vtnate Jul 26, 2022
b43d403
wip: clean up paths transferred to spawn.py
vtnate Jul 26, 2022
386940c
crazy way of including paths in the container, but it works
vtnate Jul 26, 2022
f35de52
autopep8
vtnate Jul 26, 2022
0d4ff27
remove reference to arg_list which is no longer used
vtnate Jul 26, 2022
7716671
add in optimica-based compilation
nllong Jul 26, 2022
8c6083f
rename docker hub user to nrel
nllong Jul 26, 2022
425557f
use bash when piping file
nllong Jul 26, 2022
38716e3
restructure weather file download
nllong Jul 27, 2022
3c1ef23
update lock file
nllong Jul 28, 2022
6aa191f
update lock file
nllong Jul 28, 2022
cbc2120
fix i/o error
nllong Jul 28, 2022
f9d5d53
Merge pull request #492 from urbanopt/update-develop-dependencies
nllong Jul 28, 2022
fad9671
reenable downloading both mos and epw
nllong Jul 28, 2022
44e7e16
reenable downloading both mos and epw
nllong Jul 28, 2022
2ae3141
upgrade ci to mbl master/9.1.0
nllong Jul 28, 2022
04fd07c
dump stdout log to logger
nllong Jul 28, 2022
238fb4c
Update license secret
nllong Jul 28, 2022
dc1ae59
remove debug logs
nllong Jul 29, 2022
dbfeba3
Merge pull request #493 from urbanopt/spawn-docker-named-args-ci-fix
nllong Jul 29, 2022
62abe22
Merge pull request #491 from urbanopt/spawn-docker-named-args
nllong Jul 29, 2022
258a45d
Merge branch 'develop' into spawn-optimica
nllong Aug 1, 2022
9f47567
Merge pull request #480 from urbanopt/spawn-optimica
nllong Aug 1, 2022
42f2813
Merge branch 'develop' into microgrid-lines
nllong Aug 1, 2022
2f37857
Merge pull request #467 from urbanopt/microgrid-lines
Aug 22, 2022
97a3176
Add 5g to sysparams (#469)
vtnate Sep 9, 2022
38b0236
Bump mako from 1.2.1 to 1.2.2
dependabot[bot] Sep 16, 2022
d04bbb2
Weather file at top level (#497)
vtnate Sep 20, 2022
449b34e
Merge branch 'develop' into dependabot/pip/mako-1.2.2
nllong Sep 20, 2022
c6efe93
Update schema.json
vtnate Sep 20, 2022
db9ba73
Merge pull request #498 from urbanopt/weather-schema-text
nllong Sep 20, 2022
9d6992d
Merge branch 'develop' into dependabot/pip/mako-1.2.2
vtnate Sep 20, 2022
cf41122
test with 3.10
nllong Oct 7, 2022
7d67fe1
bump supported python version
nllong Oct 7, 2022
18a1b3f
update lock file
nllong Oct 7, 2022
d77a452
change max python version to be <3.11
vtnate Oct 10, 2022
b8b6cd1
poetry update
vtnate Oct 10, 2022
9680175
update poetry version used for ci
vtnate Oct 10, 2022
6c198c8
trying not supporting 3.7 in ci
vtnate Oct 10, 2022
c5833bb
ensure "poetry update" is run in CI
vtnate Sep 26, 2022
17f92ca
only support python 3.10
vtnate Oct 10, 2022
b3ff3f2
only support python 3.10 in ci
vtnate Oct 10, 2022
a1827fe
poetry update again
vtnate Oct 10, 2022
ab5c749
simplifying tox call in ci
vtnate Oct 11, 2022
bb92bbf
bump pre-commit isort version
vtnate Oct 11, 2022
b1623ae
quotes around 3 in pre-commit isort command
vtnate Oct 11, 2022
31a872b
use officially sanctioned isort for pre-commit
vtnate Oct 11, 2022
a1b7a91
set isort configs in pyproject.toml
vtnate Oct 11, 2022
7676038
poetry update
vtnate Oct 11, 2022
41ee868
pre-commit ran with new isort version
vtnate Oct 11, 2022
fa09cd0
another attempt at passing message to pytest in tox env
vtnate Oct 11, 2022
53f5eae
update Actions checkout and setup-python versions
vtnate Oct 11, 2022
535b220
still trying to pass messages to pytest in tox
vtnate Oct 11, 2022
20858e5
what are the chances this works?
vtnate Oct 11, 2022
6b5cdde
surely this does not matter, right?
vtnate Oct 11, 2022
e48fae1
back to nearly original tox call
vtnate Oct 11, 2022
d2fc6e3
what if we didn't use tox in the CI tests?
vtnate Oct 11, 2022
b07d2ba
add some commands formerly supplied by the tox env
vtnate Oct 11, 2022
69de0e3
re-enable GMT supporting python 3.7.1
vtnate Oct 11, 2022
79a6e60
run CI tests with python 3.7 as well as 3.10
vtnate Oct 11, 2022
9412232
one more poetry update
vtnate Oct 11, 2022
2093bfb
set min python version to 3.8
vtnate Oct 12, 2022
e882140
poetry update
vtnate Oct 12, 2022
58201aa
Revert "poetry update"
vtnate Oct 12, 2022
ccf7ce3
Revert "set min python version to 3.8"
vtnate Oct 12, 2022
541e77a
add python 3.10 to list of supported versions
vtnate Oct 12, 2022
f587c70
only support python 3.10
vtnate Oct 12, 2022
dca8cd2
revert name of test step to Tox alone, not Test/Tox
vtnate Oct 12, 2022
3f2ec42
update dependencies with poetry
vtnate Oct 18, 2022
db120ef
different way of running pre-commit and building docs
vtnate Oct 18, 2022
6d0eebe
ugh, case sensitivity
vtnate Oct 18, 2022
b517d78
comment bits about modelon in ci for now
vtnate Oct 18, 2022
a0bcd37
maybe hacky way of selecting docs env in ci
vtnate Oct 18, 2022
ac744f6
oops, need to be in docs folder to make docs
vtnate Oct 18, 2022
9e455e8
support python 3.7.1
vtnate Oct 18, 2022
e963408
apparently we need quotes
vtnate Oct 18, 2022
ac3ead7
undelete metadata confirming this works in python 3.7.1-3.10
vtnate Oct 18, 2022
9814b29
Merge pull request #502 from urbanopt/add-py3.10-to-ci
nllong Oct 21, 2022
4e46f91
Merge remote-tracking branch 'origin/develop' into dependabot/pip/mak…
nllong Oct 23, 2022
e64df8b
Merge pull request #496 from urbanopt/dependabot/pip/mako-1.2.2
nllong Oct 25, 2022
2c2ad4b
4G or 5G timeseries in Dymola (#489)
vtnate Nov 4, 2022
dc4c192
Prep 0.4.0 release (#505)
vtnate Nov 4, 2022
e280a31
Merge branch 'main' into develop
nllong Nov 4, 2022
498d51d
Merge branch 'main' into develop
nllong Nov 7, 2022
3ccdba4
update test geojson file to match sdk
vtnate Nov 29, 2022
d755985
`poetry update`
vtnate Nov 29, 2022
9281597
remove explicit float transformation, and add a log message
vtnate Nov 29, 2022
1ec189c
make mos weatherfile explicit in code
vtnate Nov 29, 2022
7542e24
fix typo in microgrid commercial cable comment
vtnate Dec 5, 2022
430057f
different way of rounding
vtnate Dec 7, 2022
868f461
in ci: add github token, and use maint_9.1.x branch of mbl
vtnate Dec 13, 2022
7827d29
pin ubuntu to 20.04 to maintain use of python 3.7
vtnate Dec 13, 2022
4fd338d
gah, missed one spot of hard-coded os version
vtnate Dec 13, 2022
4e00e8a
even the commented line, to be complete
vtnate Dec 13, 2022
5f3cd16
update developer docs with pytest message command
vtnate Dec 13, 2022
b6afe83
Merge pull request #514 from urbanopt/ci-tweaks
nllong Dec 14, 2022
b87cdb2
Merge branch 'develop' into cli-bugfixing
vtnate Dec 14, 2022
e2075f9
use formal path to MBL, not github link
vtnate Dec 14, 2022
546be27
`poetry update` again
vtnate Dec 14, 2022
8cadbe4
Merge pull request #507 from urbanopt/cli-bugfixing
Dec 15, 2022
7822aee
Merge branch 'develop' into update-docs
vtnate Dec 15, 2022
2b4d4e9
Detailed models (#517)
vtnate Dec 21, 2022
c59a957
Merge branch 'develop' into update-docs
vtnate Dec 23, 2022
bd0c0c4
add sphinx extension to make section links work easily
vtnate Dec 27, 2022
9976d66
move docs for cloning MBL to dev resources
vtnate Dec 27, 2022
468ce1a
specify that GMT version 0.2.3 can use JModelica to simulate models
vtnate Dec 27, 2022
8fec05b
`poetry update`
vtnate Dec 27, 2022
693cd71
bugfix of the bugfix, yay (#519)
vtnate Dec 28, 2022
baa5783
Merge branch 'develop' into update-docs
vtnate Jan 4, 2023
26c9a67
Merge pull request #515 from urbanopt/update-docs
nllong Jan 5, 2023
f70a59f
update precommit and licenses on files
nllong Jan 5, 2023
bbe1607
add and cleanup license
nllong Jan 5, 2023
621fd64
use python 3.8, update dev dependencies
nllong Jan 5, 2023
d46024a
Merge pull request #522 from urbanopt/python-3.8
nllong Jan 5, 2023
c838ef1
Merge pull request #521 from urbanopt/2023-license
nllong Jan 5, 2023
279f908
add a forgotten test output to gitignore
vtnate Jan 5, 2023
fa4d069
bump version to 0.4.1
vtnate Jan 5, 2023
8f2c269
update changelog
vtnate Jan 6, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ source =
omit =
.tox/*
management/update_schemas.py
management/update_licenses.py
management/check_sys_params.py
geojson_modelica_translator/model_connectors/load_connectors/templates/RunSpawnCouplingBuilding.most
geojson_modelica_translator/modelica/lib/runner/__init__.py
Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ["3.7.1", "3.10"]
os: [ubuntu-20.04, windows-latest]
python-version: ["3.8", "3.10"]
test_env: [python, precommit, docs]
mbl_branch: [master]
mbl_branch: [maint_9.1.x]
include:
- os: ubuntu-latest
- os: ubuntu-20.04
test_env: python
mbl_branch: master
mbl_branch: maint_9.1.x
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:
poetry update
# -
# name: Save Optimica license to file
# if: matrix.os == 'ubuntu-latest'
# if: matrix.os == 'ubuntu-20.04'
# shell: bash
# run: |
# mkdir -p /home/runner/modelon
Expand All @@ -80,7 +80,7 @@ jobs:
MATRIX_OS: ${{ matrix.os }}
MBL_BRANCH: ${{ matrix.mbl_branch }}
run: |
if [[ "${MATRIX_OS}" == 'ubuntu-latest' ]]; then
if [[ "${MATRIX_OS}" == 'ubuntu-20.04' ]]; then
MODELICAPATH='/home/runner/work/modelica-buildings'
else
echo $GITHUB_WORKSPACE
Expand Down Expand Up @@ -123,7 +123,8 @@ jobs:
name: Coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
if: ${{ matrix.os == 'ubuntu-latest' && matrix.test_env == 'python' && matrix.mbl_branch == 'master' }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ matrix.os == 'ubuntu-20.04' && matrix.test_env == 'python' && matrix.mbl_branch == 'maint_9.1.x' }}
run: |
poetry run coveralls
-
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -105,5 +105,6 @@ tests/*/microgrid_output
tests/output_ets
tests/*/output
/geojson_modelica_translator/modelica/buildingslibrary/
not/a/real/**
# TODO: this file shoud not be writtent out, but it is... fix this eventually
/geojson_modelica_translator/modelica/ets_cooling_indirect_templated.mo
42 changes: 35 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ exclude: |

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.2.3
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: check-added-large-files
Expand All @@ -20,17 +20,45 @@ repos:
- 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: requirements-txt-fixer
- id: mixed-line-ending
- id: pretty-format-json
args: ['--autofix', '--no-sort-keys']
- repo: https://github.com/pycqa/isort
rev: 5.10.1
- repo: https://github.com/pre-commit/mirrors-autopep8
rev: v2.0.1
hooks:
- id: autopep8
args:
[
"--in-place",
"--aggressive",
"--aggressive",
"--recursive",
"--max-line-length=100",
"--ignore=E501,E402,W503,W504,E731"
]
- repo: https://github.com/PyCQA/autoflake
rev: v2.0.0
hooks:
- id: autoflake
args:
[
"--in-place",
"--recursive",
"--remove-all-unused-imports",
"--remove-unused-variable",
"--ignore-init-module-imports"
]
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
hooks:
- id: flake8
args: ["--ignore=E501,E402,W503,W504,E731,F401"]
- repo: https://github.com/pre-commit/mirrors-isort
rev: v5.10.1
hooks:
- id: isort
name: isort (python)
args: ["-m=VERTICAL_HANGING_INDENT"] # vertical hanging
- repo: local
hooks:
- id: modelica-fmt
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
Change Log
==========

Version 0.4.1
-------------
## What's Changed
* Cli bugfixing
* Detailed models
* End-of-year updates to GMT docs
* Remove support for 3.7 in development, update development dependencies
* Update copyrights to 2023

Version 0.4.0
-------------
As of version 0.4.0 changes will be published using Github automated formatting at the release itself. Those changes are copied here.
Expand Down
2 changes: 1 addition & 1 deletion LICENSE → LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
URBANopt, Copyright (c) 2019-2022, Alliance for Sustainable Energy, LLC, and other contributors.
URBANopt, Copyright (c) 2019, 2023 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
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include LICENSE
include LICENSE.md
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ init:
pip install -r requirements.txt

test:
py.test
pytest
5 changes: 3 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autosectionlabel',
'sphinx.ext.autosummary',
'sphinx.ext.coverage',
'sphinx.ext.napoleon',
'sphinx.ext.autosummary',
'sphinx-jsonschema',
]

Expand All @@ -51,7 +52,7 @@

# General information about the project.
project = u"GeoJSON Modelica Translator"
copyright = u"2019-2022, Alliance for Sustainable Energy, LLC"
copyright = u"2019,2023 - Alliance for Sustainable Energy, LLC"

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down
25 changes: 13 additions & 12 deletions docs/developer_resources.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,24 @@ Getting Started as a Developer
------------------------------

There are a few steps that are imperative to complete when starting as a developer of the GMT. First, make sure
to follow the detailed instructions for setting up MBL and Docker in the `getting started <getting_started>`_ guide.
to follow the detailed instructions for :ref:`Docker Installation` in the Getting Started guide.

Follow the instructions below in order to configure your local environment:

* Clone this repo into a working directory
* If you need a custom Modelica Buildings Library:
* Clone the `MBL <https://github.com/lbl-srg/modelica-buildings>`_ into a working directory outside of the GMT directory
* Ensure your MODELICAPATH env var is set to the MBL you want to use! See the documentation at :ref:`MBL Installation`
* Change to the directory inside the modelica-buildings repo you just checked out. (:code:`cd modelica-buildings`)
* Install git-lfs
* Mac: :code:`brew install git-lfs; git lfs install`
* Ubuntu: :code:`sudo apt install git-lfs; git lfs install`
* The current GMT code works with the :code:`maint_9.1.x` branch of the MBL. GMT version :code:`0.2.3`, which uses JModelica, requires the :code:`issue2204_gmt_mbl` branch of the MBL.

* Clone `the GMT repo <https://github.com/urbanopt/geojson-modelica-translator>`_ into a working directory
* (optional/as-needed) Add Python 3 to the environment variables
* For developers, dependency management is through `Poetry`_. Installation is accomplished by running :code:`pip install poetry`.
* Return to the GMT root directory and run :code:`poetry install`
* Test if everything is installed correctly by running :code:`poetry run pytest`. This will run all the unit and integration tests.
* Test if everything is installed correctly by running :code:`poetry run pytest -m 'not compilation and not simulation'`. This will run all the unit and integration tests.
* Follow the instructions below to install pre-commit.
* To test pre-commit and building the documentation, you can run :code:`poetry run tox`

Expand Down Expand Up @@ -102,14 +111,6 @@ project. A developer can run this command by calling

The developer should run the test suite after updating the schemas to ensure that nothing appears to have broken. Note that the tests do not cover all of the properties and should not be used as proof that everything works with the updated schemas.

Updating Licenses
^^^^^^^^^^^^^^^^^

To apply the copyright/license to all the files, run the following managed task

.. code-block:: bash

poetry run update_licenses

Adding New Models
-----------------
Expand Down Expand Up @@ -217,7 +218,7 @@ desired, a user can run the simulations manually using JModelica (via Docker). F
the runner to work locally.

* Make sure jm_ipython.sh is in your local path.
* After running the :code:`py.test`, go into the :code:`geojson_modelica_translator/modelica/lib/runner/` directory.
* After running the :code:`pytest`, go into the :code:`geojson_modelica_translator/modelica/lib/runner/` directory.
* Copy :code:`jmodelica.py` to the :code:`tests/model_connectors/output` directory.
* From the :code:`tests/model_connectors/output` directory, run examples using either of the the following:
* :code:`jm_ipython.sh jmodelica.py spawn_single.Loads.B5a6b99ec37f4de7f94020090.coupling`
Expand Down
9 changes: 2 additions & 7 deletions docs/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,7 @@ MBL Installation

The Modelica Buildings Library contains many models that are needed to assemble the district systems. Installation of the MBL is done through Git and GitHub. Follow the instructions below to install the MBL needed for the GMT:

* Clone the `MBL`_ into a working directory outside of the GMT directory
* Change to the directory inside the modelica-buildings repo you just checked out. (:code:`cd modelica-buildings`)
* Install git-lfs
* Mac: :code:`brew install git-lfs; git lfs install`
* Ubuntu: :code:`sudo apt install git-lfs; git lfs install`
* The GMT code works with the :code:`master` branch of the MBL, which is currently version 9.0.0. If the :code:`master` branch has been updated, then use the tag :code:`v9.0.0` to install the MBL.
* Download and extract the newest 9.1 version of the MBL from `<https://simulationresearch.lbl.gov/modelica/downloads/archive/modelica-buildings.html>`_
* Add the Modelica Buildings Library path to your MODELICAPATH environment variable (e.g., export MODELICAPATH=${MODELICAPATH}:$HOME/path/to/modelica-buildings). Restart your terminal to ensure that the MBL library is exported correctly.

Once the MBL is installed, then the CLI can be used to create the model with the following command:
Expand All @@ -75,7 +70,7 @@ Docker Installation
-------------------

The preferred method of running the simulations would be within Dymola; however, that is not a
practical solution for many based on the license requirement. The GMT enables the running of the
practical solution for many based on the license requirement. Version 0.2.3 of the GMT enables the running of the
models using JModelica which requires the installation of `Docker`_. To configure Docker, do the
following:

Expand Down
2 changes: 1 addition & 1 deletion docs/license.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
License
=======

.. include:: ../LICENSE
.. include:: ../LICENSE.md
39 changes: 2 additions & 37 deletions geojson_modelica_translator/geojson/schemas.py
Original file line number Diff line number Diff line change
@@ -1,40 +1,5 @@
"""
****************************************************************************************************
:copyright (c) 2019-2022, 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
provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this list of conditions
and the following disclaimer.

Redistributions in binary form must reproduce the above copyright notice, this list of conditions
and the following disclaimer in the documentation and/or other materials provided with the
distribution.

Neither the name of the copyright holder nor the names of its contributors may be used to endorse
or promote products derived from this software without specific prior written permission.

Redistribution of this software, without modification, must refer to the software by the same
designation. Redistribution of a modified version of this software (i) may not refer to the
modified version by the same designation, or by any confusingly similar designation, and
(ii) must refer to the underlying software originally provided by Alliance as “URBANopt”. Except
to comply with the foregoing, the term “URBANopt”, or any confusingly similar designation may
not be used to refer to any modified version of this software or any modified version of the
underlying software originally provided by Alliance without the prior written consent of Alliance.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
****************************************************************************************************
"""
# :copyright (c) URBANopt, Alliance for Sustainable Energy, LLC, and other contributors.
# See also https://github.com/urbanopt/geojson-modelica-translator/blob/develop/LICENSE.md

import json
import os
Expand Down
59 changes: 11 additions & 48 deletions geojson_modelica_translator/geojson/urbanopt_geojson.py
Original file line number Diff line number Diff line change
@@ -1,40 +1,5 @@
"""
****************************************************************************************************
:copyright (c) 2019-2022, 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
provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this list of conditions
and the following disclaimer.

Redistributions in binary form must reproduce the above copyright notice, this list of conditions
and the following disclaimer in the documentation and/or other materials provided with the
distribution.

Neither the name of the copyright holder nor the names of its contributors may be used to endorse
or promote products derived from this software without specific prior written permission.

Redistribution of this software, without modification, must refer to the software by the same
designation. Redistribution of a modified version of this software (i) may not refer to the
modified version by the same designation, or by any confusingly similar designation, and
(ii) must refer to the underlying software originally provided by Alliance as “URBANopt”. Except
to comply with the foregoing, the term “URBANopt”, or any confusingly similar designation may
not be used to refer to any modified version of this software or any modified version of the
underlying software originally provided by Alliance without the prior written consent of Alliance.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
****************************************************************************************************
"""
# :copyright (c) URBANopt, Alliance for Sustainable Energy, LLC, and other contributors.
# See also https://github.com/urbanopt/geojson-modelica-translator/blob/develop/LICENSE.md

import logging
from pathlib import Path
Expand Down Expand Up @@ -94,18 +59,16 @@ def __init__(self, filename, building_ids=None):
self.buildings = []
for feature in self.data.features:
if feature["properties"]["type"] == "Building":
# Don't validate features with 'detailed_model_filename' in the building properties
# Buildings defined by an osm don't have all keys in geojson, they'll always fail validation
if "detailed_model_filename" in feature["properties"]:
continue
else:
building = UrbanOptLoad(feature)
if not building_ids or building.id in building_ids:
building = UrbanOptLoad(feature)
if not building_ids or building.id in building_ids:
# Don't care about validation failures for features with 'detailed_model_filename' in the building properties
# Buildings defined by an osm don't have all keys in geojson, they'll always fail validation
if "detailed_model_filename" not in feature["properties"]:
errors = self.schemas.validate("building", building.feature.properties)
if errors:
building_errors[building.id] = errors
else:
self.buildings.append(building)
if errors:
building_errors[building.id] = errors
else:
self.buildings.append(building)

if building_errors:
formatted_errors = ''
Expand Down
Loading