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

Set version to v0.7.0 #636

Merged
merged 82 commits into from
May 7, 2024
Merged

Set version to v0.7.0 #636

merged 82 commits into from
May 7, 2024

Conversation

vtnate
Copy link
Contributor

@vtnate vtnate commented May 6, 2024

Any background context you want to provide?

I incorrectly set the version in pyproject.toml to be 0.6.1 when there are breaking changes in the CLI.

What does this PR accomplish?

How should this be manually tested?

What are the relevant tickets?

Screenshots (if appropriate)

nllong and others added 30 commits January 6, 2023 10:56
Merging 0.4.1 from main into develop
* adjust dependency versions to support python 3.11

* skip compilation and simulation tests in tox env

* update ci for python 3.11

* change asserts to if/raise statements in modelica_runner

* ugh, forgot to change the test when I changed the assertions

* update poetry version in ci

* `poetry update`
* add max_electrical_load to building sys-param data

* alphabetize some template sys-param entries
* Add GHE properties to system parameter

* add ghe parameters

* add end of file line

* Add test

* modify schema

* additional properties

* run precommit

* add description and default

* pre-commit

* add schema changes

* edit default

---------

Co-authored-by: Nathan Moore <[email protected]>
* removing remaining tox parts

* `poetry update`

---------

Co-authored-by: Nathan Moore <[email protected]>
* update dependency versions

* initial files added for creating 5g system from existing load files

* fix path type, ignore for now

