Skip to content

Commit

Permalink
Merge pull request #103 from NREL/develop
Browse files Browse the repository at this point in the history
Release to main
  • Loading branch information
nllong authored May 6, 2022
2 parents e304679 + 4355a47 commit 3bb93db
Show file tree
Hide file tree
Showing 130 changed files with 1,569 additions and 2,319 deletions.
3 changes: 1 addition & 2 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
AllCops:
Exclude:
- 'spec/test_measures/**/*'

require: rubocop-performance
inherit_from:
- http://s3.amazonaws.com/openstudio-resources/styles/rubocop_v4.yml
- http://s3.amazonaws.com/openstudio-resources/styles/rubocop_v4.yml
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# OpenStudio Model Articulation Gems

## Version 0.6.0
* Support for OpenStudio 3.4 (upgrade to standards gem 0.2.16, no extension gem upgrade)
* Fixed [#92]( https://github.com/NREL/openstudio-model-articulation-gem/issues/92 ), SetWindowToWallRatio triangulation can produce non-planar surfaces
* Fixed [#94]( https://github.com/NREL/openstudio-model-articulation-gem/pull/94 ), fix SetWindowToWallRatio triangulation
* Fixed [#95]( https://github.com/NREL/openstudio-model-articulation-gem/pull/95 ), add warnings to SetWindowToWallRatio to categorize cases when WWR can't be applied
* Fixed [#98]( https://github.com/NREL/openstudio-model-articulation-gem/pull/98 ), Radiance Daylighting Measure - Update measure.rb
* Fixed [#101]( https://github.com/NREL/openstudio-model-articulation-gem/pull/101 ), setting building and space type standard to Blend

## Version 0.5.0
* Support for OpenStudio 3.3 (upgrade to extension gem 0.5.1 and standards gem 0.2.15)
* Fixed [#73]( https://github.com/NREL/openstudio-model-articulation-gem/pull/73 ), added add_empd_material_properties measure contributed by GFlechas
Expand Down
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ bundle exec rake openstudio:test_with_openstudio

|OpenStudio Model Articulation Gem|OpenStudio|Ruby|
|:--------------:|:----------:|:--------:|
| 0.6.0 | 3.4 | 2.7 |
| 0.5.0 | 3.3 | 2.7 |
| 0.4.0 - 0.4.2 | 3.2 | 2.7 |
| 0.3.0 - 0.3.1 | 3.1 | 2.5 |
Expand All @@ -63,14 +64,18 @@ Please review the [OpenStudio Contribution Policy](https://openstudio.net/openst

## TODO

- [ ] Move articulation measures from openstudio-measures
- [ ] Move articulation measure lib files to openstudio-extension lib
- [x] Move articulation measures from openstudio-measures
- [x] Move articulation measure lib files to openstudio-extension lib
- [ ] Update measures to correct naming conventions

# Releasing

* Update CHANGELOG.md
* Run `rake rubocop:auto_correct`
* Run `rake openstudio:rubocop:auto_correct`
* Run `rake openstudio:update_copyright`
* Run `rake openstudio:update_measures` (this has to be done last since prior tasks alter measure files)
* Update version in `readme.md`
* Update version in `openstudio-model-articulation.gemspec`
* Update version in `/lib/openstudio/model_articulation/version.rb`
* Create PR to master, after tests and reviews complete, then merge
* Locally - from the master branch, run `rake release`
Expand Down
20 changes: 10 additions & 10 deletions lib/measures/AssignConstructionSetToBuilding/measure.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<schema_version>3.0</schema_version>
<name>assign_construction_set_to_building</name>
<uid>6e68ddea-2cff-47a3-9daf-f2189e4cf132</uid>
<version_id>44de5d16-ee07-4122-bfd2-9b488da700f9</version_id>
<version_modified>20210423T142509Z</version_modified>
<version_id>497da6f8-f10e-4c93-b5de-6d46027f0119</version_id>
<version_modified>20220505T182919Z</version_modified>
<xml_checksum>1E963D9C</xml_checksum>
<class_name>AssignConstructionSetToBuilding</class_name>
<display_name>AssignConstructionSetToBuilding</display_name>
Expand All @@ -17,10 +17,10 @@
<type>Choice</type>
<required>true</required>
<model_dependent>false</model_dependent>
<default_value>{27349627-8827-46b4-80f7-4f0731404a8c}</default_value>
<default_value>{366b719d-cdcd-403e-82f2-1ff5eb23d1b8}</default_value>
<choices>
<choice>
<value>{27349627-8827-46b4-80f7-4f0731404a8c}</value>
<value>{366b719d-cdcd-403e-82f2-1ff5eb23d1b8}</value>
<display_name>&lt;clear field&gt;</display_name>
</choice>
</choices>
Expand Down Expand Up @@ -73,17 +73,17 @@
<usage_type>script</usage_type>
<checksum>40E5CA19</checksum>
</file>
<file>
<filename>AssignConstructionSetToBuilding_Test.rb</filename>
<filetype>rb</filetype>
<usage_type>test</usage_type>
<checksum>51FB4344</checksum>
</file>
<file>
<filename>LICENSE.md</filename>
<filetype>md</filetype>
<usage_type>license</usage_type>
<checksum>A21A3ED2</checksum>
</file>
<file>
<filename>AssignConstructionSetToBuilding_Test.rb</filename>
<filetype>rb</filetype>
<usage_type>test</usage_type>
<checksum>EAEB5017</checksum>
</file>
</files>
</measure>
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
require 'openstudio/measure/ShowRunnerOutput'
require 'fileutils'

require_relative '../measure.rb'
require_relative '../measure'
require 'minitest/autorun'

class AssignConstructionSetToBuilding_Test < Minitest::Test
Expand All @@ -50,7 +50,7 @@ def test_AssignConstructionSetToBuilding

# load the test model
translator = OpenStudio::OSVersion::VersionTranslator.new
path = OpenStudio::Path.new(File.dirname(__FILE__) + '/LargeHotel.osm')
path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/LargeHotel.osm")
model = translator.loadModel(path)
assert(!model.empty?)
model = model.get
Expand Down Expand Up @@ -87,7 +87,7 @@ def test_AssignConstructionSetToBuilding_clear

# load the test model
translator = OpenStudio::OSVersion::VersionTranslator.new
path = OpenStudio::Path.new(File.dirname(__FILE__) + '/LargeHotel.osm')
path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/LargeHotel.osm")
model = translator.loadModel(path)
assert(!model.empty?)
model = model.get
Expand Down
36 changes: 27 additions & 9 deletions lib/measures/AssignSpaceTypeBySpaceName/measure.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<schema_version>3.0</schema_version>
<name>assign_space_type_by_space_name</name>
<uid>69ad41bb-cdfe-4a4c-a385-9efaf35b7c27</uid>
<version_id>b6bc9d20-d8d1-4319-8cd1-c9e9afdb9773</version_id>
<version_modified>20210423T142509Z</version_modified>
<version_id>e60a2200-a654-4e1c-95fb-b19533ffb96b</version_id>
<version_modified>20220505T182934Z</version_modified>
<xml_checksum>057E8D9D</xml_checksum>
<class_name>AssignSpaceTypeBySpaceName</class_name>
<display_name>AssignSpaceTypeBySpaceName</display_name>
Expand All @@ -24,10 +24,10 @@
<type>Choice</type>
<required>true</required>
<model_dependent>false</model_dependent>
<default_value>{12c3c432-4def-4ca1-bfc7-8cecc9e88d88}</default_value>
<default_value>{ef3c55b4-9cb7-451d-8c82-00a6d685c59f}</default_value>
<choices>
<choice>
<value>{12c3c432-4def-4ca1-bfc7-8cecc9e88d88}</value>
<value>{ef3c55b4-9cb7-451d-8c82-00a6d685c59f}</value>
<display_name>&lt;clear field&gt;</display_name>
</choice>
</choices>
Expand Down Expand Up @@ -98,17 +98,35 @@
<usage_type>script</usage_type>
<checksum>6A6F122F</checksum>
</file>
<file>
<filename>LICENSE.md</filename>
<filetype>md</filetype>
<usage_type>license</usage_type>
<checksum>A21A3ED2</checksum>
</file>
<file>
<filename>AssignSpaceTypeBySpaceName_Test.rb</filename>
<filetype>rb</filetype>
<usage_type>test</usage_type>
<checksum>EA4BB066</checksum>
<checksum>4302B4E5</checksum>
</file>
<file>
<filename>LICENSE.md</filename>
<filetype>md</filetype>
<usage_type>license</usage_type>
<checksum>A21A3ED2</checksum>
<filename>ImportedIdf_TestModel/project.log</filename>
<filetype>log</filetype>
<usage_type>test</usage_type>
<checksum>6D480771</checksum>
</file>
<file>
<filename>ImportedIdf_TestModel/run.db</filename>
<filetype>db</filetype>
<usage_type>test</usage_type>
<checksum>BF4974CA</checksum>
</file>
<file>
<filename>ImportedIdf_TestModel/project.osp</filename>
<filetype>osp</filetype>
<usage_type>test</usage_type>
<checksum>19B74631</checksum>
</file>
</files>
</measure>
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
require 'openstudio/measure/ShowRunnerOutput'
require 'fileutils'

require_relative '../measure.rb'
require_relative '../measure'
require 'minitest/autorun'

class AssignSpaceTypeBySpaceName_Test < Minitest::Test
Expand All @@ -50,7 +50,7 @@ def test_AssignSpaceTypeBySpaceName_skipAssigned

# load the test model
translator = OpenStudio::OSVersion::VersionTranslator.new
path = OpenStudio::Path.new(File.dirname(__FILE__) + '/ImportedIdf_TestModel.osm')
path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/ImportedIdf_TestModel.osm")
model = translator.loadModel(path)
assert(!model.empty?)
model = model.get
Expand Down Expand Up @@ -95,7 +95,7 @@ def test_AssignSpaceTypeBySpaceName

# load the test model
translator = OpenStudio::OSVersion::VersionTranslator.new
path = OpenStudio::Path.new(File.dirname(__FILE__) + '/ImportedIdf_TestModel.osm')
path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/ImportedIdf_TestModel.osm")
model = translator.loadModel(path)
assert(!model.empty?)
model = model.get
Expand Down
20 changes: 10 additions & 10 deletions lib/measures/AssignSpaceTypeToBuilding/measure.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<schema_version>3.0</schema_version>
<name>assign_space_type_to_building</name>
<uid>05e20922-6fe4-48a4-bddb-411f8167e757</uid>
<version_id>0ca1ef7f-22e8-4e62-b013-a4d40186aeb0</version_id>
<version_modified>20210423T142509Z</version_modified>
<version_id>affc7390-ec3e-41fb-a814-adc09ac4ab80</version_id>
<version_modified>20220505T182919Z</version_modified>
<xml_checksum>057E8D9D</xml_checksum>
<class_name>AssignSpaceTypeToBuilding</class_name>
<display_name>AssignSpaceTypeToBuilding</display_name>
Expand All @@ -17,10 +17,10 @@
<type>Choice</type>
<required>true</required>
<model_dependent>false</model_dependent>
<default_value>{4d195512-5588-4038-a932-f9e242e346a6}</default_value>
<default_value>{045b3260-33ad-451f-9c68-f8e75c422740}</default_value>
<choices>
<choice>
<value>{4d195512-5588-4038-a932-f9e242e346a6}</value>
<value>{045b3260-33ad-451f-9c68-f8e75c422740}</value>
<display_name>&lt;clear field&gt;</display_name>
</choice>
</choices>
Expand Down Expand Up @@ -73,17 +73,17 @@
<usage_type>script</usage_type>
<checksum>C904ACC5</checksum>
</file>
<file>
<filename>AssignSpaceTypeToBuilding_Test.rb</filename>
<filetype>rb</filetype>
<usage_type>test</usage_type>
<checksum>0DA553E5</checksum>
</file>
<file>
<filename>LICENSE.md</filename>
<filetype>md</filetype>
<usage_type>license</usage_type>
<checksum>A21A3ED2</checksum>
</file>
<file>
<filename>AssignSpaceTypeToBuilding_Test.rb</filename>
<filetype>rb</filetype>
<usage_type>test</usage_type>
<checksum>E998ED20</checksum>
</file>
</files>
</measure>
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
require 'openstudio/measure/ShowRunnerOutput'
require 'fileutils'

require_relative '../measure.rb'
require_relative '../measure'
require 'minitest/autorun'

class AssignSpaceTypeToBuilding_Test < Minitest::Test
Expand All @@ -50,7 +50,7 @@ def test_AssignSpaceTypeToBuilding

# load the test model
translator = OpenStudio::OSVersion::VersionTranslator.new
path = OpenStudio::Path.new(File.dirname(__FILE__) + '/LargeHotel.osm')
path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/LargeHotel.osm")
model = translator.loadModel(path)
assert(!model.empty?)
model = model.get
Expand Down Expand Up @@ -87,7 +87,7 @@ def test_AssignSpaceTypeToBuilding_clear

# load the test model
translator = OpenStudio::OSVersion::VersionTranslator.new
path = OpenStudio::Path.new(File.dirname(__FILE__) + '/LargeHotel.osm')
path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/LargeHotel.osm")
model = translator.loadModel(path)
assert(!model.empty?)
model = model.get
Expand Down
6 changes: 2 additions & 4 deletions lib/measures/AssignSpacesToStories/measure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,8 @@ def run(model, runner, user_arguments)
def getStoryForNominalZCoordinate(model, minz)
model.getBuildingStorys.each do |story|
z = story.nominalZCoordinate
if !z.empty?
if minz.round(2) == z.get.round(2)
return story
end
if !z.empty? && (minz.round(2) == z.get.round(2))
return story
end
end

Expand Down
20 changes: 10 additions & 10 deletions lib/measures/AssignSpacesToStories/measure.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<schema_version>3.0</schema_version>
<name>assign_spaces_to_stories</name>
<uid>2c91fe40-db31-4334-a1dd-817cd419f1b6</uid>
<version_id>6f11b9e3-a0c0-4624-8270-e6989aa85b98</version_id>
<version_modified>20210423T142509Z</version_modified>
<version_id>4e02a25e-c2d0-4dbe-8359-0cc52c0d0930</version_id>
<version_modified>20220505T182936Z</version_modified>
<xml_checksum>45097B60</xml_checksum>
<class_name>AssignSpacesToStories</class_name>
<display_name>AssignSpacesToStories</display_name>
Expand Down Expand Up @@ -47,6 +47,12 @@
<usage_type>readme</usage_type>
<checksum>8BA985AD</checksum>
</file>
<file>
<filename>LICENSE.md</filename>
<filetype>md</filetype>
<usage_type>license</usage_type>
<checksum>A21A3ED2</checksum>
</file>
<file>
<version>
<software_program>OpenStudio</software_program>
Expand All @@ -56,19 +62,13 @@
<filename>measure.rb</filename>
<filetype>rb</filetype>
<usage_type>script</usage_type>
<checksum>43120824</checksum>
<checksum>F3B0D790</checksum>
</file>
<file>
<filename>AssignSpacesToStories_Test.rb</filename>
<filetype>rb</filetype>
<usage_type>test</usage_type>
<checksum>D0D1E059</checksum>
</file>
<file>
<filename>LICENSE.md</filename>
<filetype>md</filetype>
<usage_type>license</usage_type>
<checksum>A21A3ED2</checksum>
<checksum>2D0ACAFB</checksum>
</file>
</files>
</measure>
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
require 'openstudio/measure/ShowRunnerOutput'
require 'fileutils'

require_relative '../measure.rb'
require_relative '../measure'
require 'minitest/autorun'

class AssignSpacesToStories_Test < Minitest::Test
Expand All @@ -50,7 +50,7 @@ def test_AssignSpacesToStories

# load the test model
translator = OpenStudio::OSVersion::VersionTranslator.new
path = OpenStudio::Path.new(File.dirname(__FILE__) + '/AssignSpacesToStories_SimpleTestModel.osm')
path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/AssignSpacesToStories_SimpleTestModel.osm")
model = translator.loadModel(path)
assert(!model.empty?)
model = model.get
Expand Down
3 changes: 2 additions & 1 deletion lib/measures/BarAspectRatioStudy/measure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ def run(model, runner, user_arguments)
end

# helper to make numbers pretty (converts 4125001.25641 to 4,125,001.26 or 4,125,001). The definition be called through this measure.
def neat_numbers(number, roundto = 2) # round to 0 or 2)
# round to 0 or 2)
def neat_numbers(number, roundto = 2)
if roundto == 2
number = format '%.2f', number
else
Expand Down
Loading

0 comments on commit 3bb93db

Please sign in to comment.