Skip to content

Commit 866cf07

Browse files
authored
Merge pull request #141 from NREL/develop
Version 0.10.0 Release
2 parents 4737673 + 8f87d90 commit 866cf07

67 files changed

Lines changed: 2281 additions & 4676 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# OpenStudio Model Articulation Gems
22

3+
## Version 0.10.0
4+
* Support for OpenStudio 3.8 (upgrade to standards gem 0.6.0, extension gem 0.8.0)
5+
* Support Ruby 3.2.2
6+
37
## Version 0.9.0
48
* Support for OpenStudio 3.7 (upgrade to standards gem 0.5.0, extension gem 0.6.0)
59
* Fixed [#128]( https://github.com/NREL/openstudio-model-articulation-gem/pull/128 ), fix infiltration design day schedule inversion

Gemfile

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,16 @@ gemspec
1111
# checkout the latest version (develop) from github.
1212
allow_local = ENV['FAVOR_LOCAL_GEMS']
1313

14+
# Delete when these branchesa are merged and released
15+
# gem 'openstudio-extension', github: 'NREL/OpenStudio-extension-gem', branch: 'wenyi-bypass-zlib'
16+
# gem 'openstudio-standards', github: 'NREL/openstudio-standards', tag: 'v0.6.0.rc2', ref: "1c42110"
17+
# gem 'openstudio_measure_tester', :git => 'https://github.com/NREL/OpenStudio-measure-tester-gem.git', :branch => 'wenyi-dependencies-update'
18+
# gem 'openstudio-workflow', :git => 'https://github.com/NREL/OpenStudio-workflow-gem.git', :branch => 'develop', ref: "32126e9b9f6"
19+
# gem 'bcl', :git => 'https://github.com/wenyikuang/bcl-gem.git', :branch => 'develop'
20+
1421
# Only uncomment if you need to test a different version of the extension gem
15-
# if allow_local && File.exist?('../OpenStudio-extension-gem')
16-
# gem 'openstudio-extension', path: '../OpenStudio-extension-gem'
17-
# elsif allow_local
18-
# gem 'openstudio-extension', github: 'NREL/OpenStudio-extension-gem', branch: 'develop'
19-
# end
22+
if allow_local && File.exist?('../OpenStudio-extension-gem')
23+
gem 'openstudio-extension', path: '../OpenStudio-extension-gem'
24+
elsif allow_local
25+
gem 'openstudio-extension', github: 'NREL/OpenStudio-extension-gem', branch: 'develop'
26+
end

Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//Jenkins pipelines are stored in shared libaries. Please see: https://github.com/NREL/cbci_jenkins_libs
22

3-
@Library('cbci_shared_libs') _
3+
@Library('cbci_shared_libs@developExtension') _
44

55
// Build for PR to develop branch only.
66
if ((env.CHANGE_ID) && (env.CHANGE_TARGET) ) { // check if set

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ bundle exec rake openstudio:test_with_openstudio
5151

5252
|OpenStudio Model Articulation Gem|OpenStudio|Ruby|
5353
|:--------------:|:----------:|:--------:|
54+
| 0.10.0 | 3.8 | 3.2.2 |
5455
| 0.9.0 | 3.7 | 2.7 |
5556
| 0.8.0 | 3.6 | 2.7 |
5657
| 0.7.0 | 3.5 | 2.7 |

lib/measures/SimplifyGeometryToSlicedBar/measure.rb

Lines changed: 32 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,8 @@
1212
# see the URL below for access to C++ documentation on model objects (click on "model" in the main window to view model objects)
1313
# http://openstudio.nrel.gov/sites/openstudio.nrel.gov/files/nv_data/cpp_documentation_it/model/html/namespaces.html
1414

15-
# load OpenStudio measure libraries from openstudio-extension gem
16-
require 'openstudio-extension'
17-
require 'openstudio/extension/core/os_lib_helper_methods'
18-
require 'openstudio/extension/core/os_lib_geometry'
15+
# load OpenStudio measure libraries from openstudio-standards gem
16+
require 'openstudio-standards'
1917

2018
# load OpenStudio measure libraries
2119
require "#{File.dirname(__FILE__)}/resources/os_lib_cofee"
@@ -78,8 +76,8 @@ def run(model, runner, user_arguments)
7876
# get total floor area for building
7977
building = model.getBuilding
8078
totalFloorArea = building.floorArea # TODO: - this doesn't include spaces tagged as not included in floor area. This would include spaces like plenums and attics
81-
runner.registerInfo("Initial Floor Area is #{OsLib_HelperMethods.neatConvertWithUnitDisplay(totalFloorArea, 'm^2', 'ft^2', 0, unitBefore = false, unitAfter = true, space = true, parentheses = true)}.")
82-
79+
runner.registerInfo("Initial Floor Area is #{OpenStudio.toNeatString(OpenStudio.convert(totalFloorArea, 'm^2', 'ft^2').get, 0, true)}.")
80+
8381
# get get number of floors. Assume that user has properly used story object.
8482
numStories = 0
8583
stories = model.getBuildingStorys
@@ -108,15 +106,15 @@ def run(model, runner, user_arguments)
108106
spaceTypes.each do |spaceType|
109107
next if spaceType.spaces.empty?
110108

111-
result = OsLib_HelperMethods.getAreaOfSpacesInArray(model, spaceType.spaces, areaType = 'floorArea')
112-
spaceTypeHash[spaceType] = result['totalArea']
113-
totalSpaceTypeArea += result['totalArea']
109+
result = OpenstudioStandards::Geometry.spaces_get_floor_area(spaceType.spaces)
110+
spaceTypeHash[spaceType] = result
111+
totalSpaceTypeArea += result
114112
end
115113

116-
runner.registerInfo("Initial Space Type Total Floor Area is #{OsLib_HelperMethods.neatConvertWithUnitDisplay(totalSpaceTypeArea, 'm^2', 'ft^2', 0, unitBefore = false, unitAfter = true, space = true, parentheses = true)}.")
114+
runner.registerInfo("Initial Space Type Total Floor Area is #{OpenStudio.toNeatString(OpenStudio.convert(totalSpaceTypeArea, 'm^2', 'ft^2').get, 0, true)}.")
117115

118116
spaceTypeHash.sort_by { |key, value| value }.reverse_each do |k, v|
119-
runner.registerInfo("Floor Area for #{k.name} is #{OsLib_HelperMethods.neatConvertWithUnitDisplay(v, 'm^2', 'ft^2', 0, unitBefore = false, unitAfter = true, space = true, parentheses = true)}.")
117+
runner.registerInfo("Floor Area for #{k.name} is #{OpenStudio.toNeatString(OpenStudio.convert(v, 'm^2', 'ft^2').get, 0, true)}.")
120118
end
121119

122120
# TODO: - warn if some spaces are not included in floor area (plenum and attic)
@@ -127,19 +125,18 @@ def run(model, runner, user_arguments)
127125
# todo - this measure wont' touch HVAC systems, consider warning user if model already has HVAC, as it won't be hooked up to anything after this.
128126

129127
# get wall and window area by facade
130-
starting_spaces = model.getSpaces
131-
areaByFacade = OsLib_Geometry.getExteriorWindowAndWllAreaByOrientation(model, starting_spaces, options = {})
132-
northWallGross = OsLib_HelperMethods.neatConvertWithUnitDisplay(areaByFacade['northWall'], 'm^2', 'ft^2', 0, unitBefore = false, unitAfter = true, space = true, parentheses = true)
133-
southWallGross = OsLib_HelperMethods.neatConvertWithUnitDisplay(areaByFacade['southWall'], 'm^2', 'ft^2', 0, unitBefore = false, unitAfter = true, space = true, parentheses = true)
134-
eastWallGross = OsLib_HelperMethods.neatConvertWithUnitDisplay(areaByFacade['eastWall'], 'm^2', 'ft^2', 0, unitBefore = false, unitAfter = true, space = true, parentheses = true)
135-
westWallGross = OsLib_HelperMethods.neatConvertWithUnitDisplay(areaByFacade['westWall'], 'm^2', 'ft^2', 0, unitBefore = false, unitAfter = true, space = true, parentheses = true)
128+
areaByFacade = OpenstudioStandards::Geometry.model_get_exterior_window_and_wall_area_by_orientation(model)
129+
northWallGross = OpenStudio.toNeatString(OpenStudio.convert(areaByFacade['north_wall'], 'm^2', 'ft^2').get, 0, true)
130+
southWallGross = OpenStudio.toNeatString(OpenStudio.convert(areaByFacade['south_wall'], 'm^2', 'ft^2').get, 0, true)
131+
eastWallGross = OpenStudio.toNeatString(OpenStudio.convert(areaByFacade['east_wall'], 'm^2', 'ft^2').get, 0, true)
132+
westWallGross = OpenStudio.toNeatString(OpenStudio.convert(areaByFacade['west_wall'], 'm^2', 'ft^2').get, 0, true)
136133
runner.registerInfo("Initial Exterior Wall Breakdown. North: #{northWallGross}, South: #{southWallGross}, East: #{eastWallGross}, West: #{westWallGross}")
137134

138135
# reporting initial condition of model
139-
floorArea_si = OsLib_HelperMethods.getAreaOfSpacesInArray(model, starting_spaces, areaType = 'floorArea')['totalArea']
140-
floorArea_ip = OsLib_HelperMethods.neatConvertWithUnitDisplay(floorArea_si, 'm^2', 'ft^2', 0, unitBefore = false, unitAfter = true, space = true, parentheses = true)
141-
exteriorArea_si = OsLib_HelperMethods.getAreaOfSpacesInArray(model, starting_spaces, areaType = 'exteriorWallArea')['totalArea']
142-
exteriorArea_ip = OsLib_HelperMethods.neatConvertWithUnitDisplay(exteriorArea_si, 'm^2', 'ft^2', 0, unitBefore = false, unitAfter = true, space = true, parentheses = true)
136+
floorArea_si = OpenstudioStandards::Geometry.spaces_get_floor_area(model.getSpaces)
137+
floorArea_ip = OpenStudio.toNeatString(OpenStudio.convert(floorArea_si, 'm^2', 'ft^2').get, 0, true)
138+
exteriorArea_si = OpenstudioStandards::Geometry.spaces_get_exterior_wall_area(model.getSpaces)
139+
exteriorArea_ip = OpenStudio.toNeatString(OpenStudio.convert(exteriorArea_si, 'm^2', 'ft^2').get, 0, true)
143140

144141
runner.registerInitialCondition("The building started with #{floorArea_ip} of floor area, and #{exteriorArea_ip} of exterior wall area.")
145142

@@ -159,9 +156,9 @@ def run(model, runner, user_arguments)
159156
lengthX = xmax - xmin
160157
lengthY = ymax - ymin
161158
areaBounding = lengthX * lengthY
162-
lengthX_display = OsLib_HelperMethods.neatConvertWithUnitDisplay(lengthX, 'm', 'ft', 0, unitBefore = false, unitAfter = true, space = true, parentheses = true)
163-
lengthY_display = OsLib_HelperMethods.neatConvertWithUnitDisplay(lengthY, 'm', 'ft', 0, unitBefore = false, unitAfter = true, space = true, parentheses = true)
164-
areaBounding_display = OsLib_HelperMethods.neatConvertWithUnitDisplay(areaBounding, 'm^2', 'ft^2', 0, unitBefore = false, unitAfter = true, space = true, parentheses = true)
159+
lengthX_display = OpenStudio.toNeatString(OpenStudio.convert(lengthX, 'm', 'ft').get, 0, true)
160+
lengthY_display = OpenStudio.toNeatString(OpenStudio.convert(lengthY, 'm', 'ft').get, 0, true)
161+
areaBounding_display = OpenStudio.toNeatString(OpenStudio.convert(areaBounding, 'm^2', 'ft^2').get, 0, true)
165162
runner.registerInfo("Bounding box area is #{areaBounding_display}. #{lengthX_display} by #{lengthY_display}.")
166163

167164
# get target footprint size
@@ -187,8 +184,8 @@ def run(model, runner, user_arguments)
187184

188185
else
189186
areaTarget = totalFloorArea / numStories
190-
lengthXTarget_Bar1 = (areaByFacade['northWall'] + areaByFacade['southWall']) / (2 * (zmax - zmin))
191-
lengthYTarget_Bar2 = (areaByFacade['eastWall'] + areaByFacade['westWall']) / (2 * (zmax - zmin))
187+
lengthXTarget_Bar1 = (areaByFacade['north_wall'] + areaByFacade['south_wall']) / (2 * (zmax - zmin))
188+
lengthYTarget_Bar2 = (areaByFacade['east_wall'] + areaByFacade['west_wall']) / (2 * (zmax - zmin))
192189
lengthYTarget_Bar1 = areaTarget / (lengthXTarget_Bar1 + lengthYTarget_Bar2)
193190
lengthXTarget_Bar2 = lengthYTarget_Bar1
194191

@@ -243,20 +240,18 @@ def run(model, runner, user_arguments)
243240

244241
end
245242

246-
# get wall and window area by facade
247-
finishing_spaces = model.getSpaces
248-
areaByFacade = OsLib_Geometry.getExteriorWindowAndWllAreaByOrientation(model, finishing_spaces, options = {})
249-
northWallGross = OsLib_HelperMethods.neatConvertWithUnitDisplay(areaByFacade['northWall'], 'm^2', 'ft^2', 0, unitBefore = false, unitAfter = true, space = true, parentheses = true)
250-
southWallGross = OsLib_HelperMethods.neatConvertWithUnitDisplay(areaByFacade['southWall'], 'm^2', 'ft^2', 0, unitBefore = false, unitAfter = true, space = true, parentheses = true)
251-
eastWallGross = OsLib_HelperMethods.neatConvertWithUnitDisplay(areaByFacade['eastWall'], 'm^2', 'ft^2', 0, unitBefore = false, unitAfter = true, space = true, parentheses = true)
252-
westWallGross = OsLib_HelperMethods.neatConvertWithUnitDisplay(areaByFacade['westWall'], 'm^2', 'ft^2', 0, unitBefore = false, unitAfter = true, space = true, parentheses = true)
243+
areaByFacade = OpenstudioStandards::Geometry.model_get_exterior_window_and_wall_area_by_orientation(model)
244+
northWallGross = OpenStudio.toNeatString(OpenStudio.convert(areaByFacade['north_wall'], 'm^2', 'ft^2').get, 0, true)
245+
southWallGross = OpenStudio.toNeatString(OpenStudio.convert(areaByFacade['south_wall'], 'm^2', 'ft^2').get, 0, true)
246+
eastWallGross = OpenStudio.toNeatString(OpenStudio.convert(areaByFacade['east_wall'], 'm^2', 'ft^2').get, 0, true)
247+
westWallGross = OpenStudio.toNeatString(OpenStudio.convert(areaByFacade['west_wall'], 'm^2', 'ft^2').get, 0, true)
253248
runner.registerInfo("Final Exterior Wall Breakdown. North: #{northWallGross}, South: #{southWallGross}, East: #{eastWallGross}, West: #{westWallGross}")
254249

255250
# reporting final condition of model
256-
floorArea_si = OsLib_HelperMethods.getAreaOfSpacesInArray(model, finishing_spaces, areaType = 'floorArea')['totalArea']
257-
floorArea_ip = OsLib_HelperMethods.neatConvertWithUnitDisplay(floorArea_si, 'm^2', 'ft^2', 0, unitBefore = false, unitAfter = true, space = true, parentheses = true)
258-
exteriorArea_si = OsLib_HelperMethods.getAreaOfSpacesInArray(model, finishing_spaces, areaType = 'exteriorWallArea')['totalArea']
259-
exteriorArea_ip = OsLib_HelperMethods.neatConvertWithUnitDisplay(exteriorArea_si, 'm^2', 'ft^2', 0, unitBefore = false, unitAfter = true, space = true, parentheses = true)
251+
floorArea_si = OpenstudioStandards::Geometry.spaces_get_floor_area(model.getSpaces)
252+
floorArea_ip = OpenStudio.toNeatString(OpenStudio.convert(floorArea_si, 'm^2', 'ft^2').get, 0, true)
253+
exteriorArea_si = OpenstudioStandards::Geometry.spaces_get_exterior_wall_area(model.getSpaces)
254+
exteriorArea_ip = OpenStudio.toNeatString(OpenStudio.convert(exteriorArea_si, 'm^2', 'ft^2').get, 0, true)
260255

261256
runner.registerFinalCondition("The building finished with #{floorArea_ip} of floor area, and #{exteriorArea_ip} of exterior wall area.")
262257

Lines changed: 34 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,16 @@
11
<?xml version="1.0"?>
22
<measure>
3-
<schema_version>3.0</schema_version>
3+
<schema_version>3.1</schema_version>
44
<name>simplify_geometry_to_sliced_bar</name>
55
<uid>eb218516-5fa5-47fe-948d-274777c7d592</uid>
6-
<version_id>f596f08b-a427-4ccf-ad9b-04da056a8665</version_id>
7-
<version_modified>20230602T160044Z</version_modified>
6+
<version_id>3c5abf7b-a4fb-482a-b075-be91623c8f4f</version_id>
7+
<version_modified>2024-05-20T07:54:33Z</version_modified>
88
<xml_checksum>45097B60</xml_checksum>
99
<class_name>SimplifyGeometryToSlicedBar</class_name>
1010
<display_name>SimplifyGeometryToSlicedBar</display_name>
1111
<description>This is an experimental measure looking at ways to simply the geometry, or to create geometry when you only no percentage of space types number of floors and total area. This technique will match the building floor area but will sacrifice the exterior exposure. So it will produce better results on more boxy buildings than a building with many wings. I may try to come up with solution that also tries to maintain exterior exposure in another version.</description>
1212
<modeler_description>I'm going to extract space type area breakdown and number of floors from the source model. I'll also keep track of exterior exposure. I won't directly use exterior exposure but can report the change in this as a kind of confidence metric. I'll then create a bar building using the bounding box aspect ratio, but shrunk to fit the building area. I will slice the building across the shorter axis by space type. The two most prevalent space types will go on the outside of the building. Instead of core and perimeter zoning the building will have a variation with square corners. I will create one zone per space, and will use a zone multiplier for any building more than 3 stories tall.
1313

14-
15-
16-
17-
18-
19-
20-
21-
22-
23-
24-
25-
26-
27-
28-
29-
30-
31-
32-
33-
34-
35-
36-
37-
38-
39-
40-
41-
42-
43-
44-
45-
46-
47-
4814
In a future version I may try to identify similar spaces types and blend them together before slicing, although I expect that will be a separate measure, so it is more modular.</modeler_description>
4915
<arguments>
5016
<argument>
@@ -89,10 +55,10 @@ In a future version I may try to identify similar spaces types and blend them to
8955
</attributes>
9056
<files>
9157
<file>
92-
<filename>UShapedHotelExample.osm</filename>
93-
<filetype>osm</filetype>
94-
<usage_type>test</usage_type>
95-
<checksum>7E96D119</checksum>
58+
<filename>LICENSE.md</filename>
59+
<filetype>md</filetype>
60+
<usage_type>license</usage_type>
61+
<checksum>BFFB1AA6</checksum>
9662
</file>
9763
<file>
9864
<filename>README.md</filename>
@@ -107,10 +73,27 @@ In a future version I may try to identify similar spaces types and blend them to
10773
<checksum>703C9964</checksum>
10874
</file>
10975
<file>
110-
<filename>UShapedHotelExample/run.db</filename>
111-
<filetype>db</filetype>
76+
<version>
77+
<software_program>OpenStudio</software_program>
78+
<identifier>2.0.0</identifier>
79+
<min_compatible>3.8.0</min_compatible>
80+
</version>
81+
<filename>measure.rb</filename>
82+
<filetype>rb</filetype>
83+
<usage_type>script</usage_type>
84+
<checksum>1F503C21</checksum>
85+
</file>
86+
<file>
87+
<filename>os_lib_cofee.rb</filename>
88+
<filetype>rb</filetype>
89+
<usage_type>resource</usage_type>
90+
<checksum>2C77E71F</checksum>
91+
</file>
92+
<file>
93+
<filename>SimplifyGeometryToSlicedBar_Test.rb</filename>
94+
<filetype>rb</filetype>
11295
<usage_type>test</usage_type>
113-
<checksum>9230B5CD</checksum>
96+
<checksum>03F6E2E5</checksum>
11497
</file>
11598
<file>
11699
<filename>UShapedHotelExample/files/USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw</filename>
@@ -125,45 +108,16 @@ In a future version I may try to identify similar spaces types and blend them to
125108
<checksum>EE6FAF90</checksum>
126109
</file>
127110
<file>
128-
<filename>LICENSE.md</filename>
129-
<filetype>md</filetype>
130-
<usage_type>license</usage_type>
131-
<checksum>BFFB1AA6</checksum>
132-
</file>
133-
<file>
134-
<filename>os_lib_helper_methods.rb</filename>
135-
<filetype>rb</filetype>
136-
<usage_type>resource</usage_type>
137-
<checksum>996C5B97</checksum>
138-
</file>
139-
<file>
140-
<filename>os_lib_cofee.rb</filename>
141-
<filetype>rb</filetype>
142-
<usage_type>resource</usage_type>
143-
<checksum>7162FF96</checksum>
144-
</file>
145-
<file>
146-
<version>
147-
<software_program>OpenStudio</software_program>
148-
<identifier>2.0.0</identifier>
149-
<min_compatible>2.8.0</min_compatible>
150-
</version>
151-
<filename>measure.rb</filename>
152-
<filetype>rb</filetype>
153-
<usage_type>script</usage_type>
154-
<checksum>8D1BD320</checksum>
155-
</file>
156-
<file>
157-
<filename>os_lib_geometry.rb</filename>
158-
<filetype>rb</filetype>
159-
<usage_type>resource</usage_type>
160-
<checksum>788EF0F2</checksum>
111+
<filename>UShapedHotelExample/run.db</filename>
112+
<filetype>db</filetype>
113+
<usage_type>test</usage_type>
114+
<checksum>9230B5CD</checksum>
161115
</file>
162116
<file>
163-
<filename>SimplifyGeometryToSlicedBar_Test.rb</filename>
164-
<filetype>rb</filetype>
117+
<filename>UShapedHotelExample.osm</filename>
118+
<filetype>osm</filetype>
165119
<usage_type>test</usage_type>
166-
<checksum>03F6E2E5</checksum>
120+
<checksum>7E96D119</checksum>
167121
</file>
168122
</files>
169123
</measure>

0 commit comments

Comments
 (0)