* fix types on methods, bump to python 3.8 (#540)

* fix types on methods, bump to python 3.8

* update ci exclude

* add in directory to the mos copying

* systemparameter needs to use the same data... favor param_template over data.

* expose nBui to set correctly

* default to openmodelica and fix space check in file name
* set swh peak to one-tenth of space heating or min 5000W

* max/min are hard

* Update geojson_modelica_translator/modelica/GMT_Lib/DHC/DHC_5G_waste_heat_GHX.py

* Update geojson_modelica_translator/modelica/GMT_Lib/DHC/DHC_5G_waste_heat_GHX.py

Co-authored-by: Nathan Moore <[email protected]>

* float precision is not needed. now using int instead

* test for new int value in shw instead of float

* update dependencies

---------

Co-authored-by: Nathan Moore <[email protected]>
* Add redeclaration of allowFlowReverseSer=true

* Inital implementation of district system template with single GHE

* Add modified GroundTemperatureResponse class to overwrite MBL

* Initial implementation of OneUTube and PartialBorefield templates

* Fix bug of inconsistent template name and Modelica class name of BuildingTimeSeries

* Update system template, removed temperature sensors

* District energy test file that has multiple buildings

* Add comment and test version control with VSCode

* Add declaration of borefield data parameters

* Add template for TwoUTubes borefield

* Remove unneeded mo files

* Modify input field names based on schema

* Change within statement

* Initial implementation of borefield.py

* Conversion of shank spacing

* Modify shank spacing conversion

* Remove unneeded mo file

* Minor changes to model_name

* Add system template for testing borefield template

* Initial implementation of borefield test

* Move ghe system parameter files to right location

* Take out SingleGHE system template for now

* Change within statement

* Initial implementation of borefield coupling

* Add code to point to BorefieldSystem.mot

* Remove duplicated test script

* Rename package

* Add {%endraw%} at the end

* Add input fields needed for the test

* Debugging changes

* Add borefield_instance.mopt

* Changes for debugging, now the test passes

* Add borehole_length to example system params file

* Debug PartialBorefield.mot, it passes check

* Change coupling definitions

* Minor changes

* Remove partial template models

* Add sample g-function and path

* Reverting 3 system params files

* pre-commit now with more modelica-fmt

* Apply uniform 5G district system template

* Remove unused GHE district template

* Fix for non-ghe 5G districts

---------

Co-authored-by: Nathan Moore <[email protected]>
* new class for reading mos file variables

* add mf sizing and expose plant mass flow variable

* fix typing warning for round

* reduce delta t to 10C

* reduce delta t to 5C
* updating plant components to work with OpenModelica

* add "each" to array of parameters. first pass

* remove nports count setting for OM

* bump requests version to remove RequestsDependencyWarning about charset_normalizer

* `poetry update`

* redeclare the correct building class in 5G timeseries template

* `allowFlowReversal` in timeseries_instance to make OM solver happy

* put FlowReversal only in the 5g part of TimeSeries_Instance

* lower 5G building hot water supply/return temps

* restore nports=1 for 4g timeseries buildings

* allowFlowReversal=true in heat exchanger

* add within statement at top of getPeakMassFlowRate.mo

* read getPeakMassFlowRate.mo as a template, so we can have the model name added properly

* add spaces around project_name in mft template

* add allowFlowReversal=true to all 4G timeseries buildings

* allowFlowReversal=true in network2pip_instance [skip-ci]

* set all remaining allowFlowReversal=true [ci skip]

* tell modelica formatter to ignore getPeakMassFlowRate.mo because of failures

* change getPeakMassFlowRate.mo to *.mot, reactivate modelica-fmt on it

* oops, look for new filename [ci-skip]

* remove commented code [skip ci]

* add Medium redeclaration in MFT template

* add OM files folder

* All_spawn_models

* Teaser Single worked

* add timeseries output nodes to make OM happy

* allow flow reversal in spawn building

* relax thermal zone constraint in teaser

* properly check for chp in sys param file

* fix double appending of heating plant when no chp to package.order

* pre-commit on Jiazhen's temp files for OM testing; remove some spawn-single files

* remove requirements.txt check from pre-commit, since we don't use that

* `poetry update`

* Spawn and Teaser changes

* pre-commit formatted Jiazhens modelica files

* hardcode numberofchillers=2 as a hack because OM does not do dot access

* add `allowFlowReversal=true` to spawn load instance

* hack in the hardcoded numberofchillers to make OM happy

* update 5g sys-param file to use 5g ets params

* add district 5g timeseries test

* `poetry update`

* add `.pytest_cache` to gitignore

* update mft connect statements to work in OM

* remove commented template code

* get 5g districts of multiple buildings working

* remove test models from Jiazhen

* `poetry update`

* use newer version of poetry in ci

* remove redundant `precommit` test env from CI matrix

* remind poetry that we only support python >=3.9 now

* `poetry update`

* use newest poetry patch in ci

* autopep8

---------

Co-authored-by: jiazhenling <[email protected]>
* remove connectors from ghe params

* modify test and ghe system param file

* update ghe parameters schema

* modify ghe parameters

* modify ghe parameters

* add system parameter files for borehole test

* update example files

* update example files for model connectors

* add ets 5th gen params

* add array for ghe geometry params

* remove print statement from test

* Adds defaults and required fields for ghe_params and 5th gen ets params

---------

Co-authored-by: Nicholas Long <[email protected]>
* Add redeclaration of allowFlowReverseSer=true

* Inital implementation of district system template with single GHE

* Add modified GroundTemperatureResponse class to overwrite MBL

* Initial implementation of OneUTube and PartialBorefield templates

* Fix bug of inconsistent template name and Modelica class name of BuildingTimeSeries

* Update system template, removed temperature sensors

* District energy test file that has multiple buildings

* Add comment and test version control with VSCode

* Add declaration of borefield data parameters

* Add template for TwoUTubes borefield

* Remove unneeded mo files

* Modify input field names based on schema

* Change within statement

* Initial implementation of borefield.py

* Conversion of shank spacing

* Modify shank spacing conversion

* Remove unneeded mo file

* Minor changes to model_name

* Add system template for testing borefield template

* Initial implementation of borefield test

* Move ghe system parameter files to right location

* Take out SingleGHE system template for now

* Change within statement

* Initial implementation of borefield coupling

* Add code to point to BorefieldSystem.mot

* Remove duplicated test script

* Rename package

* Add {%endraw%} at the end

* Add input fields needed for the test

* Debugging changes

* Add borefield_instance.mopt

* Changes for debugging, now the test passes

* Add borehole_length to example system params file

* Debug PartialBorefield.mot, it passes check

* Change coupling definitions

* Minor changes

* Remove partial template models

* Add sample g-function and path

* Reverting 3 system params files

* pre-commit now with more modelica-fmt

* Apply uniform 5G district system template

* Remove unused GHE district template

* Fix for non-ghe 5G districts

* Delete sys_param files not needed

* Replace Gfunction input with csv file

* Point to the right sys_param file

* Updated template to reflect schema changes

* Changes for the test to run

* Fix backslashes

* Change to adapt to recent commits

* Temporary fixes to make the test pass

* Change ghe_dir to relative path

* Use pathlib to handle ghe_dir

* Add if statement to avoid breaking other 5G tests

* Change due to schema change

* Pre-commit changes

* Fix bug

---------

Co-authored-by: Nathan Moore <[email protected]>
…files (#551)

* remove loads as required

* add objects for unique ghe properties

* update ghe specific schema objects

* add borehole to ghe specific properties

* update schema and example to not require autopopulated fields

* update to relative path

* update model connector examples

* Fix borefield test breaks due to the schema changes in issue #551 (#554)

* Add redeclaration of allowFlowReverseSer=true

* Inital implementation of district system template with single GHE

* Add modified GroundTemperatureResponse class to overwrite MBL

* Initial implementation of OneUTube and PartialBorefield templates

* Fix bug of inconsistent template name and Modelica class name of BuildingTimeSeries

* Update system template, removed temperature sensors

* District energy test file that has multiple buildings

* Add comment and test version control with VSCode

* Add declaration of borefield data parameters

* Add template for TwoUTubes borefield

* Remove unneeded mo files

* Modify input field names based on schema

* Change within statement

* Initial implementation of borefield.py

* Conversion of shank spacing

* Modify shank spacing conversion

* Remove unneeded mo file

* Minor changes to model_name

* Add system template for testing borefield template

* Initial implementation of borefield test

* Move ghe system parameter files to right location

* Take out SingleGHE system template for now

* Change within statement

* Initial implementation of borefield coupling

* Add code to point to BorefieldSystem.mot

* Remove duplicated test script

* Rename package

* Add {%endraw%} at the end

* Add input fields needed for the test

* Debugging changes

* Add borefield_instance.mopt

* Changes for debugging, now the test passes

* Add borehole_length to example system params file

* Debug PartialBorefield.mot, it passes check

* Change coupling definitions

* Minor changes

* Remove partial template models

* Add sample g-function and path

* Reverting 3 system params files

* pre-commit now with more modelica-fmt

* Apply uniform 5G district system template

* Remove unused GHE district template

* Fix for non-ghe 5G districts

* Delete sys_param files not needed

* Replace Gfunction input with csv file

* Point to the right sys_param file

* Updated template to reflect schema changes

* Changes for the test to run

* Fix backslashes

* Change to adapt to recent commits

* Temporary fixes to make the test pass

* Change ghe_dir to relative path

* Use pathlib to handle ghe_dir

* Add if statement to avoid breaking other 5G tests

* Change due to schema change

* Pre-commit changes

* Fix bug

* Changes due to schema change

---------

Co-authored-by: Nathan Moore <[email protected]>

---------

Co-authored-by: Jing Wang <[email protected]>
Co-authored-by: Nathan Moore <[email protected]>
* updating plant components to work with OpenModelica

* add "each" to array of parameters. first pass

* remove nports count setting for OM

* bump requests version to remove RequestsDependencyWarning about charset_normalizer

* `poetry update`

* redeclare the correct building class in 5G timeseries template

* `allowFlowReversal` in timeseries_instance to make OM solver happy

* put FlowReversal only in the 5g part of TimeSeries_Instance

* lower 5G building hot water supply/return temps

* restore nports=1 for 4g timeseries buildings

* allowFlowReversal=true in heat exchanger

* add within statement at top of getPeakMassFlowRate.mo

* read getPeakMassFlowRate.mo as a template, so we can have the model name added properly

* add spaces around project_name in mft template

* add allowFlowReversal=true to all 4G timeseries buildings

* allowFlowReversal=true in network2pip_instance [skip-ci]

* set all remaining allowFlowReversal=true [ci skip]

* tell modelica formatter to ignore getPeakMassFlowRate.mo because of failures

* change getPeakMassFlowRate.mo to *.mot, reactivate modelica-fmt on it

* oops, look for new filename [ci-skip]

* remove commented code [skip ci]

* add Medium redeclaration in MFT template

* add OM files folder

* All_spawn_models

* Teaser Single worked

* add timeseries output nodes to make OM happy

* allow flow reversal in spawn building

* relax thermal zone constraint in teaser

* properly check for chp in sys param file

* fix double appending of heating plant when no chp to package.order

* pre-commit on Jiazhen's temp files for OM testing; remove some spawn-single files

* remove requirements.txt check from pre-commit, since we don't use that

* `poetry update`

* Spawn and Teaser changes

* pre-commit formatted Jiazhens modelica files

* hardcode numberofchillers=2 as a hack because OM does not do dot access

* add `allowFlowReversal=true` to spawn load instance

* hack in the hardcoded numberofchillers to make OM happy

* update 5g sys-param file to use 5g ets params

* add district 5g timeseries test

* `poetry update`

* add `.pytest_cache` to gitignore

* update mft connect statements to work in OM

* remove commented template code

* get 5g districts of multiple buildings working

* remove test models from Jiazhen

* `poetry update`

* use newer version of poetry in ci

* remove redundant `precommit` test env from CI matrix

* wip: OM Docker code partial setup. Needs at least more Dockerfile work

* remind poetry that we only support python >=3.9 now

* `poetry update`

* use newest poetry patch in ci

* autopep8

* ignore typing error, and temporarily(?) remove method argument

* om docker-compose yml file

* change call from `spawn_docker.sh` to `om_docker.sh`

* OM Dockerfile, and remove old Dockerfile

* update modelica_runner for OM and remove spawn references

* update python and shell scripts to run OM in Docker container

* remove files no longer necessary

* more updates for switch from spawn to OM

* update test regarding switch from spawn to OM

* re-enable a third cli argument for om.py in the container

* handle a third argument to the cli inside the container

* clean up docstring, try a new path to om_docker.sh

* uncomment the file moving lines I commented. doh

* tell mypy to ignore a line in om.py

* run the same model we're testing for build success

* Enable tests to run in docker with omc (#552)

* Modify GHE params (#537)

* remove connectors from ghe params

* modify test and ghe system param file

* update ghe parameters schema

* modify ghe parameters

* modify ghe parameters

* add system parameter files for borehole test

* update example files

* update example files for model connectors

* add ets 5th gen params

* add array for ghe geometry params

* remove print statement from test

* Adds defaults and required fields for ghe_params and 5th gen ets params

---------

Co-authored-by: Nicholas Long <[email protected]>

* incremental updates, bouncingball should work

* refactor the run in docker command

* symlink mbl when running om.py

* update the signature of the run_in_docker command.

* mypy updates

* remove optimica vars and enable running simulations

* do not run simulations on windows

* update lock files

* update poetry, cleanup results to not include c code

* fix boreholefield build, run still fails--ignoring

* mark spawn and teaser models as failing. There are errors reported even though the mat file is created

* udpate create_mbl_mount bash function to get mbl path in a better way

* handle case where user downloads MBL and the Buildings path is one level higher

* update poetry lock

* dedent

* Dockerfile now builds image that works with ARM chips

* Update uo_des.py

---------

Co-authored-by: tanushree04 <[email protected]>
Co-authored-by: Nathan Moore <[email protected]>

---------

Co-authored-by: jiazhenling <[email protected]>
Co-authored-by: Nicholas Long <[email protected]>
Co-authored-by: tanushree04 <[email protected]>
Co-authored-by: Nicholas Long <[email protected]>
* capacitor template from zhanwei and code to render it

* refactor to reduce line-length

* add minimal capacitor examples to microgrid test sys-param

* new test for creating a capacitor model from template

* district battery template and code

* test for building district battery from template

* generator code and template

* update microgrid test sys-param file to include building generators

* test for building a generator model

* reformat simple_gmt_base.py to shorten line length

* clarify variables in generator code

* template and code for electrical grid

* updated micrigrid example sys-param to include electrical grid params

* add test for creating grid model

* inductive load template and code

* microgrid sys-params for ac inductive loads

* test for building inductive load model

* simplify `within` statement because the models are still simple

* fix ACLine template to work with OM

* capitalize Inductive.py (and change test call to it) to make github happy

* also capitalizing Battery.py and changing the test to match

* additional parameters for capacitors so simulations succeed on OM

---------

Co-authored-by: Nicholas Long <[email protected]>
* prep release

* add changelog
* Add support for Python 3.11 (#518)

* adjust dependency versions to support python 3.11

* skip compilation and simulation tests in tox env

* update ci for python 3.11

* change asserts to if/raise statements in modelica_runner

* ugh, forgot to change the test when I changed the assertions

* update poetry version in ci

* `poetry update`

* specify ports for each time series building in instance template (#525)



* update license language (#529)

* add max_electrical_load to building sys-param data (#530)

* add max_electrical_load to building sys-param data

* alphabetize some template sys-param entries

* Modifications for GHE  (#526)

* Add GHE properties to system parameter

* add ghe parameters

* add end of file line

* Add test

* modify schema

* additional properties

* run precommit

* add description and default

* pre-commit

* add schema changes

* edit default

---------



* update dependency versions (#534)

* Removing remaining tox calls (#535)

* removing remaining tox parts

* `poetry update`

---------



* pre-commit has been running on all checks already (#538)

* Add Level 1 5G DES system (#539)

* update dependency versions

* initial files added for creating 5g system from existing load files

* fix path type, ignore for now

* fix types on methods, bump to python 3.8 (#540)

* fix types on methods, bump to python 3.8

* update ci exclude

* add in directory to the mos copying

* systemparameter needs to use the same data... favor param_template over data.

* expose nBui to set correctly

* default to openmodelica and fix space check in file name

* Set SWH peak to 1/10th of space heating or min 5000W (#542)

* set swh peak to one-tenth of space heating or min 5000W

* max/min are hard

* Update geojson_modelica_translator/modelica/GMT_Lib/DHC/DHC_5G_waste_heat_GHX.py

* Update geojson_modelica_translator/modelica/GMT_Lib/DHC/DHC_5G_waste_heat_GHX.py



* float precision is not needed. now using int instead

* test for new int value in shw instead of float

* update dependencies

---------



* Issue511 ghe templates (#533)

* Add redeclaration of allowFlowReverseSer=true

* Inital implementation of district system template with single GHE

* Add modified GroundTemperatureResponse class to overwrite MBL

* Initial implementation of OneUTube and PartialBorefield templates

* Fix bug of inconsistent template name and Modelica class name of BuildingTimeSeries

* Update system template, removed temperature sensors

* District energy test file that has multiple buildings

* Add comment and test version control with VSCode

* Add declaration of borefield data parameters

* Add template for TwoUTubes borefield

* Remove unneeded mo files

* Modify input field names based on schema

* Change within statement

* Initial implementation of borefield.py

* Conversion of shank spacing

* Modify shank spacing conversion

* Remove unneeded mo file

* Minor changes to model_name

* Add system template for testing borefield template

* Initial implementation of borefield test

* Move ghe system parameter files to right location

* Take out SingleGHE system template for now

* Change within statement

* Initial implementation of borefield coupling

* Add code to point to BorefieldSystem.mot

* Remove duplicated test script

* Rename package

* Add {%endraw%} at the end

* Add input fields needed for the test

* Debugging changes

* Add borefield_instance.mopt

* Changes for debugging, now the test passes

* Add borehole_length to example system params file

* Debug PartialBorefield.mot, it passes check

* Change coupling definitions

* Minor changes

* Remove partial template models

* Add sample g-function and path

* Reverting 3 system params files

* pre-commit now with more modelica-fmt

* Apply uniform 5G district system template

* Remove unused GHE district template

* Fix for non-ghe 5G districts

---------



* Add MOS file wrapper and size the 5G mass flow rate (#548)

* new class for reading mos file variables

* add mf sizing and expose plant mass flow variable

* fix typing warning for round

* reduce delta t to 10C

* reduce delta t to 5C

* Add OpenModelica compatibility (#516)

* updating plant components to work with OpenModelica

* add "each" to array of parameters. first pass

* remove nports count setting for OM

* bump requests version to remove RequestsDependencyWarning about charset_normalizer

* `poetry update`

* redeclare the correct building class in 5G timeseries template

* `allowFlowReversal` in timeseries_instance to make OM solver happy

* put FlowReversal only in the 5g part of TimeSeries_Instance

* lower 5G building hot water supply/return temps

* restore nports=1 for 4g timeseries buildings

* allowFlowReversal=true in heat exchanger

* add within statement at top of getPeakMassFlowRate.mo

* read getPeakMassFlowRate.mo as a template, so we can have the model name added properly

* add spaces around project_name in mft template

* add allowFlowReversal=true to all 4G timeseries buildings

* allowFlowReversal=true in network2pip_instance [skip-ci]

* set all remaining allowFlowReversal=true [ci skip]

* tell modelica formatter to ignore getPeakMassFlowRate.mo because of failures

* change getPeakMassFlowRate.mo to *.mot, reactivate modelica-fmt on it

* oops, look for new filename [ci-skip]

* remove commented code [skip ci]

* add Medium redeclaration in MFT template

* add OM files folder

* All_spawn_models

* Teaser Single worked

* add timeseries output nodes to make OM happy

* allow flow reversal in spawn building

* relax thermal zone constraint in teaser

* properly check for chp in sys param file

* fix double appending of heating plant when no chp to package.order

* pre-commit on Jiazhen's temp files for OM testing; remove some spawn-single files

* remove requirements.txt check from pre-commit, since we don't use that

* `poetry update`

* Spawn and Teaser changes

* pre-commit formatted Jiazhens modelica files

* hardcode numberofchillers=2 as a hack because OM does not do dot access

* add `allowFlowReversal=true` to spawn load instance

* hack in the hardcoded numberofchillers to make OM happy

* update 5g sys-param file to use 5g ets params

* add district 5g timeseries test

* `poetry update`

* add `.pytest_cache` to gitignore

* update mft connect statements to work in OM

* remove commented template code

* get 5g districts of multiple buildings working

* remove test models from Jiazhen

* `poetry update`

* use newer version of poetry in ci

* remove redundant `precommit` test env from CI matrix

* remind poetry that we only support python >=3.9 now

* `poetry update`

* use newest poetry patch in ci

* autopep8

---------



* Modify GHE params (#537)

* remove connectors from ghe params

* modify test and ghe system param file

* update ghe parameters schema

* modify ghe parameters

* modify ghe parameters

* add system parameter files for borehole test

* update example files

* update example files for model connectors

* add ets 5th gen params

* add array for ghe geometry params

* remove print statement from test

* Adds defaults and required fields for ghe_params and 5th gen ets params

---------



* Fixing borefield test breaks due to schema changes (#550)

* Add redeclaration of allowFlowReverseSer=true

* Inital implementation of district system template with single GHE

* Add modified GroundTemperatureResponse class to overwrite MBL

* Initial implementation of OneUTube and PartialBorefield templates

* Fix bug of inconsistent template name and Modelica class name of BuildingTimeSeries

* Update system template, removed temperature sensors

* District energy test file that has multiple buildings

* Add comment and test version control with VSCode

* Add declaration of borefield data parameters

* Add template for TwoUTubes borefield

* Remove unneeded mo files

* Modify input field names based on schema

* Change within statement

* Initial implementation of borefield.py

* Conversion of shank spacing

* Modify shank spacing conversion

* Remove unneeded mo file

* Minor changes to model_name

* Add system template for testing borefield template

* Initial implementation of borefield test

* Move ghe system parameter files to right location

* Take out SingleGHE system template for now

* Change within statement

* Initial implementation of borefield coupling

* Add code to point to BorefieldSystem.mot

* Remove duplicated test script

* Rename package

* Add {%endraw%} at the end

* Add input fields needed for the test

* Debugging changes

* Add borefield_instance.mopt

* Changes for debugging, now the test passes

* Add borehole_length to example system params file

* Debug PartialBorefield.mot, it passes check

* Change coupling definitions

* Minor changes

* Remove partial template models

* Add sample g-function and path

* Reverting 3 system params files

* pre-commit now with more modelica-fmt

* Apply uniform 5G district system template

* Remove unused GHE district template

* Fix for non-ghe 5G districts

* Delete sys_param files not needed

* Replace Gfunction input with csv file

* Point to the right sys_param file

* Updated template to reflect schema changes

* Changes for the test to run

* Fix backslashes

* Change to adapt to recent commits

* Temporary fixes to make the test pass

* Change ghe_dir to relative path

* Use pathlib to handle ghe_dir

* Add if statement to avoid breaking other 5G tests

* Change due to schema change

* Pre-commit changes

* Fix bug

---------



* Updating GHE Parameters: Modifying GHE Parameters schema and example files (#551)

* remove loads as required

* add objects for unique ghe properties

* update ghe specific schema objects

* add borehole to ghe specific properties

* update schema and example to not require autopopulated fields

* update to relative path

* update model connector examples

* Fix borefield test breaks due to the schema changes in issue #551 (#554)

* Add redeclaration of allowFlowReverseSer=true

* Inital implementation of district system template with single GHE

* Add modified GroundTemperatureResponse class to overwrite MBL

* Initial implementation of OneUTube and PartialBorefield templates

* Fix bug of inconsistent template name and Modelica class name of BuildingTimeSeries

* Update system template, removed temperature sensors

* District energy test file that has multiple buildings

* Add comment and test version control with VSCode

* Add declaration of borefield data parameters

* Add template for TwoUTubes borefield

* Remove unneeded mo files

* Modify input field names based on schema

* Change within statement

* Initial implementation of borefield.py

* Conversion of shank spacing

* Modify shank spacing conversion

* Remove unneeded mo file

* Minor changes to model_name

* Add system template for testing borefield template

* Initial implementation of borefield test

* Move ghe system parameter files to right location

* Take out SingleGHE system template for now

* Change within statement

* Initial implementation of borefield coupling

* Add code to point to BorefieldSystem.mot

* Remove duplicated test script

* Rename package

* Add {%endraw%} at the end

* Add input fields needed for the test

* Debugging changes

* Add borefield_instance.mopt

* Changes for debugging, now the test passes

* Add borehole_length to example system params file

* Debug PartialBorefield.mot, it passes check

* Change coupling definitions

* Minor changes

* Remove partial template models

* Add sample g-function and path

* Reverting 3 system params files

* pre-commit now with more modelica-fmt

* Apply uniform 5G district system template

* Remove unused GHE district template

* Fix for non-ghe 5G districts

* Delete sys_param files not needed

* Replace Gfunction input with csv file

* Point to the right sys_param file

* Updated template to reflect schema changes

* Changes for the test to run

* Fix backslashes

* Change to adapt to recent commits

* Temporary fixes to make the test pass

* Change ghe_dir to relative path

* Use pathlib to handle ghe_dir

* Add if statement to avoid breaking other 5G tests

* Change due to schema change

* Pre-commit changes

* Fix bug

* Changes due to schema change

---------



---------




* Enable compile & simulate with OpenModelica in Docker (#545)

* updating plant components to work with OpenModelica

* add "each" to array of parameters. first pass

* remove nports count setting for OM

* bump requests version to remove RequestsDependencyWarning about charset_normalizer

* `poetry update`

* redeclare the correct building class in 5G timeseries template

* `allowFlowReversal` in timeseries_instance to make OM solver happy

* put FlowReversal only in the 5g part of TimeSeries_Instance

* lower 5G building hot water supply/return temps

* restore nports=1 for 4g timeseries buildings

* allowFlowReversal=true in heat exchanger

* add within statement at top of getPeakMassFlowRate.mo

* read getPeakMassFlowRate.mo as a template, so we can have the model name added properly

* add spaces around project_name in mft template

* add allowFlowReversal=true to all 4G timeseries buildings

* allowFlowReversal=true in network2pip_instance [skip-ci]

* set all remaining allowFlowReversal=true [ci skip]

* tell modelica formatter to ignore getPeakMassFlowRate.mo because of failures

* change getPeakMassFlowRate.mo to *.mot, reactivate modelica-fmt on it

* oops, look for new filename [ci-skip]

* remove commented code [skip ci]

* add Medium redeclaration in MFT template

* add OM files folder

* All_spawn_models

* Teaser Single worked

* add timeseries output nodes to make OM happy

* allow flow reversal in spawn building

* relax thermal zone constraint in teaser

* properly check for chp in sys param file

* fix double appending of heating plant when no chp to package.order

* pre-commit on Jiazhen's temp files for OM testing; remove some spawn-single files

* remove requirements.txt check from pre-commit, since we don't use that

* `poetry update`

* Spawn and Teaser changes

* pre-commit formatted Jiazhens modelica files

* hardcode numberofchillers=2 as a hack because OM does not do dot access

* add `allowFlowReversal=true` to spawn load instance

* hack in the hardcoded numberofchillers to make OM happy

* update 5g sys-param file to use 5g ets params

* add district 5g timeseries test

* `poetry update`

* add `.pytest_cache` to gitignore

* update mft connect statements to work in OM

* remove commented template code

* get 5g districts of multiple buildings working

* remove test models from Jiazhen

* `poetry update`

* use newer version of poetry in ci

* remove redundant `precommit` test env from CI matrix

* wip: OM Docker code partial setup. Needs at least more Dockerfile work

* remind poetry that we only support python >=3.9 now

* `poetry update`

* use newest poetry patch in ci

* autopep8

* ignore typing error, and temporarily(?) remove method argument

* om docker-compose yml file

* change call from `spawn_docker.sh` to `om_docker.sh`

* OM Dockerfile, and remove old Dockerfile

* update modelica_runner for OM and remove spawn references

* update python and shell scripts to run OM in Docker container

* remove files no longer necessary

* more updates for switch from spawn to OM

* update test regarding switch from spawn to OM

* re-enable a third cli argument for om.py in the container

* handle a third argument to the cli inside the container

* clean up docstring, try a new path to om_docker.sh

* uncomment the file moving lines I commented. doh

* tell mypy to ignore a line in om.py

* run the same model we're testing for build success

* Enable tests to run in docker with omc (#552)

* Modify GHE params (#537)

* remove connectors from ghe params

* modify test and ghe system param file

* update ghe parameters schema

* modify ghe parameters

* modify ghe parameters

* add system parameter files for borehole test

* update example files

* update example files for model connectors

* add ets 5th gen params

* add array for ghe geometry params

* remove print statement from test

* Adds defaults and required fields for ghe_params and 5th gen ets params

---------



* incremental updates, bouncingball should work

* refactor the run in docker command

* symlink mbl when running om.py

* update the signature of the run_in_docker command.

* mypy updates

* remove optimica vars and enable running simulations

* do not run simulations on windows

* update lock files

* update poetry, cleanup results to not include c code

* fix boreholefield build, run still fails--ignoring

* mark spawn and teaser models as failing. There are errors reported even though the mat file is created

* udpate create_mbl_mount bash function to get mbl path in a better way

* handle case where user downloads MBL and the Buildings path is one level higher

* update poetry lock

* dedent

* Dockerfile now builds image that works with ARM chips

* Update uo_des.py

---------




---------






* Enhance and expand microgrid templates and code (#549)

* capacitor template from zhanwei and code to render it

* refactor to reduce line-length

* add minimal capacitor examples to microgrid test sys-param

* new test for creating a capacitor model from template

* district battery template and code

* test for building district battery from template

* generator code and template

* update microgrid test sys-param file to include building generators

* test for building a generator model

* reformat simple_gmt_base.py to shorten line length

* clarify variables in generator code

* template and code for electrical grid

* updated micrigrid example sys-param to include electrical grid params

* add test for creating grid model

* inductive load template and code

* microgrid sys-params for ac inductive loads

* test for building inductive load model

* simplify `within` statement because the models are still simple

* fix ACLine template to work with OM

* capitalize Inductive.py (and change test call to it) to make github happy

* also capitalizing Battery.py and changing the test to match

* additional parameters for capacitors so simulations succeed on OM

---------



* Prepare 0.5 release (#556)

* prep release

* add changelog

---------

Co-authored-by: Nathan Moore <[email protected]>
Co-authored-by: tanushree04 <[email protected]>
Co-authored-by: Jing Wang <[email protected]>
Co-authored-by: jiazhenling <[email protected]>
* flag to not remove all output files

* fix typo in pytest mark

* dry code and change to pathlib where possible

* clarify variable name when deleting files

* enforce Path type to make mypy happier

* tell mypy to ignore a line

* make path windows-friendly, even though CI only uses it on linux

* move deletion of tmp folder to the container

---------

Co-authored-by: Nathan Moore <[email protected]>
* read electrical load from each building for microgrid model

* add test for microgrid electrical load simulation

* add logging to generators.py, and clarify comment

* remove incorrect fields from test microgrid sys-param file

* inductive loads use kW, capacitive loads use kVAr (reactive power)

* delete commented line from inductive.py

* skip inductive load simulation because OMC chokes. Dymola runs it fine
* upgrade poetry version in ci to 1.5.1

* surely upgrading dependencies won't help Poetry in the CI env, right?
* catch a ctrl-c and kill the docker container

* remove bash function to catch sigint because it's not the right place for that

* more pythonic docker kill command
* move package_parser to its own file

* add cspell workspace dictionary

* add cspell workspace dictionary

* fix mypy errors

* skip 2 tests that fail using OM 1.20

* remove unnecessary python enumerate command

* refactor: swap os. for Path in package_parser.py

* refactor: transform self.path to be a Path no matter what it came in as

* Revert "refactor: transform self.path to be a Path no matter what it came in as"

This reverts commit 092e386.

* Revert "refactor: swap os. for Path in package_parser.py"

This reverts commit 137b8c1.

---------

Co-authored-by: Nathan Moore <[email protected]>
* ghe_dir now works as expected for absolute path or relative to sys-param file

* expand comment on ghe_dir in schema to explain what works

* update test ghe sys-param file with new relative path

* add error handling for incorrect relative ghe_dir path
* New network model and its coupling

* Bug fix

* Refer to load ids in relevant couplings

* New coupling definitions

* Add test script for new template

* Avoid potential fail if more buildings added

* Changes due to new g-function csv format

* Format fixing

* Modify sys_params for new test

* Avoid overriding final parameters

* Revise relative path of ghe_dir

* Pre-commit changes

* fix ghe text syntax

* update borefield pytest skip reason with more detail

* make resources_dir relative path NOT platform-aware, so it will always work in Modelica

* Revert "make resources_dir relative path NOT platform-aware, so it will always work in Modelica"

This reverts commit 845b190.

* Change gfunction.mat path to modelica path

* pre-commit changes

---------

Co-authored-by: Nathan Moore <[email protected]>
vtnate and others added 28 commits December 15, 2023 11:50
* fix(modelica_runner): Replace shell script with call directly to docker (#606)

* fix(modelica_runner): Replace shell script with call directly to docker

* fix(dockerfile): Update the base OM docker image

* use f-string for new docker command

* update dependencies

* comment to update MBL version in modelica-builder as well as Dockerfile when needed

* put exec call into list format for subprocess.Popen

* run simulations on Windows (shocked face!!)

* remove test for old om_docker_path

* remove oudated code from ModelicaRunner.init()

* remove outdated assert in modelica test file

* don't forget to remove the  dir from the model dir after simulation

* use new container that has OMv1.22.1, MBLv10, and MSLv4

* use pathlib for path component instead of os

* go back to only running simulations on Linux :(

* run_path has already been verified to be a Path. Make mypy happy.

* use GHA-style if-syntax

* use MBL tag instead of branch, and clean up call to install it

* change permissions in tmp folder to allow deletion

* temporarily run a very small CI config

* give myself even more permissions to try to delete tmp dir

* use .run method of subprocess instead of Popen

* move tmp dir deletion to the subprocess call method

* TMP: change CI to only run a single test for temporary testing

* chmod the offending dir

* move tmp deletion back to cleanup where it should be

* logging for the GHA runner

* ugh, different logging for GHA runner

* use exists() instead of is_dir(), just for grins

* grant write permissions to CI in the runner

* comment single dir permissions change

* another way of deleting tmp file/dir

* ugh, forgotten bit of text

* change permissions on tmp dir before deletion

* get more nuclear about deleting tmp dir

* clean up comments for removing tmp dir

* re-enable full test suite in CI

* clean up ci file a teeny bit more

* test simulations on Windows again

* Revert "test simulations on Windows again"

This reverts commit e25a5c3.

* Revert "clean up ci file a teeny bit more"

This reverts commit e3f00e2.

---------

Co-authored-by: Chris Mackey <[email protected]>
* GHA to automatically publish to pypi when making release in github

* rename pypi release config yml file to avoid confusion with changelog config file

* new alpha version of gmt for testing automatic pypi release workflow
* getting_started and developer_resources updated for GMTv0.5.0 [skip ci]

* minor docs changes as I think about it more [skip ci]

* docs to show we now support Windows!

* update copyright

* spelling

* eg with commas

---------

Co-authored-by: Nicholas Long <[email protected]>
* update pre-commit hooks with `pre-commit autoupdate`

* support python 3.12

* update dependencies

* run tests on python 3.12

* tell pypi we support python 3.12

* autopep8

* don't reformat a long line because it makes the quotes weird

* don't reformat another long line because it makes the quotes weird

* point to develop branch of modelica-builder now that 3.12 support has been merged

* update dependencies

* use new release of geojson that supportys python 3.12

* update dependencies with `poetry update`

* update dependencies

* update dependencies

* use newly released version of modelica-builder

* update dependencies

* use a branch of modelica-builder

* update dependencies

* bump versions of actions in pypi_release workflow. inconsequential.

* use new patch version of modelica-builder so models build properly

---------

Co-authored-by: Nicholas Long <[email protected]>
* add mypy cache to gitignore

* fix typo in cli usage instructions

* update cli error message to match current simulations results path

* more log output, cleaner comments, remove abandoned code

* clean up log output in modelica_runner

* correct filepath for CLI success confirmation message

* add log output for users when starting docker container

* rename `...OBC.CDL.Continuous` to `...OBC.CDL.Reals`

* use MBLv10 in CI

* use new preconfigured fan model, which extends the 9.1 one

* remove deprecated (incorrect) mbl path in 5g load template

* use MBLv10 in mofile and package template files

* use branch of modelica-builder that uses mblv10

* remove TRooHea_nominal and replace QRooHea_flow_nominal with QEnv_flow_nominal

* NEW CONFIG: set mbl_version in utils.py

* pass mbl_version to PackageParser when generating top-level package.mo

* `poetry update` to read modelica-builder from git branch during development

* add note in developer docs to check mbl_version() when releasing the gmt [skip ci]

* remove `extends` that is no longer used in mblv10

* OM can't handle more than 1 dot-level deep, so 'temporarily' hardcode this

* properly define QEnv_flow_nominal

* update dependencies

* update dependencies, mainly to use the correct m-b branch

* use OMv1.22 in dockerfile

* adjust 5G building template to always have_hotWat to work with mblv10

* reduce pressure drop in 5G pipes for mblv10

* one more hav_hotWat that was missed earlier

* remove unnecessary portion of if-statement in model_base

* remove outdated line from load_base docstring

* `poetry update`

* give SHW a load in the test mos file

* another little tweak to help 5G work with MBLv10

* add fake SHW load to work around MBL... "issue"

* update instance templates for MBLv10 compatibility

* use more realistic initial values for GHE system

* fix regular 5G model to work with MBLv10

* include forgotten ghe borehole sys-param data

* add dhDis & dhCon to gmt_lib templates too

* add fake SHW load to more test load .mos files

* another place where MBL path changed

* update readme for building and releasing the gmt-om-runner

* add fake SHW data to cli test data

* use OM-versioned docker image

* update dependencies

* update cooling plant instance and partial plant parallel for MBLv10

* new mblv10 classes for central boilers

* hard-code some heating pump parameters so OM can handle it

* update dependencies

* change signals & connections for MBLv10

* skip test because it only works with qss solver, not dassl

* merge `unskip-tests` branch into this one

* skip teaser tests for now

* update dependencies

* use MBLv10 in CI

* use MBLv10 in Dockerfile

* update dependencies

* don't set  in chp file when it's already done in MBL

* skip gmt_lib_des OM simulations until we get help from LBNL

* more useful skip reason for CHP test

* om.py was somehow incorrectly kept when merging from develop. Remove it again

* point to a Docker container with MBLv10.0

* make Dockerfile comment a little more permissive to match the code

* fix typo in skip reason text

* update versioning of gmt runner image

* precommit

* handle arbitrary number of buildings in 5G districts

* use 100 for pressure drop. only breaks district_single_ghe

* revert ghe flow rate to 0.2 as originally intended

* use 250 for nominal pressure drop as is appropriate

* hard-code the district pump head pressure. Fix later

* use newly released version of modelica-builder

* remove commented code

---------

Co-authored-by: Nicholas Long <[email protected]>
* Add nominal pump head to parameter file

* Read district pump head from parameter file

* Add to more test parameter files

* update central pump parameters

* adds central pump parameter

* use new required district param in more test files

---------

Co-authored-by: Tanushree <[email protected]>
Co-authored-by: Nathan Moore <[email protected]>
* fix CHP model for MBLv10

* re-enable CHP test for a short simulation duration

* remove unnecessary dhCon & dhDis from templates

* use Ubuntu 20 in Dockerfile

* bump version of dockerfile

* use new docker image

* re-enable gmt_lib tests now that we are using ubuntu 20

* bump to real version 0.6.0

* break out cert download to be a file and update readme

---------

Co-authored-by: Nicholas Long <[email protected]>
* add deployment instructions

* update README to markdown

* update authors to be markdown

* move CHANGELOG to md

* move m2r2 to dev dep

* remove rpds-py

* remove linebreaks

* cleanup

* Fix modelicafmt overriding CHANGELOG and README (#616)

* older version of r2m2

* remove r2m2

* remove r2m2

* 3.12.1

* rpds-py

* do not use precommit action

* do not extract readme and changelog from modelicafmt

* add back in r2m2

* note
* remove outdated references to JModelica

* update docs release instructions
* clarify code and documentation in cli a bit

* fix cli test to work with proper `optional` syntax

* more help text for cli options
* use ruff for linting & formatting

* make the sys-param schema file not executable

* gitignore ruff_cache

* update ruff versions, use new mofmt repo

* remove autopep8 from dev dependencies

* remove isort config from pyproject

* first pass of ruff formatting & linting

* more formatting & linting

* fix SystemExit text after change to keep matching test

* restore correct if-statement nesting

* make both mypy and formatting happy for these assertions

* upgrade ruff to v0.2.1

* move `fix` out of `tool.ruff.lint`

* more ruff config tweaking

* cleaner use of ruff in pre-commit-config

* ruff auto-formatting in cli

* remove formatting from a block of code

* different style of building template_data dict

* update dependencies

* bump ruff version via `pre-commit autoupdate`

* formatting change from new ruff version
* specify units for ghe flow_rate in schema

* change ghe flow_rate to be in liters/second as GHED expects

* remove unit for ghe flow_type, which was a typo
* add `cop_heat_pump_cooling` to required 5G ets params

* change how we specify which type of district system to consider

* put all time_series sys-param template data into one file

* remove now-outdated microgrid sys-param template

* update cli to use new paradigm for specifying district type

* update tests to use new system type designation
* workaround code to put a value in the DHW column if it is all zeroes

* add logging for dhw patch hack

* add workaround logging and make it slightly more flexible

* implement dhw workaround for MBLv10 bug

* use SHW patch from modelica-builder

* remove SHW patch method definition from GMT

* remove logging config from utils.py

* change from quit to warn when loads are not found

* use non-deprecated logging style

* remove sometimes formatting of log messages. We can consider standardizing

* ugh, fix deprecated logging style the right way this time
* relax pandas version requirement

* update dependencies
* cleanup some codedoc

* precommit
* bump to version 0.6.1

* `poetry update` for dependencies

* update changelog
Required due to breaking changes in CLI
@vtnate vtnate self-assigned this May 6, 2024
@vtnate vtnate merged commit 0872d43 into main May 7, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants