From 67a46d648015af57ae6accd238c7616ee2a7b523 Mon Sep 17 00:00:00 2001 From: Matt Steen Date: Fri, 18 Feb 2022 15:43:34 -0700 Subject: [PATCH 01/19] add triangulation_min_area argument and surface area check --- .../SetWindowToWallRatioByFacade/measure.rb | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/measures/SetWindowToWallRatioByFacade/measure.rb b/lib/measures/SetWindowToWallRatioByFacade/measure.rb index dbe1f036..ed705a28 100644 --- a/lib/measures/SetWindowToWallRatioByFacade/measure.rb +++ b/lib/measures/SetWindowToWallRatioByFacade/measure.rb @@ -97,6 +97,13 @@ def arguments(model) triangulate.setDefaultValue(true) args << triangulate + # triangulation minimum area + triangulation_min_area = OpenStudio::Measure::OSArgument.makeDoubleArgument('triangulation_min_area', true) + triangulation_min_area.setDisplayName('Triangulation Minimum Area (m^2)') + triangulation_min_area.setDescription('Triangulated surfaces less than this will not be created.') + triangulation_min_area.setDefaultValue(0.001) # Two vertices < 0.01 meters apart are coincident in EnergyPlus (SurfaceGeometry.cc). + args << triangulation_min_area + return args end @@ -117,6 +124,7 @@ def run(model, runner, user_arguments) split_at_doors = runner.getStringArgumentValue('split_at_doors', user_arguments) inset_tri_sub = runner.getBoolArgumentValue('inset_tri_sub', user_arguments) triangulate = runner.getBoolArgumentValue('triangulate', user_arguments) + triangulation_min_area = runner.getDoubleArgumentValue('triangulation_min_area', user_arguments) # check reasonableness of fraction if wwr == 0 @@ -384,8 +392,13 @@ def run(model, runner, user_arguments) subSurface.remove end + # triangulate surface ss.triangulation.each do |tri| new_surface = OpenStudio::Model::Surface.new(tri, model) + if new_surface.grossArea < triangulation_min_area + new_surface.remove + next + end new_surface.setSpace(ss.space.get) if ss.construction.is_initialized && !ss.isConstructionDefaulted new_surface.setConstruction(ss.construction.get) @@ -397,7 +410,7 @@ def run(model, runner, user_arguments) end # remove orig surface - ss.remove + ss.remove end else From 6634b9216081b0e4a1a8b06c0ef8d1782ea703d0 Mon Sep 17 00:00:00 2001 From: Matt Steen Date: Fri, 18 Feb 2022 21:08:27 -0700 Subject: [PATCH 02/19] update test for new argument --- .../tests/SetWindowToWallRatioByFacade_Test.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/measures/SetWindowToWallRatioByFacade/tests/SetWindowToWallRatioByFacade_Test.rb b/lib/measures/SetWindowToWallRatioByFacade/tests/SetWindowToWallRatioByFacade_Test.rb index 4971dc83..ffe72c4f 100644 --- a/lib/measures/SetWindowToWallRatioByFacade/tests/SetWindowToWallRatioByFacade_Test.rb +++ b/lib/measures/SetWindowToWallRatioByFacade/tests/SetWindowToWallRatioByFacade_Test.rb @@ -59,7 +59,7 @@ def test_SetWindowToWallRatioByFacade_fail # get arguments and test that they are what we are expecting arguments = measure.arguments(model) - assert_equal(7, arguments.size) + assert_equal(8, arguments.size) assert_equal('wwr', arguments[0].name) assert_equal('sillHeight', arguments[1].name) assert_equal('facade', arguments[2].name) @@ -67,6 +67,7 @@ def test_SetWindowToWallRatioByFacade_fail assert_equal('split_at_doors', arguments[4].name) assert_equal('inset_tri_sub', arguments[5].name) assert_equal('triangulate', arguments[6].name) + assert_equal('triangulation_min_area', arguments[7].name) # set argument values to bad values and run the measure argument_map = OpenStudio::Measure.convertOSArgumentVectorToMap(arguments) From 7ce6727de73195d694b1b0436331461217fc6047 Mon Sep 17 00:00:00 2001 From: Matt Steen Date: Sat, 26 Feb 2022 08:10:53 -0700 Subject: [PATCH 03/19] update supporting files --- .../SetWindowToWallRatioByFacade/README.md | 11 ++++++ .../SetWindowToWallRatioByFacade/measure.xml | 37 ++++++++++++------- 2 files changed, 34 insertions(+), 14 deletions(-) diff --git a/lib/measures/SetWindowToWallRatioByFacade/README.md b/lib/measures/SetWindowToWallRatioByFacade/README.md index 7e2aecd7..7786d4ce 100644 --- a/lib/measures/SetWindowToWallRatioByFacade/README.md +++ b/lib/measures/SetWindowToWallRatioByFacade/README.md @@ -100,6 +100,17 @@ This will only impact exterior surfaces with specified orientation +### Triangulation Minimum Area (m^2) +Triangulated surfaces less than this will not be created. +**Name:** triangulation_min_area, +**Type:** Double, +**Units:** , +**Required:** true, +**Model Dependent:** false + + + + diff --git a/lib/measures/SetWindowToWallRatioByFacade/measure.xml b/lib/measures/SetWindowToWallRatioByFacade/measure.xml index 6d06f048..c0d9d0da 100644 --- a/lib/measures/SetWindowToWallRatioByFacade/measure.xml +++ b/lib/measures/SetWindowToWallRatioByFacade/measure.xml @@ -3,8 +3,8 @@ 3.0 set_window_to_wall_ratio_by_facade c567a0bf-a7d9-4a06-afe9-bf7df79e6bf8 - a02e024d-a1ca-413a-90e2-372cfc217228 - 20210929T221458Z + 518c5be8-b109-4e18-b0fb-63e460ac82cc + 20220226T150940Z 6DE831F7 SetWindowToWallRatioByFacade Set Window to Wall Ratio by Facade @@ -153,6 +153,15 @@ The measure doesn?t have any cost or lifecycle arguments, however If lifecycle o + + triangulation_min_area + Triangulation Minimum Area (m^2) + Triangulated surfaces less than this will not be created. + Double + true + false + 0.001 + @@ -212,18 +221,18 @@ The measure doesn?t have any cost or lifecycle arguments, however If lifecycle o readmeerb 232D0477 - - README.md - md - readme - C85B9D94 - LICENSE.md md license A21A3ED2 + + prototype_sec_sch.osm + osm + test + 581DA01B + OpenStudio @@ -233,19 +242,19 @@ The measure doesn?t have any cost or lifecycle arguments, however If lifecycle o measure.rb rb script - 6631CF18 + A8258A30 SetWindowToWallRatioByFacade_Test.rb rb test - 0F626DE3 + E24E266E - prototype_sec_sch.osm - osm - test - 581DA01B + README.md + md + readme + 7FCCDC8E From 830cc86a55a14f667d2982d4b9aaee5061089628 Mon Sep 17 00:00:00 2001 From: Matt Steen Date: Mon, 7 Mar 2022 12:44:11 -0700 Subject: [PATCH 04/19] add warnings to categorize cases when WWR can't be applied. it's not pretty, but this measure isn't either and i think it could use a refactor. --- .../SetWindowToWallRatioByFacade/measure.rb | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/lib/measures/SetWindowToWallRatioByFacade/measure.rb b/lib/measures/SetWindowToWallRatioByFacade/measure.rb index ed705a28..47b3a5ff 100644 --- a/lib/measures/SetWindowToWallRatioByFacade/measure.rb +++ b/lib/measures/SetWindowToWallRatioByFacade/measure.rb @@ -396,6 +396,7 @@ def run(model, runner, user_arguments) ss.triangulation.each do |tri| new_surface = OpenStudio::Model::Surface.new(tri, model) if new_surface.grossArea < triangulation_min_area + runner.registerWarning("triangulation produced a surface with area less than the minimum for surface = #{ss.name}") new_surface.remove next end @@ -419,6 +420,11 @@ def run(model, runner, user_arguments) # add windows all_surfaces2.sort.each do |ss| + + rectangular = false + triangular = false + sillHeight_too_high = false + orig_sub_surf_constructions = {} ss.subSurfaces.sort.each do |sub_surf| next if sub_surf.subSurfaceType == 'Door' || sub_surf.subSurfaceType == 'OverheadDoor' @@ -440,6 +446,12 @@ def run(model, runner, user_arguments) else new_window = ss.setWindowToWallRatio(wwr, sillHeight_si.value, true) window_confirmed = false + # if the setWindowToWallRatio method was successful, then the surface is a rectangle + rectangular = true if !new_window.empty? + # check for cases where the WWR is too large for the sill height. + # won't catch cases where the existing WWR = measure's WWR + wwr_calc = (ss.grossArea - ss.netArea) / ss.grossArea + sillHeight_too_high = true if wwr.round(4) != wwr_calc.round(4) end if wwr > 0 && new_window.empty? @@ -449,6 +461,8 @@ def run(model, runner, user_arguments) # skip of surface already has sub-surfaces or if not triangle if ss.subSurfaces.empty? && ss.vertices.size <= 3 + triangular = true + # get centroid vertices = ss.vertices centroid = OpenStudio.getCentroid(vertices).get @@ -485,7 +499,15 @@ def run(model, runner, user_arguments) end if !window_confirmed - runner.registerWarning("Fenestration could not be added for #{ss.name}. Surface may not be rectangular or triangular, may have a door, or the requested WWR may be too large.") + if !inset_tri_sub && triangular + runner.registerWarning("window could not be added because the inset_tri_sub argument is false and the surface is triangular = #{ss.name}") + elsif !rectangular && !sillHeight_too_high + runner.registerWarning("window could not be added because surface is not rectangular = #{ss.name}") + elsif sillHeight_too_high + runner.registerWarning("window could not be added because the sill height is too high for surface = #{ss.name}") + else # shouldn't get here + runner.registerWarning("Fenestration could not be added for #{ss.name}. Surface may not be rectangular or triangular, may have a door, or the requested WWR may be too large.") + end end # warn user if resulting window doesn't have a construction, as it will result in failed simulation. In the future may use logic from starting windows to apply construction to new window. From a826dc2fdac7d5654037186934fd0a65f41fbf50 Mon Sep 17 00:00:00 2001 From: Matt Steen Date: Mon, 14 Mar 2022 11:13:47 -0600 Subject: [PATCH 05/19] remove unused flag --- lib/measures/SetWindowToWallRatioByFacade/measure.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/measures/SetWindowToWallRatioByFacade/measure.rb b/lib/measures/SetWindowToWallRatioByFacade/measure.rb index 47b3a5ff..74446aa7 100644 --- a/lib/measures/SetWindowToWallRatioByFacade/measure.rb +++ b/lib/measures/SetWindowToWallRatioByFacade/measure.rb @@ -352,7 +352,6 @@ def run(model, runner, user_arguments) y_vals = [] z_vals = [] vertices = ss.vertices - flag = false vertices.each do |vertex| # initialize new vertex to old vertex # rounding values to address tolerance issue 10 digits digits in From 08c1cf43853ec77fe68a6edfb3491d7e1b7b399d Mon Sep 17 00:00:00 2001 From: Matt Steen Date: Mon, 14 Mar 2022 11:22:59 -0600 Subject: [PATCH 06/19] move rectangle check to module for better design paradigm --- .../SetWindowToWallRatioByFacade/measure.rb | 16 +----------- .../resources/functions.rb | 26 +++++++++++++++++++ 2 files changed, 27 insertions(+), 15 deletions(-) create mode 100644 lib/measures/SetWindowToWallRatioByFacade/resources/functions.rb diff --git a/lib/measures/SetWindowToWallRatioByFacade/measure.rb b/lib/measures/SetWindowToWallRatioByFacade/measure.rb index 74446aa7..c88bdeb2 100644 --- a/lib/measures/SetWindowToWallRatioByFacade/measure.rb +++ b/lib/measures/SetWindowToWallRatioByFacade/measure.rb @@ -347,21 +347,7 @@ def run(model, runner, user_arguments) all_surfaces.sort.each do |ss| # see if surface is rectangular (only checking non rotated on vertical wall) # todo - add in more robust rectangle check that can look for rotate and tilted rectangles - rect_tri = false - x_vals = [] - y_vals = [] - z_vals = [] - vertices = ss.vertices - vertices.each do |vertex| - # initialize new vertex to old vertex - # rounding values to address tolerance issue 10 digits digits in - x_vals << vertex.x.round(4) - y_vals << vertex.y.round(4) - z_vals << vertex.z.round(4) - end - if x_vals.uniq.size <= 2 && y_vals.uniq.size <= 2 && z_vals.uniq.size <= 2 - rect_tri = true - end + rect_tri = Functions.rectangle?(ss) has_doors = false ss.subSurfaces.sort.each do |subSurface| diff --git a/lib/measures/SetWindowToWallRatioByFacade/resources/functions.rb b/lib/measures/SetWindowToWallRatioByFacade/resources/functions.rb new file mode 100644 index 00000000..f5cf25ff --- /dev/null +++ b/lib/measures/SetWindowToWallRatioByFacade/resources/functions.rb @@ -0,0 +1,26 @@ +require 'openstudio' + +module Functions + + # see if surface is rectangular (only checking non rotated on vertical wall) + # todo - add in more robust rectangle check that can look for rotate and tilted rectangles + def self.rectangle(surface) + x_vals = [] + y_vals = [] + z_vals = [] + vertices = ss.vertices + vertices.each do |vertex| + # initialize new vertex to old vertex + # rounding values to address tolerance issue 10 digits digits in + x_vals << vertex.x.round(4) + y_vals << vertex.y.round(4) + z_vals << vertex.z.round(4) + end + if x_vals.uniq.size <= 2 && y_vals.uniq.size <= 2 && z_vals.uniq.size <= 2 + return true + else + return false + end + end + +end From ad3a5ac0be1b017e301dcb4f5fb7048db0621e07 Mon Sep 17 00:00:00 2001 From: Matt Steen Date: Mon, 14 Mar 2022 11:24:05 -0600 Subject: [PATCH 07/19] minor fix --- .../SetWindowToWallRatioByFacade/resources/functions.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/measures/SetWindowToWallRatioByFacade/resources/functions.rb b/lib/measures/SetWindowToWallRatioByFacade/resources/functions.rb index f5cf25ff..372bf354 100644 --- a/lib/measures/SetWindowToWallRatioByFacade/resources/functions.rb +++ b/lib/measures/SetWindowToWallRatioByFacade/resources/functions.rb @@ -8,7 +8,7 @@ def self.rectangle(surface) x_vals = [] y_vals = [] z_vals = [] - vertices = ss.vertices + vertices = surface.vertices vertices.each do |vertex| # initialize new vertex to old vertex # rounding values to address tolerance issue 10 digits digits in From 45fb12b10b068f2ed4c5e2d78da62d602201f399 Mon Sep 17 00:00:00 2001 From: Matt Steen Date: Mon, 14 Mar 2022 11:30:42 -0600 Subject: [PATCH 08/19] require_relative --- lib/measures/SetWindowToWallRatioByFacade/measure.rb | 2 ++ .../SetWindowToWallRatioByFacade/resources/functions.rb | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/measures/SetWindowToWallRatioByFacade/measure.rb b/lib/measures/SetWindowToWallRatioByFacade/measure.rb index c88bdeb2..54dd7255 100644 --- a/lib/measures/SetWindowToWallRatioByFacade/measure.rb +++ b/lib/measures/SetWindowToWallRatioByFacade/measure.rb @@ -33,6 +33,8 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # ******************************************************************************* +require_relative 'resources/functions.rb' + class SetWindowToWallRatioByFacade < OpenStudio::Measure::ModelMeasure # override name to return the name of your script def name diff --git a/lib/measures/SetWindowToWallRatioByFacade/resources/functions.rb b/lib/measures/SetWindowToWallRatioByFacade/resources/functions.rb index 372bf354..d3f9b810 100644 --- a/lib/measures/SetWindowToWallRatioByFacade/resources/functions.rb +++ b/lib/measures/SetWindowToWallRatioByFacade/resources/functions.rb @@ -4,7 +4,7 @@ module Functions # see if surface is rectangular (only checking non rotated on vertical wall) # todo - add in more robust rectangle check that can look for rotate and tilted rectangles - def self.rectangle(surface) + def self.rectangle?(surface) x_vals = [] y_vals = [] z_vals = [] From 4822c3b89c4782a6fdfda18758d95a00452aa255 Mon Sep 17 00:00:00 2001 From: Matt Steen Date: Mon, 14 Mar 2022 11:36:10 -0600 Subject: [PATCH 09/19] better warning messages --- .../SetWindowToWallRatioByFacade/measure.rb | 38 +++++++++---------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/lib/measures/SetWindowToWallRatioByFacade/measure.rb b/lib/measures/SetWindowToWallRatioByFacade/measure.rb index 54dd7255..50e13387 100644 --- a/lib/measures/SetWindowToWallRatioByFacade/measure.rb +++ b/lib/measures/SetWindowToWallRatioByFacade/measure.rb @@ -408,10 +408,6 @@ def run(model, runner, user_arguments) # add windows all_surfaces2.sort.each do |ss| - rectangular = false - triangular = false - sillHeight_too_high = false - orig_sub_surf_constructions = {} ss.subSurfaces.sort.each do |sub_surf| next if sub_surf.subSurfaceType == 'Door' || sub_surf.subSurfaceType == 'OverheadDoor' @@ -433,12 +429,6 @@ def run(model, runner, user_arguments) else new_window = ss.setWindowToWallRatio(wwr, sillHeight_si.value, true) window_confirmed = false - # if the setWindowToWallRatio method was successful, then the surface is a rectangle - rectangular = true if !new_window.empty? - # check for cases where the WWR is too large for the sill height. - # won't catch cases where the existing WWR = measure's WWR - wwr_calc = (ss.grossArea - ss.netArea) / ss.grossArea - sillHeight_too_high = true if wwr.round(4) != wwr_calc.round(4) end if wwr > 0 && new_window.empty? @@ -448,8 +438,6 @@ def run(model, runner, user_arguments) # skip of surface already has sub-surfaces or if not triangle if ss.subSurfaces.empty? && ss.vertices.size <= 3 - triangular = true - # get centroid vertices = ss.vertices centroid = OpenStudio.getCentroid(vertices).get @@ -486,14 +474,24 @@ def run(model, runner, user_arguments) end if !window_confirmed - if !inset_tri_sub && triangular - runner.registerWarning("window could not be added because the inset_tri_sub argument is false and the surface is triangular = #{ss.name}") - elsif !rectangular && !sillHeight_too_high - runner.registerWarning("window could not be added because surface is not rectangular = #{ss.name}") - elsif sillHeight_too_high - runner.registerWarning("window could not be added because the sill height is too high for surface = #{ss.name}") - else # shouldn't get here - runner.registerWarning("Fenestration could not be added for #{ss.name}. Surface may not be rectangular or triangular, may have a door, or the requested WWR may be too large.") + case ss.vertices.size + when 3 + if !inset_tri_sub + runner.registerWarning("window could not be added because the surface has 3 sides, but the inset_tri_sub argument is false = #{ss.name}") + end + when 4 + case Functions.rectangle?(ss) + when true + runner.registerWarning("window could not be added because the surface has 4 sides and is rectangular, but the WWR exceeds the maximum = #{ss.name}") + when false + if !triangulate + runner.registerWarning("window could not be added because the surface has 4 sides, but is not rectangular and the triangulate argument is false = #{ss.name}") + end + end + else + if !triangulate + runner.registerWarning("window could not be added because the surface has more than 4 sides and the triangulate argument is false = #{ss.name}") + end end end From e5c69a2698e64e860e0b98b3dbfc8afec0cd286e Mon Sep 17 00:00:00 2001 From: Matt Steen Date: Mon, 14 Mar 2022 20:15:52 -0600 Subject: [PATCH 10/19] add requested_window_area_greater_than_max? function for clarity (not needed for current measure architecture) --- .../SetWindowToWallRatioByFacade/measure.rb | 4 +- .../resources/functions.rb | 42 +++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/lib/measures/SetWindowToWallRatioByFacade/measure.rb b/lib/measures/SetWindowToWallRatioByFacade/measure.rb index 50e13387..84260ed1 100644 --- a/lib/measures/SetWindowToWallRatioByFacade/measure.rb +++ b/lib/measures/SetWindowToWallRatioByFacade/measure.rb @@ -482,7 +482,9 @@ def run(model, runner, user_arguments) when 4 case Functions.rectangle?(ss) when true - runner.registerWarning("window could not be added because the surface has 4 sides and is rectangular, but the WWR exceeds the maximum = #{ss.name}") + if Functions.requested_window_area_greater_than_max?(ss, wwr) + runner.registerWarning("window could not be added because the surface has 4 sides and is rectangular, but the WWR exceeds the maximum = #{ss.name}") + end when false if !triangulate runner.registerWarning("window could not be added because the surface has 4 sides, but is not rectangular and the triangulate argument is false = #{ss.name}") diff --git a/lib/measures/SetWindowToWallRatioByFacade/resources/functions.rb b/lib/measures/SetWindowToWallRatioByFacade/resources/functions.rb index d3f9b810..d9b555b7 100644 --- a/lib/measures/SetWindowToWallRatioByFacade/resources/functions.rb +++ b/lib/measures/SetWindowToWallRatioByFacade/resources/functions.rb @@ -23,4 +23,46 @@ def self.rectangle?(surface) end end + # return true if the requested window-to-wall area exceeds the maximum allowed area, false if not. + # implements the following part of the applyViewAndDaylightingGlassRatios method, which is what setWindowToWallRatio uses. + # https://github.com/NREL/OpenStudio/blob/760613c7ac9c2093f7dbd65f947a6853356c558d/src/utilities/geometry/Geometry.cpp#L605-L695 + def self.requested_window_area_greater_than_max?(surface, wwr) + + viewGlassToWallRatio = wwr + daylightingGlassToWallRatio = 0 + totalWWR = viewGlassToWallRatio + daylightingGlassToWallRatio + + xvals = [] + yvals = [] + surface.vertices.each do |vertex| + xvals << vertex.x + yvals << vertex.y + end + + oneInch = 0.0254 # meters + minGlassToEdgeDistance = oneInch + minViewToDaylightDistance = 0 + + wallWidth = xvals.max - xvals.min + wallHeight = yvals.max - yvals.min + wallArea = wallWidth * wallHeight + + # return false if wallWidth < 2 * minGlassToEdgeDistance + + # return false if wallHeight < 2 * minGlassToEdgeDistance + minViewToDaylightDistance + + maxWindowArea = wallArea - 2 * wallHeight * minGlassToEdgeDistance + - (wallWidth - 2 * minGlassToEdgeDistance) * (2 * minGlassToEdgeDistance + minViewToDaylightDistance) + requestedViewArea = viewGlassToWallRatio * wallArea; + requestedDaylightingArea = daylightingGlassToWallRatio * wallArea; + requestedTotalWindowArea = totalWWR * wallArea; + + if requestedTotalWindowArea > maxWindowArea + return false + else + return true + end + + end + end From 26b13ff2c6f737faf57c709000ee78ebbf749b33 Mon Sep 17 00:00:00 2001 From: Matt Steen Date: Tue, 15 Mar 2022 12:05:02 -0600 Subject: [PATCH 11/19] update xml --- .../SetWindowToWallRatioByFacade/measure.xml | 30 +++++++++++-------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/lib/measures/SetWindowToWallRatioByFacade/measure.xml b/lib/measures/SetWindowToWallRatioByFacade/measure.xml index c0d9d0da..00d9deab 100644 --- a/lib/measures/SetWindowToWallRatioByFacade/measure.xml +++ b/lib/measures/SetWindowToWallRatioByFacade/measure.xml @@ -3,8 +3,8 @@ 3.0 set_window_to_wall_ratio_by_facade c567a0bf-a7d9-4a06-afe9-bf7df79e6bf8 - 518c5be8-b109-4e18-b0fb-63e460ac82cc - 20220226T150940Z + a09bb8ca-0336-4852-900d-2c6ea38f6dd0 + 20220315T180427Z 6DE831F7 SetWindowToWallRatioByFacade Set Window to Wall Ratio by Facade @@ -233,6 +233,18 @@ The measure doesn?t have any cost or lifecycle arguments, however If lifecycle o test 581DA01B + + SetWindowToWallRatioByFacade_Test.rb + rb + test + E24E266E + + + README.md + md + readme + 7FCCDC8E + OpenStudio @@ -242,19 +254,13 @@ The measure doesn?t have any cost or lifecycle arguments, however If lifecycle o measure.rb rb script - A8258A30 + F544FCEE - SetWindowToWallRatioByFacade_Test.rb + functions.rb rb - test - E24E266E - - - README.md - md - readme - 7FCCDC8E + resource + 63495E18 From 9ad0a58c71b1582614f07c34393248337c3219ff Mon Sep 17 00:00:00 2001 From: Matt Steen Date: Fri, 18 Mar 2022 16:21:07 -0600 Subject: [PATCH 12/19] dry it out a little more --- .../SetWindowToWallRatioByFacade/measure.rb | 101 +----------------- .../resources/functions.rb | 64 +++++++++++ 2 files changed, 69 insertions(+), 96 deletions(-) diff --git a/lib/measures/SetWindowToWallRatioByFacade/measure.rb b/lib/measures/SetWindowToWallRatioByFacade/measure.rb index 84260ed1..e7c6efe8 100644 --- a/lib/measures/SetWindowToWallRatioByFacade/measure.rb +++ b/lib/measures/SetWindowToWallRatioByFacade/measure.rb @@ -211,79 +211,14 @@ def run(model, runner, user_arguments) end # used for new sub surfaces to find target construction - orig_sub_surf_const_for_target_facade = {} - orig_sub_surf_const_for_target_all_ext = {} - - # pre-loop through sub-surfaces to store constructions - model.getSubSurfaces.sort.each do |sub_surf| - # store constructions for entire building - next if sub_surf.subSurfaceType == 'Door' || sub_surf.subSurfaceType == 'OverheadDoor' - if sub_surf.construction.is_initialized - if orig_sub_surf_const_for_target_all_ext.key?(sub_surf.construction.get) - orig_sub_surf_const_for_target_all_ext[sub_surf.construction.get] += 1 - else - orig_sub_surf_const_for_target_all_ext[sub_surf.construction.get] = 1 - end - end - - # get the absoluteAzimuth for the surface so we can categorize it - absoluteAzimuth = OpenStudio.convert(sub_surf.azimuth, 'rad', 'deg').get + sub_surf.surface.get.space.get.directionofRelativeNorth + model.getBuilding.northAxis - absoluteAzimuth -= 360.0 until absoluteAzimuth < 360.0 - - if facade == 'North' - next if !((absoluteAzimuth >= 315.0) || (absoluteAzimuth < 45.0)) - elsif facade == 'East' - next if !((absoluteAzimuth >= 45.0) && (absoluteAzimuth < 135.0)) - elsif facade == 'South' - next if !((absoluteAzimuth >= 135.0) && (absoluteAzimuth < 225.0)) - elsif facade == 'West' - next if !((absoluteAzimuth >= 225.0) && (absoluteAzimuth < 315.0)) - elsif facade == 'All' - # no next needed - else - runner.registerError('Unexpected value of facade: ' + facade + '.') - return false - end - - # store constructions for this facade - if sub_surf.construction.is_initialized - if orig_sub_surf_const_for_target_facade.key?(sub_surf.construction.get) - orig_sub_surf_const_for_target_facade[sub_surf.construction.get] += 1 - else - orig_sub_surf_const_for_target_facade[sub_surf.construction.get] = 1 - end - end - end + subsurfaces_by_facade = Functions.get_surfaces_or_subsurfaces_by_facade(model.getSubSurfaces, facade) + orig_sub_surf_const_for_target_facade = Functions.get_orig_sub_surf_const_for_target(subsurfaces_by_facade) + orig_sub_surf_const_for_target_all_ext = Functions.get_orig_sub_surf_const_for_target(model.getSubSurfaces) # hash for sub surfaces removed from non rectangular surfaces non_rect_parent = {} - surfaces.sort.each do |s| - next if s.surfaceType != 'Wall' - next if s.outsideBoundaryCondition != 'Outdoors' - if s.space.empty? - runner.registerWarning("#{s.name} doesn't have a parent space and won't be included in the measure reporting or modifications.") - next - end - - # get the absoluteAzimuth for the surface so we can categorize it - absoluteAzimuth = OpenStudio.convert(s.azimuth, 'rad', 'deg').get + s.space.get.directionofRelativeNorth + model.getBuilding.northAxis - absoluteAzimuth -= 360.0 until absoluteAzimuth < 360.0 - - if facade == 'North' - next if !((absoluteAzimuth >= 315.0) || (absoluteAzimuth < 45.0)) - elsif facade == 'East' - next if !((absoluteAzimuth >= 45.0) && (absoluteAzimuth < 135.0)) - elsif facade == 'South' - next if !((absoluteAzimuth >= 135.0) && (absoluteAzimuth < 225.0)) - elsif facade == 'West' - next if !((absoluteAzimuth >= 225.0) && (absoluteAzimuth < 315.0)) - elsif facade == 'All' - # no next needed - else - runner.registerError('Unexpected value of facade: ' + facade + '.') - return false - end + Functions.get_surfaces_or_subsurfaces_by_facade(model.getSurfaces, facade).sort.each do |s| exterior_walls = true # get surface area adjusting for zone multiplier @@ -551,33 +486,7 @@ def run(model, runner, user_arguments) end # data for final condition wwr - surfaces.sort.each do |s| - next if s.surfaceType != 'Wall' - next if s.outsideBoundaryCondition != 'Outdoors' - if s.space.empty? - runner.registerWarning("#{s.name} doesn't have a parent space and won't be included in the measure reporting or modifications.") - next - end - - # get the absoluteAzimuth for the surface so we can categorize it - absoluteAzimuth = OpenStudio.convert(s.azimuth, 'rad', 'deg').get + s.space.get.directionofRelativeNorth + model.getBuilding.northAxis - absoluteAzimuth -= 360.0 until absoluteAzimuth < 360.0 - - if facade == 'North' - next if !((absoluteAzimuth >= 315.0) || (absoluteAzimuth < 45.0)) - elsif facade == 'East' - next if !((absoluteAzimuth >= 45.0) && (absoluteAzimuth < 135.0)) - elsif facade == 'South' - next if !((absoluteAzimuth >= 135.0) && (absoluteAzimuth < 225.0)) - elsif facade == 'West' - next if !((absoluteAzimuth >= 225.0) && (absoluteAzimuth < 315.0)) - elsif facade == 'All' - # no next needed - else - runner.registerError('Unexpected value of facade: ' + facade + '.') - return false - end - + Functions.get_surfaces_or_subsurfaces_by_facade(model.getSurfaces, facade).sort.each do |s| # get surface area adjusting for zone multiplier space = s.space if !space.empty? diff --git a/lib/measures/SetWindowToWallRatioByFacade/resources/functions.rb b/lib/measures/SetWindowToWallRatioByFacade/resources/functions.rb index d9b555b7..36524b81 100644 --- a/lib/measures/SetWindowToWallRatioByFacade/resources/functions.rb +++ b/lib/measures/SetWindowToWallRatioByFacade/resources/functions.rb @@ -2,6 +2,70 @@ module Functions + # return an array of surfaces or subsurfaces from a specific facade. + def self.get_surfaces_or_subsurfaces_by_facade(surfaces_or_subsurfaces, facade) + surfaces_or_subsurfaces_by_facade = [] + + surfaces_or_subsurfaces.each do |surface_or_subsurface| + + case surface_or_subsurface.class.to_s.gsub('OpenStudio::Model::', '') + when 'Surface' + next if surface_or_subsurface.surfaceType != 'Wall' + next if surface_or_subsurface.outsideBoundaryCondition != 'Outdoors' + if surface_or_subsurface.space.empty? + runner.registerWarning("#{surface_or_subsurface.name} doesn't have a parent space and won't be included in the measure reporting or modifications.") + next + end + direction_of_relative_north = surface_or_subsurface.space.get.directionofRelativeNorth + when 'SubSurface' + next if surface_or_subsurface.subSurfaceType == 'Door' || surface_or_subsurface.subSurfaceType == 'OverheadDoor' + direction_of_relative_north = surface_or_subsurface.surface.get.space.get.directionofRelativeNorth + end + + # get the absoluteAzimuth for the surface so we can categorize it + absoluteAzimuth = OpenStudio.convert(surface_or_subsurface.azimuth, 'rad', 'deg').get + direction_of_relative_north + surface_or_subsurface.model.getBuilding.northAxis + absoluteAzimuth -= 360.0 until absoluteAzimuth < 360.0 + + if facade == 'North' + next if !((absoluteAzimuth >= 315.0) || (absoluteAzimuth < 45.0)) + elsif facade == 'East' + next if !((absoluteAzimuth >= 45.0) && (absoluteAzimuth < 135.0)) + elsif facade == 'South' + next if !((absoluteAzimuth >= 135.0) && (absoluteAzimuth < 225.0)) + elsif facade == 'West' + next if !((absoluteAzimuth >= 225.0) && (absoluteAzimuth < 315.0)) + elsif facade == 'All' + # no next needed + else + runner.registerError('Unexpected value of facade: ' + facade + '.') + return false + end + + surfaces_or_subsurfaces_by_facade << surface_or_subsurface + + end + + return surfaces_or_subsurfaces_by_facade + end + + # return a hash of subsurface constructions. + def self.get_orig_sub_surf_const_for_target(subsurfaces) + orig_sub_surf_const_for_target = {} + + subsurfaces.each do |subsurface| + next if subsurface.subSurfaceType == "Door" || subsurface.subSurfaceType == "OverheadDoor" + if subsurface.construction.is_initialized + if orig_sub_surf_const_for_target.key?(subsurface.construction.get) + orig_sub_surf_const_for_target[subsurface.construction.get] += 1 + else + orig_sub_surf_const_for_target[subsurface.construction.get] = 1 + end + end + end + + return orig_sub_surf_const_for_target + end + # see if surface is rectangular (only checking non rotated on vertical wall) # todo - add in more robust rectangle check that can look for rotate and tilted rectangles def self.rectangle?(surface) From a090788b5685454d22bd327548fbae0c98063e39 Mon Sep 17 00:00:00 2001 From: Matt Steen Date: Fri, 18 Mar 2022 16:36:28 -0600 Subject: [PATCH 13/19] remove .rb extension from require_relative --- lib/measures/SetWindowToWallRatioByFacade/measure.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/measures/SetWindowToWallRatioByFacade/measure.rb b/lib/measures/SetWindowToWallRatioByFacade/measure.rb index e7c6efe8..d3847730 100644 --- a/lib/measures/SetWindowToWallRatioByFacade/measure.rb +++ b/lib/measures/SetWindowToWallRatioByFacade/measure.rb @@ -33,7 +33,7 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # ******************************************************************************* -require_relative 'resources/functions.rb' +require_relative 'resources/functions' class SetWindowToWallRatioByFacade < OpenStudio::Measure::ModelMeasure # override name to return the name of your script From 77f27a518842916b95efc908ed3b5837df650e65 Mon Sep 17 00:00:00 2001 From: Mike Lovejoy <69771412+Ski90Moo@users.noreply.github.com> Date: Sun, 10 Apr 2022 11:01:02 -0700 Subject: [PATCH 14/19] Update measure.rb Made the glare sensor optional. This allows the measure to run even if the model does not have a glare sensor object assigned. --- lib/measures/radiance_measure/measure.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/measures/radiance_measure/measure.rb b/lib/measures/radiance_measure/measure.rb index bb09c1f8..78f4092f 100644 --- a/lib/measures/radiance_measure/measure.rb +++ b/lib/measures/radiance_measure/measure.rb @@ -1317,7 +1317,7 @@ def parseResults(t_cmds, t_space_names_to_calculate, t_spaceWidths, t_spaceHeigh # iterate over each sensor and combine the views together new_hash = {} - t_radGlareSensorViews[space_name].each do |sensor, v| + t_radGlareSensorViews[space_name]&.each do |sensor, v| new_hash[sensor] = v[hour] end splitvalues[space_name] += [new_hash] From 6676eda87c4d07200379140cdac3c7c4f11e4518 Mon Sep 17 00:00:00 2001 From: David Goldwasser Date: Tue, 19 Apr 2022 21:52:47 -0600 Subject: [PATCH 15/19] setting building and space type standard to Blend --- ...ces_with_blended_space_type_design_doc.txt | 0 .../blended_space_type_from_model/measure.rb | 5 + .../blended_space_type_from_model/measure.xml | 32 +- .../resources/os_lib_model_simplification.rb | 1049 ----------------- 4 files changed, 18 insertions(+), 1068 deletions(-) rename lib/measures/blended_space_type_from_model/{resources => docs}/replace_occupied_spaces_with_blended_space_type_design_doc.txt (100%) delete mode 100644 lib/measures/blended_space_type_from_model/resources/os_lib_model_simplification.rb diff --git a/lib/measures/blended_space_type_from_model/resources/replace_occupied_spaces_with_blended_space_type_design_doc.txt b/lib/measures/blended_space_type_from_model/docs/replace_occupied_spaces_with_blended_space_type_design_doc.txt similarity index 100% rename from lib/measures/blended_space_type_from_model/resources/replace_occupied_spaces_with_blended_space_type_design_doc.txt rename to lib/measures/blended_space_type_from_model/docs/replace_occupied_spaces_with_blended_space_type_design_doc.txt diff --git a/lib/measures/blended_space_type_from_model/measure.rb b/lib/measures/blended_space_type_from_model/measure.rb index b7087635..c76c1b76 100644 --- a/lib/measures/blended_space_type_from_model/measure.rb +++ b/lib/measures/blended_space_type_from_model/measure.rb @@ -195,6 +195,11 @@ def run(model, runner, user_arguments) final_cond_space_type_hash = {} model.getSpaceTypes.sort.each do |space_type| next if space_type.floorArea == 0 + + # assign blend out building and space type standards (after update in ext gem can be removed here) + space_type.setStandardsBuildingType('Blend') + space_type.setStandardsSpaceType('Blend') + floor_area_si = 0 # loop through spaces so I can skip if not included in floor area space_type.spaces.each do |space| diff --git a/lib/measures/blended_space_type_from_model/measure.xml b/lib/measures/blended_space_type_from_model/measure.xml index c59794e9..5dc7218d 100644 --- a/lib/measures/blended_space_type_from_model/measure.xml +++ b/lib/measures/blended_space_type_from_model/measure.xml @@ -3,8 +3,8 @@ 3.0 blended_space_type_from_model 667c2f1f-0927-4dbd-a7be-1087b5c15181 - 2ee4ffb6-cb22-4420-b340-1e0aefeb70fb - 20210423T142526Z + 51464ec5-37db-4bfd-9055-544422bbaf6b + 20220420T035154Z 28AD5222 BlendedSpaceTypeFromModel Blended Space Type from Model @@ -96,12 +96,6 @@ test F1C3606F - - replace_occupied_spaces_with_blended_space_type_design_doc.txt - txt - resource - C2673B6F - large_hotel_restaurant_from_create_typical.osm osm @@ -132,18 +126,18 @@ readmeerb 703C9964 - - os_lib_model_simplification.rb - rb - resource - 026886BB - LICENSE.md md license A21A3ED2 + + measure_test.rb + rb + test + 28954A91 + OpenStudio @@ -153,13 +147,13 @@ measure.rb rb script - 7C94729F + 943C9732 - measure_test.rb - rb - test - 28954A91 + replace_occupied_spaces_with_blended_space_type_design_doc.txt + txt + doc + C2673B6F diff --git a/lib/measures/blended_space_type_from_model/resources/os_lib_model_simplification.rb b/lib/measures/blended_space_type_from_model/resources/os_lib_model_simplification.rb deleted file mode 100644 index 6c9b8689..00000000 --- a/lib/measures/blended_space_type_from_model/resources/os_lib_model_simplification.rb +++ /dev/null @@ -1,1049 +0,0 @@ -# ******************************************************************************* -# OpenStudio(R), Copyright (c) 2008-2021, Alliance for Sustainable Energy, LLC. -# All rights reserved. -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# -# (1) Redistributions of source code must retain the above copyright notice, -# this list of conditions and the following disclaimer. -# -# (2) 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. -# -# (3) Neither the name of the copyright holder nor the names of any contributors -# may be used to endorse or promote products derived from this software without -# specific prior written permission from the respective party. -# -# (4) Other than as required in clauses (1) and (2), distributions in any form -# of modifications or other derivative works may not use the "OpenStudio" -# trademark, "OS", "os", or any other confusingly similar designation without -# specific prior written permission from Alliance for Sustainable Energy, LLC. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) AND ANY 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(S), ANY CONTRIBUTORS, THE -# UNITED STATES GOVERNMENT, OR THE UNITED STATES DEPARTMENT OF ENERGY, NOR ANY OF -# THEIR EMPLOYEES, 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. -# ******************************************************************************* - -module OsLib_ModelSimplification - # get all loads for a space_or_space_type and place in hash by type - def gather_internal_loads(space_or_space_type) - internal_load_hash = {} - - # gather different load types (all vectors except dsoa which will be turned into an array) - internal_load_hash[:internal_mass] = space_or_space_type.internalMass - internal_load_hash[:people] = space_or_space_type.people - internal_load_hash[:lights] = space_or_space_type.lights - internal_load_hash[:luminaires] = space_or_space_type.luminaires - internal_load_hash[:electric_equipment] = space_or_space_type.electricEquipment - internal_load_hash[:gas_equipment] = space_or_space_type.gasEquipment - internal_load_hash[:hot_water_equipment] = space_or_space_type.hotWaterEquipment - internal_load_hash[:steam_equipment] = space_or_space_type.steamEquipment - internal_load_hash[:other_equipment] = space_or_space_type.otherEquipment - internal_load_hash[:space_infiltration_design_flow_rates] = space_or_space_type.spaceInfiltrationDesignFlowRates - internal_load_hash[:space_infiltration_effective_leakage_areas] = space_or_space_type.spaceInfiltrationEffectiveLeakageAreas - if space_or_space_type.designSpecificationOutdoorAir.nil? - internal_load_hash[:design_specification_outdoor_air] = [] - else - internal_load_hash[:design_specification_outdoor_air] = [space_or_space_type.designSpecificationOutdoorAir] - end - if space_or_space_type.class.to_s == 'OpenStudio::Model::Space' - internal_load_hash[:water_use_equipment] = space_or_space_type.waterUseEquipment # don't think this reports - internal_load_hash[:daylighting_controls] = space_or_space_type.daylightingControls - end - - # TODO: - warn if daylighting controls in spaces (should I alter fraction controled based on lighting per area ratio) - - return internal_load_hash - end - - # blend_space_types_from_floor_area_ratio used when working from space type ratio and un-assigned space types - def blend_space_types_from_floor_area_ratio(runner, model, space_type_ratio_hash) - # create stub blended space type - blended_space_type = OpenStudio::Model::SpaceType.new(model) - blended_space_type.setName('Blended Space Type') - - # TODO: - inspect people instances and see if any defs are not normalized per area. If find any issue warning - - # gather inputs - sum_of_num_people_per_m_2 = 0.0 - space_type_ratio_hash.each do |space_type, ratios| - # get number of peple per m 2 for space type. Can do this without looking at instances - sum_of_num_people_per_m_2 += space_type.getPeoplePerFloorArea(1.0) - end - - # raw num_people_ratios - sum_area_adj_num_people_ratio = 0.0 - space_type_ratio_hash.each do |space_type, ratios| - # calculate num_people_ratios - area_adj_num_people_ratio = (space_type.getPeoplePerFloorArea(1.0) / sum_of_num_people_per_m_2) * ratios[:floor_area_ratio] - sum_area_adj_num_people_ratio += area_adj_num_people_ratio - end - - # set ratios - largest_space_type = nil - largest_space_type_ratio = 0.00 - space_type_ratio_hash.each do |space_type, ratios| - # calculate num_people_ratios - area_adj_num_people_ratio = (space_type.getPeoplePerFloorArea(1.0) / sum_of_num_people_per_m_2) * ratios[:floor_area_ratio] - normalized_area_adj_num_people_ratio = area_adj_num_people_ratio / sum_area_adj_num_people_ratio - - # ratios[:floor_area_ratio] is already defined - ratios[:num_people_ratio] = normalized_area_adj_num_people_ratio.round(4) - ratios[:ext_surface_area_ratio] = ratios[:floor_area_ratio] - ratios[:ext_wall_area_ratio] = ratios[:floor_area_ratio] - ratios[:volume_ratio] = ratios[:floor_area_ratio] - - # update largest space type values - if largest_space_type.nil? - largest_space_type = space_type - largest_space_type_ratio = ratios[:floor_area_ratio] - elsif ratios[:floor_area_ratio] > largest_space_type_ratio - largest_space_type = space_type - largest_space_type_ratio = ratios[:floor_area_ratio] - end - end - - if largest_space_type.nil? - runner.registerError("Didn't find any space types in model matching user argument string.") - return nil - end - - # set standards info for space type based on largest ratio (for use to apply HVAC system) - standards_building_type = largest_space_type.standardsBuildingType - standards_space_type = largest_space_type.standardsSpaceType - if standards_building_type.is_initialized - blended_space_type.setStandardsBuildingType(standards_building_type.get) - end - if standards_space_type.is_initialized - blended_space_type.setStandardsSpaceType(standards_space_type.get) - end - - # loop therough space types to get instances from and then remove - space_type_ratio_hash.each do |space_type, ratios| - # blend internal loads (nil is space_hash) - space_type_load_instances = blend_internal_loads(runner, model, space_type, blended_space_type, ratios, model.getBuilding.floorArea, nil) - runner.registerInfo("Blending #{space_type.name.get} with floor area ratio of #{ratios[:floor_area_ratio]} and number of people ratio of #{ratios[:num_people_ratio]}.") - - # delete space type. Don't want to leave in model since internal loads have been removed from it - space_type.remove - end - - return blended_space_type - end - - # takes in space type hash where each hash value is a colleciton of space types. Each collection is blended into it's own space type - # If key for any collection is "Building" it will also opererate on spaces that don't have space type assigned - # where a space assigned to a space type from a collection has space loads, those space loads are normalized and added to the blended space type - # load instances are maintained so that they can haave unique schedules, and can have EE measures selectivly applied. - def blend_space_type_collections(runner, model, space_type_hash) - # loop through building type hash to create multiple blends - space_type_hash.each do |collection_name, space_types| - if collection_name == 'Building' - space_array = model.getSpaces # use all space types, not just space types passed in - else - space_array = [] - space_types.each do |space_type| - space_array.concat(space_type.spaces) - end - end - - # calculate metrics for all spaces included in building area to pass into space_type and space hash - # note: in the future this may be a subset of spaces if blending into multiple space types vs. just one. - collection_totals = {} - collection_totals[:floor_area] = 0.0 - collection_totals[:num_people] = 0.0 - collection_totals[:ext_surface_area] = 0.0 - collection_totals[:ext_wall_area] = 0.0 - collection_totals[:volume] = 0.0 - space_array.each do |space| - next if !space.partofTotalFloorArea - collection_totals[:floor_area] += space.floorArea * space.multiplier - collection_totals[:num_people] += space.numberOfPeople * space.multiplier - collection_totals[:ext_surface_area] += space.exteriorArea * space.multiplier - collection_totals[:ext_wall_area] += space.exteriorWallArea * space.multiplier - collection_totals[:volume] += space.volume * space.multiplier - end - area_ip = OpenStudio.convert(collection_totals[:floor_area], 'm^2', 'ft^2').get - area_ip_neat = OpenStudio.toNeatString(area_ip, 2, true) - runner.registerInfo("#{collection_name} area is #{area_ip_neat} ft^2, number of people is #{collection_totals[:num_people].round(0)}.") - - # create hash of space types and floor area for all space types with area > 0 when spaces included in floor area - # code to gather space type areas came from openstudio_results measure. - space_type_hash = {} - largest_space_type = nil - largest_space_type_ratio = 0.00 - space_types.each do |space_type| - next if space_type.floorArea == 0 - space_type_totals = {} - space_type_totals[:floor_area] = 0.0 - space_type_totals[:num_people] = 0.0 - space_type_totals[:ext_surface_area] = 0.0 - space_type_totals[:ext_wall_area] = 0.0 - space_type_totals[:volume] = 0.0 - # loop through spaces so I can skip if not included in floor area - space_type.spaces.each do |space| - next if !space.partofTotalFloorArea - space_type_totals[:floor_area] += space.floorArea * space.multiplier - space_type_totals[:num_people] += space.numberOfPeople * space.multiplier - space_type_totals[:ext_surface_area] += space.exteriorArea * space.multiplier - space_type_totals[:ext_wall_area] += space.exteriorWallArea * space.multiplier - space_type_totals[:volume] += space.volume * space.multiplier - end - - # update largest space type values - if largest_space_type.nil? - largest_space_type = space_type - largest_space_type_ratio = space_type_totals[:floor_area] - elsif space_type_totals[:floor_area] > largest_space_type_ratio - largest_space_type = space_type - largest_space_type_ratio = space_type_totals[:floor_area] - end - - # gather internal loads - space_type_loads_hash = gather_internal_loads(space_type) - - # don't add to hash if no spaces used for space type are included in building area (e.g. plenum and attic) - # todo - log these and decide what to do for them. Leave loads alone or remove, do they add to blend at all? - next if space_type_totals[:floor_area] == 0 - - if !space_type_totals[:floor_area] = space_type.floorArea # TODO: - not sure if these would ever show as different - runner.registerWarning("Some but not all spaces of #{space_type.name} space type are not included in the building floor area. May have unexpected results") - end - - # populate space type hash - space_type_hash[space_type] = { int_loads: space_type_loads_hash, totals: space_type_totals } - end - - # report initial condition of model - runner.registerInfo("#{collection_name} accounts for #{space_type_hash.size} space types.") - - if collection_name == 'Building' - # count area of spaces that have no space type - no_space_type_area_counter = 0 - model.getSpaces.each do |space| - if space.spaceType.empty? - next if !space.partofTotalFloorArea - no_space_type_area_counter += space.floorArea * space.multiplier - end - end - floor_area_ratio = no_space_type_area_counter / collection_totals[:floor_area] - if floor_area_ratio > 0 - runner.registerInfo("#{floor_area_ratio} fraction of building area is composed of spaces without space type assignments.") - end - end - - # report the space ratio for hard spaces - space_hash = {} - space_array.each do |space| - next if !space.partofTotalFloorArea - space_loads_hash = gather_internal_loads(space) - space_totals = {} - space_totals[:floor_area] = space.floorArea * space.multiplier - space_totals[:num_people] = space.numberOfPeople * space.multiplier - space_totals[:ext_surface_area] = space.exteriorArea * space.multiplier - space_totals[:ext_wall_area] = space.exteriorWallArea * space.multiplier - space_totals[:volume] = space.volume * space.multiplier - if !space_loads_hash[:daylighting_controls].empty? - runner.registerWarning("#{space.name} has one or more daylighting controls. Lighting loads from blended space type may affect lighting reduction from daylighting controls.") - end - if !space_loads_hash[:water_use_equipment].empty? - runner.registerInfo("One ore more water use equipment objects are associated with space #{space.name}. This can't be moved to a space type.") - end - # note: If generating ratios without geometry can calculate people_ratio given space_types floor_area_ratio - space_hash[space] = { int_loads: space_loads_hash, totals: space_totals } - end - - # create stub blended space type - blended_space_type = OpenStudio::Model::SpaceType.new(model) - blended_space_type.setName("#{collection_name} Blended Space Type") - - # set standards info for space type based on largest ratio (for use to apply HVAC system) - standards_building_type = largest_space_type.standardsBuildingType - standards_space_type = largest_space_type.standardsSpaceType - if standards_building_type.is_initialized - blended_space_type.setStandardsBuildingType(standards_building_type.get) - end - if standards_space_type.is_initialized - blended_space_type.setStandardsSpaceType(standards_space_type.get) - end - - # values from collection hash - collection_floor_area = collection_totals[:floor_area] - collection_num_people = collection_totals[:num_people] - collection_ext_surface_area = collection_totals[:ext_surface_area] - collection_ext_wall_area = collection_totals[:ext_wall_area] - collection_volume = collection_totals[:volume] - - # loop through space that have one or more spaces included in the building area - space_type_hash.each do |space_type, hash| - # hard assign space load schedules before re-assign instances to blended space type - space_type.hardApplySpaceLoadSchedules - - # vaules from space or space_type - floor_area = hash[:totals][:floor_area] - num_people = hash[:totals][:num_people] - ext_surface_area = hash[:totals][:ext_surface_area] - ext_wall_area = hash[:totals][:ext_wall_area] - volume = hash[:totals][:volume] - - # ratios - ratios = {} - if collection_floor_area > 0 - ratios[:floor_area_ratio] = floor_area / collection_floor_area - else - ratios[:floor_area_ratio] = 0.0 - end - if collection_num_people > 0 - ratios[:num_people_ratio] = num_people / collection_num_people - else - ratios[:num_people_ratio] = 0.0 - end - if collection_ext_surface_area > 0 - ratios[:ext_surface_area_ratio] = ext_surface_area / collection_ext_surface_area - else - ratios[:ext_surface_area_ratio] = 0.0 - end - if collection_ext_wall_area > 0 - ratios[:ext_wall_area_ratio] = ext_wall_area / collection_ext_wall_area - else - ratios[:ext_wall_area_ratio] = 0.0 - end - if collection_volume > 0 - ratios[:volume_ratio] = volume / collection_volume - else - ratios[:volume_ratio] = 0.0 - end - - # populate blended space type with space type loads - space_type_load_instances = blend_internal_loads(runner, model, space_type, blended_space_type, ratios, collection_floor_area, space_hash) - runner.registerInfo("Blending space type #{space_type.name}. Floor area ratio is #{(hash[:totals][:floor_area] / collection_totals[:floor_area]).round(3)}. People ratio is #{(hash[:totals][:num_people] / collection_totals[:num_people]).round(3)}") - - # hard assign any constructions assigned by space types, except for space not included in the building area - if space_type.defaultConstructionSet.is_initialized - runner.registerInfo("Hard assigning constructions for #{space_type.name}.") - space_type.spaces.each(&:hardApplyConstructions) - end - - # remove all space type assignments, except for spaces not included in building area. - space_type.spaces.each do |space| - next if !space.partofTotalFloorArea - space.resetSpaceType - end - - # delete space type. Don't want to leave in model since internal loads have been removed from it - space_type.remove - end - - # loop through spaces that are included in building area - space_hash.each do |space, hash| - # hard assign space load schedules before re-assign instances to blended space type - space.hardApplySpaceLoadSchedules - - # vaules from space or space_type - floor_area = hash[:totals][:floor_area] - num_people = hash[:totals][:num_people] - ext_surface_area = hash[:totals][:ext_surface_area] - ext_wall_area = hash[:totals][:ext_wall_area] - volume = hash[:totals][:volume] - - # ratios - ratios = {} - if collection_floor_area > 0 - ratios[:floor_area_ratio] = floor_area / collection_floor_area - else - ratios[:floor_area_ratio] = 0.0 - end - if collection_num_people > 0 - ratios[:num_people_ratio] = num_people / collection_num_people - else - ratios[:num_people_ratio] = 0.0 - end - if collection_ext_surface_area > 0 - ratios[:ext_surface_area_ratio] = ext_surface_area / collection_ext_surface_area - else - ratios[:ext_surface_area_ratio] = 0.0 - end - if collection_ext_wall_area > 0 - ratios[:ext_wall_area_ratio] = ext_wall_area / collection_ext_wall_area - else - ratios[:ext_wall_area_ratio] = 0.0 - end - if collection_volume > 0 - ratios[:volume_ratio] = volume / collection_volume - else - ratios[:volume_ratio] = 0.0 - end - - # populate blended space type with space loads - space_load_instances = blend_internal_loads(runner, model, space, blended_space_type, ratios, collection_floor_area, space_hash) - next if space_load_instances.empty? - runner.registerInfo("Blending space #{space.name}. Floor area ratio is #{(hash[:totals][:floor_area] / collection_totals[:floor_area]).round(3)}. People ratio is #{(hash[:totals][:num_people] / collection_totals[:num_people]).round(3)}") - end - - if collection_name == 'Building' - # assign blended space type to building - model.getBuilding.setSpaceType(blended_space_type) - building_space_type = model.getBuilding.spaceType - else - space_array.each do |space| - space.setSpaceType(blended_space_type) - end - end - end - - return model.getSpaceTypes - end - - # blend internal loads used when working from existing model - def blend_internal_loads(runner, model, source_space_or_space_type, target_space_type, ratios, collection_floor_area, space_hash) - # ratios - floor_area_ratio = ratios[:floor_area_ratio] - num_people_ratio = ratios[:num_people_ratio] - ext_surface_area_ratio = ratios[:ext_surface_area_ratio] - ext_wall_area_ratio = ratios[:ext_wall_area_ratio] - volume_ratio = ratios[:volume_ratio] - - # for normalizing design level loads I need to know effective number of spaces instance is applied to - if source_space_or_space_type.to_Space.is_initialized - eff_num_spaces = source_space_or_space_type.multiplier - else - eff_num_spaces = 0 - source_space_or_space_type.spaces.each do |space| - eff_num_spaces += space.multiplier - end - end - - # array of load instacnes re-assigned to blended space - instances_array = [] - - # internal_mass - source_space_or_space_type.internalMass.each do |load_inst| - load_def = load_inst.definition.to_InternalMassDefinition.get - if load_def.surfaceArea.is_initialized - # edit and assign a clone of definition and normalize per area based on floor area ratio - if collection_floor_area == 0 - runner.registerWarning("Can't determine building floor area to normalize #{load_def}. #{load_inst} will be asigned the the blended space without altering its values.") - else - cloned_load_def = load_def.clone(model).to_InternalMass.get - orig_design_level = cloned_load_def.surfaceArea.get - cloned_load_def.setSurfaceAreaperSpaceFloorArea(eff_num_spaces * orig_design_level / collection_floor_area) - cloned_load_def.setName("#{cloned_load_def.name} - pre-normalized value was #{orig_design_level.round} m^2.") - load_inst.setInternalMassDefinition(cloned_load_def) - end - elsif load_def.surfaceAreaperSpaceFloorArea.is_initialized - load_inst.setMultiplier(load_inst.multiplier * floor_area_ratio) - elsif load_def.surfaceAreaperPerson.is_initialized - if num_people_ratio.nil? - runner.registerError("#{load_def} has value defined per person, but people ratio wasn't passed in") - return false - else - load_inst.setMultiplier(load_inst.multiplier * num_people_ratio) - end - else - runner.registerError("Unexpected value type for #{load_def.name}") - return false - end - load_inst.setSpaceType(target_space_type) - instances_array << load_inst - end - - # people - source_space_or_space_type.people.each do |load_inst| - load_def = load_inst.definition.to_PeopleDefinition.get - if load_def.numberofPeople.is_initialized - # edit and assign a clone of definition and normalize per area based on floor area ratio - if collection_floor_area == 0 - runner.registerWarning("Can't determine building floor area to normalize #{load_def}. #{load_inst} will be asigned the the blended space without altering its values.") - else - cloned_load_def = load_def.clone(model).to_PeopleDefinition.get - orig_design_level = cloned_load_def.numberofPeople.get - cloned_load_def.setPeopleperSpaceFloorArea(eff_num_spaces * orig_design_level / collection_floor_area) - cloned_load_def.setName("#{cloned_load_def.name} - pre-normalized value was #{orig_design_level.round} people.") - load_inst.setPeopleDefinition(cloned_load_def) - end - elsif load_def.peopleperSpaceFloorArea.is_initialized - load_inst.setMultiplier(load_inst.multiplier * floor_area_ratio) - elsif load_def.spaceFloorAreaperPerson.is_initialized - load_inst.setMultiplier(load_inst.multiplier * floor_area_ratio) - else - runner.registerError("Unexpected value type for #{load_def.name}") - return false - end - load_inst.setSpaceType(target_space_type) - instances_array << load_inst - end - - # lights - source_space_or_space_type.lights.each do |load_inst| - load_def = load_inst.definition.to_LightsDefinition.get - if load_def.lightingLevel.is_initialized - # edit and assign a clone of definition and normalize per area based on floor area ratio - if collection_floor_area == 0 - runner.registerWarning("Can't determine building floor area to normalize #{load_def}. #{load_inst} will be asigned the the blended space without altering its values.") - else - cloned_load_def = load_def.clone(model).to_LightsDefinition.get - orig_design_level = cloned_load_def.lightingLevel.get - cloned_load_def.setWattsperSpaceFloorArea(eff_num_spaces * orig_design_level / collection_floor_area) - cloned_load_def.setName("#{cloned_load_def.name} - pre-normalized value was #{orig_design_level.round} W.") - load_inst.setLightsDefinition(cloned_load_def) - end - elsif load_def.wattsperSpaceFloorArea.is_initialized - load_inst.setMultiplier(load_inst.multiplier * floor_area_ratio) - elsif load_def.wattsperPerson.is_initialized - if num_people_ratio.nil? - runner.registerError("#{load_def} has value defined per person, but people ratio wasn't passed in") - return false - else - load_inst.setMultiplier(load_inst.multiplier * num_people_ratio) - end - else - runner.registerError("Unexpected value type for #{load_def.name}") - return false - end - load_inst.setSpaceType(target_space_type) - instances_array << load_inst - end - - # luminaires - source_space_or_space_type.luminaires.each do |load_inst| - # TODO: - can't normalize luminaire. Replace it with similar normalized lights def and instance - runner.registerWarning("Can't area normalize luminaire. Instance will be applied to every space using the blended space type") - instances_array << load_inst - end - - # electric_equipment - source_space_or_space_type.electricEquipment.each do |load_inst| - load_def = load_inst.definition.to_ElectricEquipmentDefinition.get - if load_def.designLevel.is_initialized - # edit and assign a clone of definition and normalize per area based on floor area ratio - if collection_floor_area == 0 - runner.registerWarning("Can't determine building floor area to normalize #{load_def}. #{load_inst} will be asigned the the blended space without altering its values.") - else - cloned_load_def = load_def.clone(model).to_ElectricEquipmentDefinition.get - orig_design_level = cloned_load_def.designLevel.get - cloned_load_def.setWattsperSpaceFloorArea(eff_num_spaces * orig_design_level / collection_floor_area) - cloned_load_def.setName("#{cloned_load_def.name} - pre-normalized value was #{orig_design_level.round} W.") - load_inst.setElectricEquipmentDefinition(cloned_load_def) - end - elsif load_def.wattsperSpaceFloorArea.is_initialized - load_inst.setMultiplier(load_inst.multiplier * floor_area_ratio) - elsif load_def.wattsperPerson.is_initialized - if num_people_ratio.nil? - runner.registerError("#{load_def} has value defined per person, but people ratio wasn't passed in") - return false - else - load_inst.setMultiplier(load_inst.multiplier * num_people_ratio) - end - else - runner.registerError("Unexpected value type for #{load_def.name}") - return false - end - load_inst.setSpaceType(target_space_type) - instances_array << load_inst - end - - # gas_equipment - source_space_or_space_type.gasEquipment.each do |load_inst| - load_def = load_inst.definition.to_GasEquipmentDefinition.get - if load_def.designLevel.is_initialized - # edit and assign a clone of definition and normalize per area based on floor area ratio - if collection_floor_area == 0 - runner.registerWarning("Can't determine building floor area to normalize #{load_def}. #{load_inst} will be asigned the the blended space without altering its values.") - else - cloned_load_def = load_def.clone(model).to_GasEquipmentDefinition.get - orig_design_level = cloned_load_def.designLevel.get - cloned_load_def.setWattsperSpaceFloorArea(eff_num_spaces * orig_design_level / collection_floor_area) - cloned_load_def.setName("#{cloned_load_def.name} - pre-normalized value was #{orig_design_level.round} W.") - load_inst.setGasEquipmentDefinition(cloned_load_def) - end - elsif load_def.wattsperSpaceFloorArea.is_initialized - load_inst.setMultiplier(load_inst.multiplier * floor_area_ratio) - elsif load_def.wattsperPerson.is_initialized - if num_people_ratio.nil? - runner.registerError("#{load_def} has value defined per person, but people ratio wasn't passed in") - return false - else - load_inst.setMultiplier(load_inst.multiplier * num_people_ratio) - end - else - runner.registerError("Unexpected value type for #{load_def.name}") - return false - end - load_inst.setSpaceType(target_space_type) - instances_array << load_inst - end - - # hot_water_equipment - source_space_or_space_type.hotWaterEquipment.each do |load_inst| - load_def = load_inst.definition.to_HotWaterDefinition.get - if load_def.designLevel.is_initialized - # edit and assign a clone of definition and normalize per area based on floor area ratio - if collection_floor_area == 0 - runner.registerWarning("Can't determine building floor area to normalize #{load_def}. #{load_inst} will be asigned the the blended space without altering its values.") - else - cloned_load_def = load_def.clone(model).to_HotWaterEquipmentDefinition.get - orig_design_level = cloned_load_def.designLevel.get - cloned_load_def.setWattsperSpaceFloorArea(eff_num_spaces * orig_design_level / collection_floor_area) - cloned_load_def.setName("#{cloned_load_def.name} - pre-normalized value was #{orig_design_level.round} W.") - load_inst.setHotWaterEquipmentDefinition(cloned_load_def) - end - elsif load_def.wattsperSpaceFloorArea.is_initialized - load_inst.setMultiplier(load_inst.multiplier * floor_area_ratio) - elsif load_def.wattsperPerson.is_initialized - if num_people_ratio.nil? - runner.registerError("#{load_def} has value defined per person, but people ratio wasn't passed in") - return false - else - load_inst.setMultiplier(load_inst.multiplier * num_people_ratio) - end - else - runner.registerError("Unexpected value type for #{load_def.name}") - return false - end - load_inst.setSpaceType(target_space_type) - instances_array << load_inst - end - - # steam_equipment - source_space_or_space_type.steamEquipment.each do |load_inst| - load_def = load_inst.definition.to_SteamDefinition.get - if load_def.designLevel.is_initialized - # edit and assign a clone of definition and normalize per area based on floor area ratio - if collection_floor_area == 0 - runner.registerWarning("Can't determine building floor area to normalize #{load_def}. #{load_inst} will be asigned the the blended space without altering its values.") - else - cloned_load_def = load_def.clone(model).to_SteamEquipmentDefinition.get - orig_design_level = cloned_load_def.designLevel.get - cloned_load_def.setWattsperSpaceFloorArea(eff_num_spaces * orig_design_level / collection_floor_area) - cloned_load_def.setName("#{cloned_load_def.name} - pre-normalized value was #{orig_design_level.round} W.") - load_inst.setSteamEquipmentDefinition(cloned_load_def) - end - elsif load_def.wattsperSpaceFloorArea.is_initialized - load_inst.setMultiplier(load_inst.multiplier * floor_area_ratio) - elsif load_def.wattsperPerson.is_initialized - if num_people_ratio.nil? - runner.registerError("#{load_def} has value defined per person, but people ratio wasn't passed in") - return false - else - load_inst.setMultiplier(load_inst.multiplier * num_people_ratio) - end - else - runner.registerError("Unexpected value type for #{load_def.name}") - return false - end - load_inst.setSpaceType(target_space_type) - instances_array << load_inst - end - - # other_equipment - source_space_or_space_type.otherEquipment.each do |load_inst| - load_def = load_inst.definition.to_OtherDefinition.get - if load_def.designLevel.is_initialized - # edit and assign a clone of definition and normalize per area based on floor area ratio - if collection_floor_area == 0 - runner.registerWarning("Can't determine building floor area to normalize #{load_def}. #{load_inst} will be asigned the the blended space without altering its values.") - else - cloned_load_def = load_def.clone(model).to_OtherEquipmentDefinition.get - orig_design_level = cloned_load_def.designLevel.get - cloned_load_def.setWattsperSpaceFloorArea(eff_num_spaces * orig_design_level / collection_floor_area) - cloned_load_def.setName("#{cloned_load_def.name} - pre-normalized value was #{orig_design_level.round} W.") - load_inst.setOtherEquipmentDefinition(cloned_load_def) - end - elsif load_def.wattsperSpaceFloorArea.is_initialized - load_inst.setMultiplier(load_inst.multiplier * floor_area_ratio) - elsif load_def.wattsperPerson.is_initialized - if num_people_ratio.nil? - runner.registerError("#{load_def} has value defined per person, but people ratio wasn't passed in") - return false - else - load_inst.setMultiplier(load_inst.multiplier * num_people_ratio) - end - else - runner.registerError("Unexpected value type for #{load_def.name}") - return false - end - load_inst.setSpaceType(target_space_type) - instances_array << load_inst - end - - # space_infiltration_design_flow_rates - source_space_or_space_type.spaceInfiltrationDesignFlowRates.each do |load_inst| - if load_inst.designFlowRateCalculationMethod == 'Flow/Space' - # edit load so normalized for building area - if collection_floor_area == 0 - runner.registerWarning("Can't determine building floor area to normalize #{load_def}. #{load_inst} will be asigned the the blended space without altering its values.") - else - orig_design_level = load_inst.designFlowRate.get - load_inst.setFlowperSpaceFloorArea(eff_num_spaces * orig_design_level / collection_floor_area) - load_inst.setName("#{load_inst.name} - pre-normalized value was #{orig_design_level} m^3/sec") - end - elsif load_inst.designFlowRateCalculationMethod == 'Flow/Area' - load_inst.setFlowperSpaceFloorArea(load_inst.flowperSpaceFloorArea.get * floor_area_ratio) - elsif load_inst.designFlowRateCalculationMethod == 'Flow/ExteriorArea' - load_inst.setFlowperExteriorSurfaceArea(load_inst.flowperExteriorSurfaceArea.get * ext_surface_area_ratio) - elsif load_inst.designFlowRateCalculationMethod == 'Flow/ExteriorWallArea' - load_inst.setFlowperExteriorWallArea(load_inst.flowperExteriorWallArea.get * ext_wall_area_ratio) - elsif load_inst.designFlowRateCalculationMethod == 'AirChanges/Hour' - load_inst.setAirChangesperHour (load_inst.airChangesperHour.get * volume_ratio) - else - runner.registerError("Unexpected value type for #{load_inst.name}") - return false - end - load_inst.setSpaceType(target_space_type) - instances_array << load_inst - end - - # space_infiltration_effective_leakage_areas - source_space_or_space_type.spaceInfiltrationEffectiveLeakageAreas.each do |load| - # TODO: - can't normalize space_infiltration_effective_leakage_areas. Come up with logic to address this - runner.registerWarning("Can't area normalize space_infiltration_effective_leakage_areas. It will be applied to every space using the blended space type") - load.setSpaceType(target_space_type) - instances_array << load - end - - # add OA object if it doesn't already exist - if target_space_type.designSpecificationOutdoorAir.is_initialized - blended_oa = target_space_type.designSpecificationOutdoorAir.get - else - blended_oa = OpenStudio::Model::DesignSpecificationOutdoorAir.new(model) - blended_oa.setName('Blended OA') - blended_oa.setOutdoorAirMethod('Sum') - target_space_type.setDesignSpecificationOutdoorAir(blended_oa) - instances_array << blended_oa - end - - # update OA object - if source_space_or_space_type.designSpecificationOutdoorAir.is_initialized - oa = source_space_or_space_type.designSpecificationOutdoorAir.get - oa_sch = nil - if oa.outdoorAirFlowRateFractionSchedule.is_initialized - # TODO: - improve logic to address multiple schedules - runner.registerWarning("Schedule #{oa.outdoorAirFlowRateFractionSchedule.get.name} assigned to #{oa.name} will be ignored. New OA object will not have a schedule assigned") - end - if oa.outdoorAirMethod == 'Maximum' - # TODO: - see if way to address this by pre-calculating the max and only entering that value for space type - runner.registerWarning("Outdoor air method of Maximum will be ignored for #{oa.name}. New OA object will have outdoor air method of Sum.") - end - # adjusted ratios for oa (lowered for space type if there is hard assigned oa load for one or more spaces) - oa_floor_area_ratio = floor_area_ratio - oa_num_people_ratio = num_people_ratio - if source_space_or_space_type.class.to_s == 'OpenStudio::Model::SpaceType' - source_space_or_space_type.spaces.each do |space| - if !space.isDesignSpecificationOutdoorAirDefaulted - if space_hash.nil? - runner.registerWarning('No space_hash passed in and model has OA designed at space level.') - else - oa_floor_area_ratio -= space_hash[space][:floor_area_ratio] - oa_num_people_ratio -= space_hash[space][:num_people_ratio] - end - end - end - end - # add to values of blended OA load - if oa.outdoorAirFlowperPerson > 0 - blended_oa.setOutdoorAirFlowperPerson(blended_oa.outdoorAirFlowperPerson + oa.outdoorAirFlowperPerson * oa_num_people_ratio) - end - if oa.outdoorAirFlowperFloorArea > 0 - blended_oa.setOutdoorAirFlowperFloorArea(blended_oa.outdoorAirFlowperFloorArea + oa.outdoorAirFlowperFloorArea * oa_floor_area_ratio) - end - if oa.outdoorAirFlowRate > 0 - - # calculate quantity for instance (doesn't exist as a method in api) - if source_space_or_space_type.class.to_s == 'OpenStudio::Model::SpaceType' - quantity = 0 - source_space_or_space_type.spaces.each do |space| - if !space.isDesignSpecificationOutdoorAirDefaulted - quantity += space.multiplier - end - end - else - quantity = source_space_or_space_type.multiplier - end - - # can't normalize air flow rate, convert to air flow rate per floor area - blended_oa.setOutdoorAirFlowperFloorArea(blended_oa.outdoorAirFlowperFloorArea + quantity * oa.outdoorAirFlowRate / collection_floor_area) - end - if oa.outdoorAirFlowAirChangesperHour > 0 - # floor area should be good approximation of area for multiplier - blended_oa.setOutdoorAirFlowAirChangesperHour(blended_oa.outdoorAirFlowAirChangesperHour + oa.outdoorAirFlowAirChangesperHour * oa_floor_area_ratio) - end - end - - # note: water_use_equipment can't be assigned to a space type. Leave it as is, if assigned to space type - # todo - if we use this measure with new geometry need to find a way to pull water use equipment loads into new model - - return instances_array - end - - # sort building stories - def sort_building_stories_and_get_min_multiplier(model) - sorted_building_stories = {} - # loop through stories - model.getBuildingStorys.each do |story| - story_min_z = nil - # loop through spaces in story. - story.spaces.each do |space| - space_z_min = OsLib_Geometry.getSurfaceZValues(space.surfaces.to_a).min + space.zOrigin - if story_min_z.nil? || (story_min_z > space_z_min) - story_min_z = space_z_min - end - end - sorted_building_stories[story] = story_min_z - end - - return sorted_building_stories - end - - # gather_envelope_data for envelope simplification - def gather_envelope_data(runner, model) - runner.registerInfo('Gathering envelope data.') - - # hash to contain envelope data - envelope_data_hash = {} - - # used for overhang and party wall orientation catigorization - facade_options = { - 'northEast' => 45, - 'southEast' => 125, - 'southWest' => 225, - 'northWest' => 315 - } - - # get building level inputs - envelope_data_hash[:north_axis] = model.getBuilding.northAxis - envelope_data_hash[:building_floor_area] = model.getBuilding.floorArea - envelope_data_hash[:building_exterior_surface_area] = model.getBuilding.exteriorSurfaceArea - envelope_data_hash[:building_exterior_wall_area] = model.getBuilding.exteriorWallArea - envelope_data_hash[:building_exterior_roof_area] = envelope_data_hash[:building_exterior_surface_area] - envelope_data_hash[:building_exterior_wall_area] - envelope_data_hash[:building_air_volume] = model.getBuilding.airVolume - envelope_data_hash[:building_perimeter] = nil # will be applied for first story without ground walls - - # get bounding_box - bounding_box = OpenStudio::BoundingBox.new - model.getSpaces.each do |space| - space.surfaces.each do |spaceSurface| - bounding_box.addPoints(space.transformation * spaceSurface.vertices) - end - end - min_x = bounding_box.minX.get - min_y = bounding_box.minY.get - min_z = bounding_box.minZ.get - max_x = bounding_box.maxX.get - max_y = bounding_box.maxY.get - max_z = bounding_box.maxZ.get - envelope_data_hash[:building_min_xyz] = [min_x, min_y, min_z] - envelope_data_hash[:building_max_xyz] = [max_x, max_y, max_z] - - # add orientation specific wwr - ext_surfaces_hash = OsLib_Geometry.getExteriorWindowAndWllAreaByOrientation(model, model.getSpaces.to_a) - envelope_data_hash[:building_wwr_n] = ext_surfaces_hash['northWindow'] / ext_surfaces_hash['northWall'] - envelope_data_hash[:building_wwr_s] = ext_surfaces_hash['southWindow'] / ext_surfaces_hash['southWall'] - envelope_data_hash[:building_wwr_e] = ext_surfaces_hash['eastWindow'] / ext_surfaces_hash['eastWall'] - envelope_data_hash[:building_wwr_w] = ext_surfaces_hash['westWindow'] / ext_surfaces_hash['westWall'] - envelope_data_hash[:stories] = {} # each entry will be hash with buildingStory as key and attributes has values - envelope_data_hash[:space_types] = {} # each entry will be hash with spaceType as key and attributes has values - - # as rough estimate overhang area / glazing area should be close to projection factor assuming overhang is same width as windows - # will only add building shading surfaces assoicated with a sub-surface. - building_overhang_area_n = 0.0 - building_overhang_area_s = 0.0 - building_overhang_area_e = 0.0 - building_overhang_area_w = 0.0 - - # loop through stories based on mine z height of surfaces. - sorted_stories = sort_building_stories_and_get_min_multiplier(model).sort_by { |k, v| v } - sorted_stories.each do |story, story_min_z| - story_min_multiplier = nil - story_footprint = nil - story_multiplied_floor_area = OsLib_HelperMethods.getAreaOfSpacesInArray(model, story.spaces, 'floorArea')['totalArea'] - # goal of footprint calc is to count multiplier for hotel room on facade,but not to count what is intended as a story multiplier - story_multiplied_exterior_surface_area = OsLib_HelperMethods.getAreaOfSpacesInArray(model, story.spaces, 'exteriorArea')['totalArea'] - story_multiplied_exterior_wall_area = OsLib_HelperMethods.getAreaOfSpacesInArray(model, story.spaces, 'exteriorWallArea')['totalArea'] - story_multiplied_exterior_roof_area = story_multiplied_exterior_surface_area - story_multiplied_exterior_wall_area - story_has_ground_walls = [] - story_has_adiabatic_walls = [] - story_included_in_building_area = false # will be true if any spaces on story are inclued in building area - story_max_z = nil - - # loop through spaces for story gathering information - story.spaces.each do |space| - # get min multiplier value - multiplier = space.multiplier - if story_min_multiplier.nil? || (story_min_multiplier > multiplier) - story_min_multiplier = multiplier - end - - # calculate footprint - story_footprint = story_multiplied_floor_area / story_min_multiplier - - # see if part of floor area - if space.partofTotalFloorArea - story_included_in_building_area = true - - # add to space type ratio hash when space is included in building floor area - if space.spaceType.is_initialized - space_type = space.spaceType.get - space_floor_area = space.floorArea * space.multiplier - if envelope_data_hash[:space_types].key?(space_type) - envelope_data_hash[:space_types][space_type][:floor_area] += space_floor_area - else - envelope_data_hash[:space_types][space_type] = {} - envelope_data_hash[:space_types][space_type][:floor_area] = space_floor_area - - # make hash for heating and cooling setpoints - envelope_data_hash[:space_types][space_type][:htg_setpoint] = {} - envelope_data_hash[:space_types][space_type][:clg_setpoint] = {} - - end - - # add heating and cooling setpoints - if space.thermalZone.is_initialized && space.thermalZone.get.thermostatSetpointDualSetpoint.is_initialized - thermostat = space.thermalZone.get.thermostatSetpointDualSetpoint.get - - # log heating schedule - if thermostat.heatingSetpointTemperatureSchedule.is_initialized - htg_sch = thermostat.heatingSetpointTemperatureSchedule.get - if envelope_data_hash[:space_types][space_type][:htg_setpoint].key?(htg_sch) - envelope_data_hash[:space_types][space_type][:htg_setpoint][htg_sch] += space_floor_area - else - envelope_data_hash[:space_types][space_type][:htg_setpoint][htg_sch] = space_floor_area - end - else - runner.registerWarning("#{space.thermalZone.get.name} containing #{space.name} doesn't have a heating setpoint schedule.") - end - - # log cooling schedule - if thermostat.coolingSetpointTemperatureSchedule.is_initialized - clg_sch = thermostat.coolingSetpointTemperatureSchedule.get - if envelope_data_hash[:space_types][space_type][:clg_setpoint].key?(clg_sch) - envelope_data_hash[:space_types][space_type][:clg_setpoint][clg_sch] += space_floor_area - else - envelope_data_hash[:space_types][space_type][:clg_setpoint][clg_sch] = space_floor_area - end - else - runner.registerWarning("#{space.thermalZone.get.name} containing #{space.name} doesn't have a heating setpoint schedule.") - end - - else - runner.registerWarning("#{space.name} either isn't in a thermal zone or doesn't have a thermostat assigned") - end - - else - runner.regsiterWarning("#{space.name} is included in the building floor area but isn't assigned a space type.") - end - - end - - # check for walls with adiabatic and ground boundary condition - space.surfaces.each do |surface| - next if surface.surfaceType != 'Wall' - if surface.outsideBoundaryCondition == 'Ground' - story_has_ground_walls << surface - elsif surface.outsideBoundaryCondition == 'Adiabatic' - story_has_adiabatic_walls << surface - end - end - - # populate overhang values - space.surfaces.each do |surface| - surface.subSurfaces.each do |sub_surface| - sub_surface.shadingSurfaceGroups.each do |shading_surface_group| - shading_surface_group.shadingSurfaces.each do |shading_surface| - absoluteAzimuth = OpenStudio.convert(sub_surface.azimuth, 'rad', 'deg').get + sub_surface.space.get.directionofRelativeNorth + model.getBuilding.northAxis - absoluteAzimuth -= 360.0 until absoluteAzimuth < 360.0 - # add to hash based on orientation - if (facade_options['northEast'] <= absoluteAzimuth) && (absoluteAzimuth < facade_options['southEast']) # East overhang - building_overhang_area_e += shading_surface.grossArea * space.multiplier - elsif (facade_options['southEast'] <= absoluteAzimuth) && (absoluteAzimuth < facade_options['southWest']) # South overhang - building_overhang_area_s += shading_surface.grossArea * space.multiplier - elsif (facade_options['southWest'] <= absoluteAzimuth) && (absoluteAzimuth < facade_options['northWest']) # West overhang - building_overhang_area_w += shading_surface.grossArea * space.multiplier - else # North overhang - building_overhang_area_n += shading_surface.grossArea * space.multiplier - end - end - end - end - end - - # get max z - space_z_max = OsLib_Geometry.getSurfaceZValues(space.surfaces.to_a).max + space.zOrigin - if story_max_z.nil? || (story_max_z > space_z_max) - story_max_z = space_z_max - end - end - - # populate hash for story data - envelope_data_hash[:stories][story] = {} - envelope_data_hash[:stories][story][:story_min_height] = story_min_z - envelope_data_hash[:stories][story][:story_max_height] = story_max_z - envelope_data_hash[:stories][story][:story_min_multiplier] = story_min_multiplier - envelope_data_hash[:stories][story][:story_has_ground_walls] = story_has_ground_walls - envelope_data_hash[:stories][story][:story_has_adiabatic_walls] = story_has_adiabatic_walls - envelope_data_hash[:stories][story][:story_included_in_building_area] = story_included_in_building_area - envelope_data_hash[:stories][story][:story_footprint] = story_footprint - envelope_data_hash[:stories][story][:story_multiplied_floor_area] = story_multiplied_floor_area - envelope_data_hash[:stories][story][:story_exterior_surface_area] = story_multiplied_exterior_surface_area - envelope_data_hash[:stories][story][:story_multiplied_exterior_wall_area] = story_multiplied_exterior_wall_area - envelope_data_hash[:stories][story][:story_multiplied_exterior_roof_area] = story_multiplied_exterior_roof_area - - # get perimeter and adiabatic walls that appear to be party walls - perimeter_and_party_walls = OsLib_Geometry.calculate_story_exterior_wall_perimeter(runner, story, story_min_multiplier, ['Outdoors', 'Ground', 'Adiabatic'], bounding_box) - envelope_data_hash[:stories][story][:story_perimeter] = perimeter_and_party_walls[:perimeter] - envelope_data_hash[:stories][story][:story_party_walls] = [] - east = false - south = false - west = false - north = false - perimeter_and_party_walls[:party_walls].each do |surface| - absoluteAzimuth = OpenStudio.convert(surface.azimuth, 'rad', 'deg').get + surface.space.get.directionofRelativeNorth + model.getBuilding.northAxis - absoluteAzimuth -= 360.0 until absoluteAzimuth < 360.0 - - # add to hash based on orientation (initially added array of sourfaces, but swtiched to just true/false flag) - if (facade_options['northEast'] <= absoluteAzimuth) && (absoluteAzimuth < facade_options['southEast']) # East party walls - east = true - elsif (facade_options['southEast'] <= absoluteAzimuth) && (absoluteAzimuth < facade_options['southWest']) # South party walls - south = true - elsif (facade_options['southWest'] <= absoluteAzimuth) && (absoluteAzimuth < facade_options['northWest']) # West party walls - west = true - else # North party walls - north = true - end - end - - if east then envelope_data_hash[:stories][story][:story_party_walls] << 'east' end - if south then envelope_data_hash[:stories][story][:story_party_walls] << 'south' end - if west then envelope_data_hash[:stories][story][:story_party_walls] << 'west' end - if north then envelope_data_hash[:stories][story][:story_party_walls] << 'north' end - - # store perimeter from first story that doesn't have ground walls - if story_has_ground_walls.empty? && envelope_data_hash[:building_perimeter].nil? - envelope_data_hash[:building_perimeter] = envelope_data_hash[:stories][story][:story_perimeter] - runner.registerInfo(" * #{story.name} is the first above grade story and will be used for the building perimeter.") - end - end - - envelope_data_hash[:building_overhang_proj_factor_n] = building_overhang_area_n / ext_surfaces_hash['northWindow'] - envelope_data_hash[:building_overhang_proj_factor_s] = building_overhang_area_s / ext_surfaces_hash['southWindow'] - envelope_data_hash[:building_overhang_proj_factor_e] = building_overhang_area_e / ext_surfaces_hash['eastWindow'] - envelope_data_hash[:building_overhang_proj_factor_w] = building_overhang_area_w / ext_surfaces_hash['westWindow'] - - # warn for spaces that are not on a story (in future could infer stories for these) - model.getSpaces.each do |space| - if !space.buildingStory.is_initialized - runner.registerWarning("#{space.name} is not on a building story, may have unexpected results.") - end - end - - return envelope_data_hash - end -end From 5191c1d7a438f670447566a47206c8fcba7a53bf Mon Sep 17 00:00:00 2001 From: Matt Steen Date: Mon, 25 Apr 2022 21:30:06 -0600 Subject: [PATCH 16/19] cleanup and fix Functions.requested_window_area_greater_than_max? --- .../resources/functions.rb | 41 ++++++++++++------- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/lib/measures/SetWindowToWallRatioByFacade/resources/functions.rb b/lib/measures/SetWindowToWallRatioByFacade/resources/functions.rb index 36524b81..88e15398 100644 --- a/lib/measures/SetWindowToWallRatioByFacade/resources/functions.rb +++ b/lib/measures/SetWindowToWallRatioByFacade/resources/functions.rb @@ -90,25 +90,36 @@ def self.rectangle?(surface) # return true if the requested window-to-wall area exceeds the maximum allowed area, false if not. # implements the following part of the applyViewAndDaylightingGlassRatios method, which is what setWindowToWallRatio uses. # https://github.com/NREL/OpenStudio/blob/760613c7ac9c2093f7dbd65f947a6853356c558d/src/utilities/geometry/Geometry.cpp#L605-L695 - def self.requested_window_area_greater_than_max?(surface, wwr) + def self.requested_window_area_greater_than_max?(surface, viewGlassToWallRatio) - viewGlassToWallRatio = wwr daylightingGlassToWallRatio = 0 totalWWR = viewGlassToWallRatio + daylightingGlassToWallRatio - xvals = [] - yvals = [] - surface.vertices.each do |vertex| - xvals << vertex.x - yvals << vertex.y + vertices = surface.vertices + transformation = OpenStudio::Transformation.alignFace(vertices) + faceVertices = transformation.inverse * vertices + + # // new coordinate system has z' in direction of outward normal, y' is up + xmin = 0 + xmax = 0 + ymin = 0 + ymax = 0 + faceVertices.each do |faceVertex| + xmin = [xmin, faceVertex.x].min + xmax = [xmax, faceVertex.x].max + ymin = [ymin, faceVertex.y].min + ymax = [ymax, faceVertex.y].max end oneInch = 0.0254 # meters + + # // DLM: preserve a 1" gap between window and edge to keep SketchUp happy minGlassToEdgeDistance = oneInch minViewToDaylightDistance = 0 - wallWidth = xvals.max - xvals.min - wallHeight = yvals.max - yvals.min + # // wall parameters + wallWidth = xmax - xmin + wallHeight = ymax - ymin wallArea = wallWidth * wallHeight # return false if wallWidth < 2 * minGlassToEdgeDistance @@ -116,15 +127,15 @@ def self.requested_window_area_greater_than_max?(surface, wwr) # return false if wallHeight < 2 * minGlassToEdgeDistance + minViewToDaylightDistance maxWindowArea = wallArea - 2 * wallHeight * minGlassToEdgeDistance - - (wallWidth - 2 * minGlassToEdgeDistance) * (2 * minGlassToEdgeDistance + minViewToDaylightDistance) - requestedViewArea = viewGlassToWallRatio * wallArea; - requestedDaylightingArea = daylightingGlassToWallRatio * wallArea; - requestedTotalWindowArea = totalWWR * wallArea; + - (wallWidth - 2 * minGlassToEdgeDistance) * (2 * minGlassToEdgeDistance + minViewToDaylightDistance) + requestedViewArea = viewGlassToWallRatio * wallArea + requestedDaylightingArea = daylightingGlassToWallRatio * wallArea + requestedTotalWindowArea = totalWWR * wallArea if requestedTotalWindowArea > maxWindowArea - return false - else return true + else + return false end end From 20d732a24a7d4c6525c72e611d6b4d5d210bfcd5 Mon Sep 17 00:00:00 2001 From: Matt Steen Date: Tue, 26 Apr 2022 13:01:18 -0600 Subject: [PATCH 17/19] hack for applying "maximum" wwr if requested exceeds it --- .../SetWindowToWallRatioByFacade/measure.rb | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/lib/measures/SetWindowToWallRatioByFacade/measure.rb b/lib/measures/SetWindowToWallRatioByFacade/measure.rb index d3847730..5b718b98 100644 --- a/lib/measures/SetWindowToWallRatioByFacade/measure.rb +++ b/lib/measures/SetWindowToWallRatioByFacade/measure.rb @@ -318,7 +318,7 @@ def run(model, runner, user_arguments) ss.triangulation.each do |tri| new_surface = OpenStudio::Model::Surface.new(tri, model) if new_surface.grossArea < triangulation_min_area - runner.registerWarning("triangulation produced a surface with area less than the minimum for surface = #{ss.name}") + runner.registerWarning("triangulation produced a surface with area less than minimum for surface = #{ss.name}") new_surface.remove next end @@ -417,8 +417,19 @@ def run(model, runner, user_arguments) when 4 case Functions.rectangle?(ss) when true - if Functions.requested_window_area_greater_than_max?(ss, wwr) - runner.registerWarning("window could not be added because the surface has 4 sides and is rectangular, but the WWR exceeds the maximum = #{ss.name}") + # if Functions.requested_window_area_greater_than_max?(ss, wwr) + # runner.registerWarning("window could not be added because the surface has 4 sides and is rectangular, but the WWR exceeds the maximum = #{ss.name}") + # end + # HACK until requested_window_area_greater_than_max? works. reduce by 0.01 to find the "maximum". + (1..(wwr / 0.1).floor).each do |i| + wwr_adj = wwr - (i / 100.0) + new_window = ss.setWindowToWallRatio(wwr_adj, sillHeight_si.value, true) + unless new_window.empty? + new_window = new_window.get + window_confirmed = true + runner.registerWarning("window-to-wall ratio exceeds maximum and was reduced to #{wwr_adj.round(3)} for surface = #{ss.name}") + break + end end when false if !triangulate From 444a9f323ce7c7f19ed5b5a83a36da647d26198b Mon Sep 17 00:00:00 2001 From: David Goldwasser Date: Thu, 5 May 2022 12:21:16 -0600 Subject: [PATCH 18/19] pre-release udpates --- CHANGELOG.md | 8 ++++++++ README.md | 1 + lib/openstudio/model_articulation/version.rb | 2 +- openstudio-model-articulation.gemspec | 2 +- 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a17803f4..196d40d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/README.md b/README.md index 383e3394..c5290cab 100644 --- a/README.md +++ b/README.md @@ -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 | diff --git a/lib/openstudio/model_articulation/version.rb b/lib/openstudio/model_articulation/version.rb index 7421ba13..9e23e66b 100644 --- a/lib/openstudio/model_articulation/version.rb +++ b/lib/openstudio/model_articulation/version.rb @@ -35,6 +35,6 @@ module OpenStudio module ModelArticulation - VERSION = '0.5.0'.freeze + VERSION = '0.6.0'.freeze end end diff --git a/openstudio-model-articulation.gemspec b/openstudio-model-articulation.gemspec index a0acd9ed..36a742dd 100644 --- a/openstudio-model-articulation.gemspec +++ b/openstudio-model-articulation.gemspec @@ -30,7 +30,7 @@ Gem::Specification.new do |spec| spec.add_dependency 'bundler', '~> 2.1' spec.add_dependency 'openstudio-extension', '~> 0.5.1' - spec.add_dependency 'openstudio-standards', '~> 0.2.15' + spec.add_dependency 'openstudio-standards', '~> 0.2.16' spec.add_development_dependency 'rake', '~> 13.0' spec.add_development_dependency 'rspec', '~> 3.9' From 8317d3b39df76ff800c0f11ba34c6d17d769fc28 Mon Sep 17 00:00:00 2001 From: David Goldwasser Date: Thu, 5 May 2022 12:30:59 -0600 Subject: [PATCH 19/19] running auto_correct and update, also added to readme --- .rubocop.yml | 3 +- README.md | 10 +- .../measure.xml | 20 +- .../AssignConstructionSetToBuilding_Test.rb | 6 +- .../AssignSpaceTypeBySpaceName/measure.xml | 36 +- .../tests/AssignSpaceTypeBySpaceName_Test.rb | 6 +- .../AssignSpaceTypeToBuilding/measure.xml | 20 +- .../tests/AssignSpaceTypeToBuilding_Test.rb | 6 +- lib/measures/AssignSpacesToStories/measure.rb | 6 +- .../AssignSpacesToStories/measure.xml | 20 +- .../tests/AssignSpacesToStories_Test.rb | 4 +- lib/measures/BarAspectRatioStudy/measure.rb | 3 +- lib/measures/BarAspectRatioStudy/measure.xml | 8 +- .../tests/BarAspectRatioStudy_Test.rb | 2 +- lib/measures/CleanupSpaceOrigins/measure.rb | 3 + lib/measures/CleanupSpaceOrigins/measure.xml | 20 +- .../tests/CleanupSpaceOrigins_Test.rb | 4 +- .../FindAndReplaceObjectNames/measure.xml | 16 +- .../tests/FindAndReplaceObjectNames_Test.rb | 4 +- .../measure.rb | 4 +- .../measure.xml | 26 +- ...InjectOsmGeometryIntoAnExternalIdf_Test.rb | 26 +- .../measure.xml | 16 +- .../RemoveHardAssignedConstructions_Test.rb | 4 +- .../measure.xml | 44 +- ...esBasedonParentSpaceandOrientation_Test.rb | 4 +- lib/measures/RotateBuilding/measure.xml | 16 +- .../tests/RotateBuilding_Test.rb | 4 +- .../measure.xml | 20 +- .../tests/SetExtWallToGroundByStory_Test.rb | 4 +- .../measure.rb | 2 +- .../measure.xml | 20 +- ...llsAndFloorsToSelectedConstruction_Test.rb | 4 +- .../measure.rb | 2 +- .../measure.xml | 20 +- ...nteriorWallstoSelectedConstruction_Test.rb | 4 +- .../SetWindowToWallRatioByFacade/measure.rb | 63 +- .../SetWindowToWallRatioByFacade/measure.xml | 20 +- .../resources/functions.rb | 71 +- .../SetWindowToWallRatioByFacade_Test.rb | 58 +- .../SimplifyGeometryToSlicedBar/measure.rb | 12 +- .../SimplifyGeometryToSlicedBar/measure.xml | 44 +- .../resources/os_lib_cofee.rb | 10 +- .../resources/os_lib_geometry.rb | 21 +- .../resources/os_lib_helper_methods.rb | 6 +- .../tests/SimplifyGeometryToSlicedBar_Test.rb | 4 +- .../measure.rb | 2 +- .../measure.xml | 8 +- .../SpaceTypeAndConstructionSetWizard_Test.rb | 18 +- lib/measures/SurfaceMatching/measure.rb | 1 + lib/measures/SurfaceMatching/measure.xml | 20 +- .../tests/SurfaceMatching_Test.rb | 4 +- .../measure.rb | 7 +- .../measure.xml | 8 +- .../tests/measure_test.rb | 8 +- .../blended_space_type_from_model/measure.rb | 13 +- .../blended_space_type_from_model/measure.xml | 20 +- .../tests/measure_test.rb | 4 +- .../measure.xml | 6 +- ...clone_building_from_external_model_test.rb | 14 +- .../create_DOE_prototype_building/measure.rb | 4 +- .../create_DOE_prototype_building/measure.xml | 880 +++++++++--------- .../create_DOE_prototype_building_test.rb | 2 +- .../measure.xml | 6 +- ...hermal_zones_for_unassigned_spaces_test.rb | 6 +- .../measure.rb | 6 +- .../measure.xml | 28 +- ...eate_bar_from_building_type_ratios_test.rb | 7 +- .../measure.rb | 6 +- .../measure.xml | 32 +- ...bar_from_deer_building_type_ratios_test.rb | 4 +- .../measure.rb | 6 +- .../measure.xml | 28 +- ..._bar_from_doe_building_type_ratios_test.rb | 4 +- lib/measures/create_bar_from_model/measure.rb | 16 +- .../create_bar_from_model/measure.xml | 8 +- .../tests/create_bar_from_model_test.rb | 38 +- .../measure.rb | 6 +- .../measure.xml | 32 +- .../create_bar_from_space_type_ratios_test.rb | 4 +- .../create_baseline_building/measure.rb | 5 +- .../create_baseline_building/measure.xml | 8 +- .../tests/create_baseline_building_test.rb | 2 +- .../measure.xml | 6 +- .../create_DEER_prototype_building_test.rb | 2 +- .../create_parametric_schedules/measure.rb | 25 +- .../create_parametric_schedules/measure.xml | 8 +- .../tests/create_parametric_schedules_test.rb | 4 +- .../measure.rb | 2 +- .../measure.xml | 42 +- ...create_typical_building_from_model_test.rb | 6 +- .../tests/measure_test_hvac.rb | 2 +- .../measure.rb | 2 +- .../measure.xml | 42 +- ...e_typical_deer_building_from_model_test.rb | 6 +- .../tests/measure_test_hvac.rb | 2 +- .../measure.rb | 2 +- .../measure.xml | 42 +- ...te_typical_doe_building_from_model_test.rb | 6 +- .../tests/measure_test_hvac.rb | 2 +- .../measure.rb | 2 +- .../measure.xml | 8 +- ...e_type_and_construction_set_wizard_Test.rb | 4 +- .../measure.xml | 6 +- ..._replace_in_all_thermal_zone_names_test.rb | 4 +- .../measure.rb | 2 + .../measure.xml | 8 +- ...surfaces_based_on_zone_multipliers_test.rb | 6 +- .../merge_floorspace_js_with_model/measure.rb | 5 +- .../measure.xml | 8 +- .../merge_floorspace_js_with_model_test.rb | 4 +- .../measure.xml | 6 +- .../merge_spaces_from_external_file_test.rb | 18 +- lib/measures/radiance_measure/measure.rb | 116 +-- lib/measures/radiance_measure/measure.xml | 8 +- .../tests/radiance_measure_test.rb | 19 +- .../radiant_slab_with_doas/measure.rb | 5 +- .../radiant_slab_with_doas/measure.xml | 8 +- .../tests/radiant_slab_with_doas_test.rb | 18 +- .../replace_geometry_by_story/measure.rb | 4 + .../replace_geometry_by_story/measure.xml | 8 +- .../tests/replace_geometry_by_story_test.rb | 6 +- lib/measures/scale_geometry/measure.xml | 6 +- .../tests/scale_geometry_test.rb | 14 +- 124 files changed, 1335 insertions(+), 1156 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index a2640fdc..33b37e3b 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -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 diff --git a/README.md b/README.md index c5290cab..5fb7ea24 100644 --- a/README.md +++ b/README.md @@ -64,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` diff --git a/lib/measures/AssignConstructionSetToBuilding/measure.xml b/lib/measures/AssignConstructionSetToBuilding/measure.xml index 2a762348..9f4123bb 100644 --- a/lib/measures/AssignConstructionSetToBuilding/measure.xml +++ b/lib/measures/AssignConstructionSetToBuilding/measure.xml @@ -3,8 +3,8 @@ 3.0 assign_construction_set_to_building 6e68ddea-2cff-47a3-9daf-f2189e4cf132 - 44de5d16-ee07-4122-bfd2-9b488da700f9 - 20210423T142509Z + 497da6f8-f10e-4c93-b5de-6d46027f0119 + 20220505T182919Z 1E963D9C AssignConstructionSetToBuilding AssignConstructionSetToBuilding @@ -17,10 +17,10 @@ Choice true false - {27349627-8827-46b4-80f7-4f0731404a8c} + {366b719d-cdcd-403e-82f2-1ff5eb23d1b8} - {27349627-8827-46b4-80f7-4f0731404a8c} + {366b719d-cdcd-403e-82f2-1ff5eb23d1b8} <clear field> @@ -73,17 +73,17 @@ script 40E5CA19 - - AssignConstructionSetToBuilding_Test.rb - rb - test - 51FB4344 - LICENSE.md md license A21A3ED2 + + AssignConstructionSetToBuilding_Test.rb + rb + test + EAEB5017 + diff --git a/lib/measures/AssignConstructionSetToBuilding/tests/AssignConstructionSetToBuilding_Test.rb b/lib/measures/AssignConstructionSetToBuilding/tests/AssignConstructionSetToBuilding_Test.rb index 55e2472d..b19d23f8 100644 --- a/lib/measures/AssignConstructionSetToBuilding/tests/AssignConstructionSetToBuilding_Test.rb +++ b/lib/measures/AssignConstructionSetToBuilding/tests/AssignConstructionSetToBuilding_Test.rb @@ -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 @@ -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 @@ -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 diff --git a/lib/measures/AssignSpaceTypeBySpaceName/measure.xml b/lib/measures/AssignSpaceTypeBySpaceName/measure.xml index 67b2c29b..150c0b64 100644 --- a/lib/measures/AssignSpaceTypeBySpaceName/measure.xml +++ b/lib/measures/AssignSpaceTypeBySpaceName/measure.xml @@ -3,8 +3,8 @@ 3.0 assign_space_type_by_space_name 69ad41bb-cdfe-4a4c-a385-9efaf35b7c27 - b6bc9d20-d8d1-4319-8cd1-c9e9afdb9773 - 20210423T142509Z + e60a2200-a654-4e1c-95fb-b19533ffb96b + 20220505T182934Z 057E8D9D AssignSpaceTypeBySpaceName AssignSpaceTypeBySpaceName @@ -24,10 +24,10 @@ Choice true false - {12c3c432-4def-4ca1-bfc7-8cecc9e88d88} + {ef3c55b4-9cb7-451d-8c82-00a6d685c59f} - {12c3c432-4def-4ca1-bfc7-8cecc9e88d88} + {ef3c55b4-9cb7-451d-8c82-00a6d685c59f} <clear field> @@ -98,17 +98,35 @@ script 6A6F122F + + LICENSE.md + md + license + A21A3ED2 + AssignSpaceTypeBySpaceName_Test.rb rb test - EA4BB066 + 4302B4E5 - LICENSE.md - md - license - A21A3ED2 + ImportedIdf_TestModel/project.log + log + test + 6D480771 + + + ImportedIdf_TestModel/run.db + db + test + BF4974CA + + + ImportedIdf_TestModel/project.osp + osp + test + 19B74631 diff --git a/lib/measures/AssignSpaceTypeBySpaceName/tests/AssignSpaceTypeBySpaceName_Test.rb b/lib/measures/AssignSpaceTypeBySpaceName/tests/AssignSpaceTypeBySpaceName_Test.rb index 8a034136..4f2097fd 100644 --- a/lib/measures/AssignSpaceTypeBySpaceName/tests/AssignSpaceTypeBySpaceName_Test.rb +++ b/lib/measures/AssignSpaceTypeBySpaceName/tests/AssignSpaceTypeBySpaceName_Test.rb @@ -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 @@ -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 @@ -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 diff --git a/lib/measures/AssignSpaceTypeToBuilding/measure.xml b/lib/measures/AssignSpaceTypeToBuilding/measure.xml index 316a8d40..e3b6c441 100644 --- a/lib/measures/AssignSpaceTypeToBuilding/measure.xml +++ b/lib/measures/AssignSpaceTypeToBuilding/measure.xml @@ -3,8 +3,8 @@ 3.0 assign_space_type_to_building 05e20922-6fe4-48a4-bddb-411f8167e757 - 0ca1ef7f-22e8-4e62-b013-a4d40186aeb0 - 20210423T142509Z + affc7390-ec3e-41fb-a814-adc09ac4ab80 + 20220505T182919Z 057E8D9D AssignSpaceTypeToBuilding AssignSpaceTypeToBuilding @@ -17,10 +17,10 @@ Choice true false - {4d195512-5588-4038-a932-f9e242e346a6} + {045b3260-33ad-451f-9c68-f8e75c422740} - {4d195512-5588-4038-a932-f9e242e346a6} + {045b3260-33ad-451f-9c68-f8e75c422740} <clear field> @@ -73,17 +73,17 @@ script C904ACC5 - - AssignSpaceTypeToBuilding_Test.rb - rb - test - 0DA553E5 - LICENSE.md md license A21A3ED2 + + AssignSpaceTypeToBuilding_Test.rb + rb + test + E998ED20 + diff --git a/lib/measures/AssignSpaceTypeToBuilding/tests/AssignSpaceTypeToBuilding_Test.rb b/lib/measures/AssignSpaceTypeToBuilding/tests/AssignSpaceTypeToBuilding_Test.rb index de04da61..33cedeb9 100644 --- a/lib/measures/AssignSpaceTypeToBuilding/tests/AssignSpaceTypeToBuilding_Test.rb +++ b/lib/measures/AssignSpaceTypeToBuilding/tests/AssignSpaceTypeToBuilding_Test.rb @@ -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 @@ -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 @@ -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 diff --git a/lib/measures/AssignSpacesToStories/measure.rb b/lib/measures/AssignSpacesToStories/measure.rb index 264587d5..1f74d72b 100644 --- a/lib/measures/AssignSpacesToStories/measure.rb +++ b/lib/measures/AssignSpacesToStories/measure.rb @@ -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 diff --git a/lib/measures/AssignSpacesToStories/measure.xml b/lib/measures/AssignSpacesToStories/measure.xml index 44c5f779..3e190d93 100644 --- a/lib/measures/AssignSpacesToStories/measure.xml +++ b/lib/measures/AssignSpacesToStories/measure.xml @@ -3,8 +3,8 @@ 3.0 assign_spaces_to_stories 2c91fe40-db31-4334-a1dd-817cd419f1b6 - 6f11b9e3-a0c0-4624-8270-e6989aa85b98 - 20210423T142509Z + 4e02a25e-c2d0-4dbe-8359-0cc52c0d0930 + 20220505T182936Z 45097B60 AssignSpacesToStories AssignSpacesToStories @@ -47,6 +47,12 @@ readme 8BA985AD + + LICENSE.md + md + license + A21A3ED2 + OpenStudio @@ -56,19 +62,13 @@ measure.rb rb script - 43120824 + F3B0D790 AssignSpacesToStories_Test.rb rb test - D0D1E059 - - - LICENSE.md - md - license - A21A3ED2 + 2D0ACAFB diff --git a/lib/measures/AssignSpacesToStories/tests/AssignSpacesToStories_Test.rb b/lib/measures/AssignSpacesToStories/tests/AssignSpacesToStories_Test.rb index e1cf0ca9..98c60c54 100644 --- a/lib/measures/AssignSpacesToStories/tests/AssignSpacesToStories_Test.rb +++ b/lib/measures/AssignSpacesToStories/tests/AssignSpacesToStories_Test.rb @@ -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 @@ -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 diff --git a/lib/measures/BarAspectRatioStudy/measure.rb b/lib/measures/BarAspectRatioStudy/measure.rb index f0f01f30..0b63df28 100644 --- a/lib/measures/BarAspectRatioStudy/measure.rb +++ b/lib/measures/BarAspectRatioStudy/measure.rb @@ -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 diff --git a/lib/measures/BarAspectRatioStudy/measure.xml b/lib/measures/BarAspectRatioStudy/measure.xml index a72f2487..eb67f45f 100644 --- a/lib/measures/BarAspectRatioStudy/measure.xml +++ b/lib/measures/BarAspectRatioStudy/measure.xml @@ -3,8 +3,8 @@ 3.0 bar_aspect_ratio_study 3dcac94d-8a2e-43b6-8698-a3a4e8f3903f - fe5839ff-2dfe-4053-be2d-603a439ce7f9 - 20210423T142509Z + 360834b1-c338-4e27-a2f8-f22268563f3d + 20220505T182927Z 49BEF039 BarAspectRatioStudy Bar Aspect Ratio Study @@ -137,13 +137,13 @@ measure.rb rb script - 68A31043 + 1B314685 BarAspectRatioStudy_Test.rb rb test - B1DFBF18 + 92B6A007 diff --git a/lib/measures/BarAspectRatioStudy/tests/BarAspectRatioStudy_Test.rb b/lib/measures/BarAspectRatioStudy/tests/BarAspectRatioStudy_Test.rb index 18406731..6ddfc156 100644 --- a/lib/measures/BarAspectRatioStudy/tests/BarAspectRatioStudy_Test.rb +++ b/lib/measures/BarAspectRatioStudy/tests/BarAspectRatioStudy_Test.rb @@ -37,7 +37,7 @@ require 'openstudio/measure/ShowRunnerOutput' require 'fileutils' -require_relative '../measure.rb' +require_relative '../measure' require 'minitest/autorun' class BarAspectRatioStudy_Test < Minitest::Test diff --git a/lib/measures/CleanupSpaceOrigins/measure.rb b/lib/measures/CleanupSpaceOrigins/measure.rb index ea2f5c36..5891ed48 100644 --- a/lib/measures/CleanupSpaceOrigins/measure.rb +++ b/lib/measures/CleanupSpaceOrigins/measure.rb @@ -94,6 +94,7 @@ def cleanup_group(group) # do spaces first as these may contain other groups model.getSpaces.each do |space| next if !runner.inSelection(space) + cleanup_group(space) space.shadingSurfaceGroups.each do |group| @@ -108,12 +109,14 @@ def cleanup_group(group) # now do shading surfaces model.getShadingSurfaceGroups.each do |group| next if !runner.inSelection(group) + cleanup_group(group) end # now do interior partition surface groups model.getInteriorPartitionSurfaceGroups.each do |group| next if !runner.inSelection(group) + cleanup_group(group) end diff --git a/lib/measures/CleanupSpaceOrigins/measure.xml b/lib/measures/CleanupSpaceOrigins/measure.xml index d22efa80..8832e960 100644 --- a/lib/measures/CleanupSpaceOrigins/measure.xml +++ b/lib/measures/CleanupSpaceOrigins/measure.xml @@ -3,8 +3,8 @@ 3.0 cleanup_space_origins d81f8791-081d-4346-9f27-1b721d27ea86 - 2adda00f-77ef-4a17-a6cd-f4284f7e8ea2 - 20210423T142509Z + 74e7a69c-75df-45b7-85f1-bcfed9cd6aeb + 20220505T182929Z 45097B60 CleanupSpaceOrigins CleanupSpaceOrigins @@ -47,6 +47,12 @@ readme 6B7F3F48 + + LICENSE.md + md + license + A21A3ED2 + OpenStudio @@ -56,19 +62,13 @@ measure.rb rb script - AE1DED78 - - - LICENSE.md - md - license - A21A3ED2 + 692EC173 CleanupSpaceOrigins_Test.rb rb test - A470A74C + 61DA00EE diff --git a/lib/measures/CleanupSpaceOrigins/tests/CleanupSpaceOrigins_Test.rb b/lib/measures/CleanupSpaceOrigins/tests/CleanupSpaceOrigins_Test.rb index c01f539e..fa93686e 100644 --- a/lib/measures/CleanupSpaceOrigins/tests/CleanupSpaceOrigins_Test.rb +++ b/lib/measures/CleanupSpaceOrigins/tests/CleanupSpaceOrigins_Test.rb @@ -37,7 +37,7 @@ require 'openstudio/measure/ShowRunnerOutput' require 'fileutils' -require_relative '../measure.rb' +require_relative '../measure' require 'minitest/autorun' class CleanupSpaceOrigins_Test < Minitest::Test @@ -50,7 +50,7 @@ def test_CleanupSpaceOrigins # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/CleanupOrigin_Test.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/CleanupOrigin_Test.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get diff --git a/lib/measures/FindAndReplaceObjectNames/measure.xml b/lib/measures/FindAndReplaceObjectNames/measure.xml index 0a2f50d3..8ae6f26f 100644 --- a/lib/measures/FindAndReplaceObjectNames/measure.xml +++ b/lib/measures/FindAndReplaceObjectNames/measure.xml @@ -3,8 +3,8 @@ 3.0 find_and_replace_object_names f540d66c-800f-4187-81ee-957891034d56 - f4dd1c8b-15c6-4bdf-8e29-1a09915461c1 - 20210423T142510Z + 2d1b4b2e-c116-4e02-9485-1dd4d22fd6da + 20220505T182936Z F6B8F064 FindAndReplaceObjectNames Find and Replace Object Names in the Model @@ -85,17 +85,17 @@ script C9F4ECE0 - - FindAndReplaceObjectNames_Test.rb - rb - test - 4175F163 - LICENSE.md md license A21A3ED2 + + FindAndReplaceObjectNames_Test.rb + rb + test + 9E6692CB + diff --git a/lib/measures/FindAndReplaceObjectNames/tests/FindAndReplaceObjectNames_Test.rb b/lib/measures/FindAndReplaceObjectNames/tests/FindAndReplaceObjectNames_Test.rb index ec8c5abe..ed5c279d 100644 --- a/lib/measures/FindAndReplaceObjectNames/tests/FindAndReplaceObjectNames_Test.rb +++ b/lib/measures/FindAndReplaceObjectNames/tests/FindAndReplaceObjectNames_Test.rb @@ -37,7 +37,7 @@ require 'openstudio/measure/ShowRunnerOutput' require 'fileutils' -require_relative '../measure.rb' +require_relative '../measure' require 'minitest/autorun' class FindAndReplaceObjectNames_Test < Minitest::Test @@ -77,7 +77,7 @@ def test_FindAndReplaceObjectNames # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/EnvelopeAndLoadTestModel_01.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/EnvelopeAndLoadTestModel_01.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get diff --git a/lib/measures/InjectOsmGeometryIntoAnExternalIdf/measure.rb b/lib/measures/InjectOsmGeometryIntoAnExternalIdf/measure.rb index edf81f54..0a58b143 100644 --- a/lib/measures/InjectOsmGeometryIntoAnExternalIdf/measure.rb +++ b/lib/measures/InjectOsmGeometryIntoAnExternalIdf/measure.rb @@ -291,7 +291,7 @@ def insert_object(object, map) # create a list of objects to add objects = OpenStudio::IdfObjectVector.new - objectsToAdd.values.each do |object| + objectsToAdd.each_value do |object| idfObject = object.idfObject() objects << idfObject end @@ -322,7 +322,7 @@ def insert_object(object, map) # create a list of objects to add objects = OpenStudio::IdfObjectVector.new - objectsToAddFromSourceIDF.values.each do |idfObject| + objectsToAddFromSourceIDF.each_value do |idfObject| # idfObject = object.idfObject() objects << idfObject end diff --git a/lib/measures/InjectOsmGeometryIntoAnExternalIdf/measure.xml b/lib/measures/InjectOsmGeometryIntoAnExternalIdf/measure.xml index ffc164dd..e3c397c6 100644 --- a/lib/measures/InjectOsmGeometryIntoAnExternalIdf/measure.xml +++ b/lib/measures/InjectOsmGeometryIntoAnExternalIdf/measure.xml @@ -3,8 +3,8 @@ 3.0 inject_osm_geometry_into_an_external_idf 633cd1c5-5b55-4b50-ab20-cf2d2f7ddff8 - 172665e1-0401-4511-a31e-c4f24cf4f99b - 20210423T142510Z + adf510ba-1aac-4f89-8e7f-b0c1720ebf4a + 20220505T182928Z 3BE1CF9C InjectOsmGeometryIntoAnExternalIdf InjectOsmGeometryIntoAnExternalIdf @@ -168,13 +168,31 @@ Constructions and other resources won?t be moved back and forth but the surface measure.rb rb script - 466953F1 + D5B1BE30 InjectOsmGeometryIntoAnExternalIdf_Test.rb rb test - 7B655B56 + 0097ECFF + + + 4ZoneWithShading_Simple_1_AlteredGeo/run.db + db + test + D307F08F + + + RefBldgMediumOfficeNew2004_Chicago_AlteredGeo/run.db + db + test + 1387DFF3 + + + RefBldgMediumOfficeNew2004_Chicago_AlteredGeo_b/run.db + db + test + BF7FFB65 diff --git a/lib/measures/InjectOsmGeometryIntoAnExternalIdf/tests/InjectOsmGeometryIntoAnExternalIdf_Test.rb b/lib/measures/InjectOsmGeometryIntoAnExternalIdf/tests/InjectOsmGeometryIntoAnExternalIdf_Test.rb index 30b4a7a3..ba31dc23 100644 --- a/lib/measures/InjectOsmGeometryIntoAnExternalIdf/tests/InjectOsmGeometryIntoAnExternalIdf_Test.rb +++ b/lib/measures/InjectOsmGeometryIntoAnExternalIdf/tests/InjectOsmGeometryIntoAnExternalIdf_Test.rb @@ -36,7 +36,7 @@ require 'openstudio' require 'openstudio/measure/ShowRunnerOutput' require 'minitest/autorun' -require_relative '../measure.rb' +require_relative '../measure' require 'fileutils' class InjectOsmGeometryIntoAnExternalIdf_Test < MiniTest::Test @@ -61,13 +61,13 @@ def test_InjectOsmGeometryIntoAnExternalIdf_b measure = InjectOsmGeometryIntoAnExternalIdf.new # create an instance of a runner with OSW - osw_path = OpenStudio::Path.new(File.dirname(__FILE__) + '/measure_test.osw') + osw_path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/measure_test.osw") osw = OpenStudio::WorkflowJSON.load(osw_path).get runner = OpenStudio::Measure::OSRunner.new(osw) # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/RefBldgMediumOfficeNew2004_Chicago_AlteredGeo_b.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/RefBldgMediumOfficeNew2004_Chicago_AlteredGeo_b.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get @@ -83,7 +83,7 @@ def test_InjectOsmGeometryIntoAnExternalIdf_b count = -1 source_idf_path = arguments[count += 1].clone - assert(source_idf_path.setValue(File.dirname(__FILE__) + '/RefBldgMediumOfficeNew2004_Chicago.idf')) + assert(source_idf_path.setValue("#{File.dirname(__FILE__)}/RefBldgMediumOfficeNew2004_Chicago.idf")) argument_map['source_idf_path'] = source_idf_path merge_geometry_from_osm = arguments[count += 1].clone @@ -101,13 +101,13 @@ def test_InjectOsmGeometryIntoAnExternalIdf_c_NoNewGeometry measure = InjectOsmGeometryIntoAnExternalIdf.new # create an instance of a runner with OSW - osw_path = OpenStudio::Path.new(File.dirname(__FILE__) + '/measure_test.osw') + osw_path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/measure_test.osw") osw = OpenStudio::WorkflowJSON.load(osw_path).get runner = OpenStudio::Measure::OSRunner.new(osw) # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/RefBldgMediumOfficeNew2004_Chicago_AlteredGeo_b.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/RefBldgMediumOfficeNew2004_Chicago_AlteredGeo_b.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get @@ -123,7 +123,7 @@ def test_InjectOsmGeometryIntoAnExternalIdf_c_NoNewGeometry count = -1 source_idf_path = arguments[count += 1].clone - assert(source_idf_path.setValue(File.dirname(__FILE__) + '/RefBldgMediumOfficeNew2004_Chicago.idf')) + assert(source_idf_path.setValue("#{File.dirname(__FILE__)}/RefBldgMediumOfficeNew2004_Chicago.idf")) argument_map['source_idf_path'] = source_idf_path merge_geometry_from_osm = arguments[count += 1].clone @@ -145,13 +145,13 @@ def test_InjectOsmGeometryIntoAnExternalIdf_d_Simple measure = InjectOsmGeometryIntoAnExternalIdf.new # create an instance of a runner with OSW - osw_path = OpenStudio::Path.new(File.dirname(__FILE__) + '/measure_test.osw') + osw_path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/measure_test.osw") osw = OpenStudio::WorkflowJSON.load(osw_path).get runner = OpenStudio::Measure::OSRunner.new(osw) # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/4ZoneWithShading_Simple_1_AlteredGeo.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/4ZoneWithShading_Simple_1_AlteredGeo.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get @@ -167,7 +167,7 @@ def test_InjectOsmGeometryIntoAnExternalIdf_d_Simple count = -1 source_idf_path = arguments[count += 1].clone - assert(source_idf_path.setValue(File.dirname(__FILE__) + '/4ZoneWithShading_Simple_1.idf')) + assert(source_idf_path.setValue("#{File.dirname(__FILE__)}/4ZoneWithShading_Simple_1.idf")) argument_map['source_idf_path'] = source_idf_path merge_geometry_from_osm = arguments[count += 1].clone @@ -185,13 +185,13 @@ def test_InjectOsmGeometryIntoAnExternalIdf_e_LinksToSurfaces measure = InjectOsmGeometryIntoAnExternalIdf.new # create an instance of a runner with OSW - osw_path = OpenStudio::Path.new(File.dirname(__FILE__) + '/measure_test.osw') + osw_path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/measure_test.osw") osw = OpenStudio::WorkflowJSON.load(osw_path).get runner = OpenStudio::Measure::OSRunner.new(osw) # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/B10_Crawlspace_1Story_50_RibbonWindows_altered.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/B10_Crawlspace_1Story_50_RibbonWindows_altered.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get @@ -207,7 +207,7 @@ def test_InjectOsmGeometryIntoAnExternalIdf_e_LinksToSurfaces count = -1 source_idf_path = arguments[count += 1].clone - assert(source_idf_path.setValue(File.dirname(__FILE__) + '/B10_Crawlspace_1Story_50_RibbonWindows.idf')) + assert(source_idf_path.setValue("#{File.dirname(__FILE__)}/B10_Crawlspace_1Story_50_RibbonWindows.idf")) argument_map['source_idf_path'] = source_idf_path merge_geometry_from_osm = arguments[count += 1].clone diff --git a/lib/measures/RemoveHardAssignedConstructions/measure.xml b/lib/measures/RemoveHardAssignedConstructions/measure.xml index 697e3370..31c3fe27 100644 --- a/lib/measures/RemoveHardAssignedConstructions/measure.xml +++ b/lib/measures/RemoveHardAssignedConstructions/measure.xml @@ -3,8 +3,8 @@ 3.0 remove_hard_assigned_constructions 8fd2557e-907d-46a3-aebf-8cc81c58bc65 - 8b5b2fe1-0524-4b24-8f77-de57f98ed544 - 20210423T142510Z + 41caa15f-8f6a-4545-9420-268b9a1e02b8 + 20220505T182936Z 1E963D9C RemoveHardAssignedConstructions RemoveHardAssignedConstructions @@ -77,17 +77,17 @@ script F18D020C - - RemoveHardAssignedConstructions_Test.rb - rb - test - D38C492D - LICENSE.md md license A21A3ED2 + + RemoveHardAssignedConstructions_Test.rb + rb + test + A0577A5F + diff --git a/lib/measures/RemoveHardAssignedConstructions/tests/RemoveHardAssignedConstructions_Test.rb b/lib/measures/RemoveHardAssignedConstructions/tests/RemoveHardAssignedConstructions_Test.rb index 2feb6cb4..727b1a6c 100644 --- a/lib/measures/RemoveHardAssignedConstructions/tests/RemoveHardAssignedConstructions_Test.rb +++ b/lib/measures/RemoveHardAssignedConstructions/tests/RemoveHardAssignedConstructions_Test.rb @@ -37,7 +37,7 @@ require 'openstudio/measure/ShowRunnerOutput' require 'fileutils' -require_relative '../measure.rb' +require_relative '../measure' require 'minitest/autorun' class RemoveHardAssignedConstructions_Test < Minitest::Test @@ -50,7 +50,7 @@ def test_RemoveHardAssignedConstructions # 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 diff --git a/lib/measures/RenameSpaceSurfacesBasedonParentSpaceandOrientation/measure.xml b/lib/measures/RenameSpaceSurfacesBasedonParentSpaceandOrientation/measure.xml index feb7ec08..d038508b 100644 --- a/lib/measures/RenameSpaceSurfacesBasedonParentSpaceandOrientation/measure.xml +++ b/lib/measures/RenameSpaceSurfacesBasedonParentSpaceandOrientation/measure.xml @@ -3,8 +3,8 @@ 3.0 rename_space_surfaces_basedon_parent_spaceand_orientation fee62510-c076-423a-b172-0810ecedba10 - 7f0ce0f3-bfff-410c-8bfe-348b99bfb9a6 - 20210423T142510Z + 6bbf16de-c93b-4cdc-bd57-db83a9c5ca8c + 20220505T182919Z 0F858D9E RenameSpaceSurfacesBasedonParentSpaceandOrientation RenameSpaceSurfacesBasedonParentSpaceandOrientation @@ -68,17 +68,47 @@ script EB416F3D + + LICENSE.md + md + license + A21A3ED2 + RenameSpaceSurfacesBasedonParentSpaceandOrientation_Test.rb rb test - 9443B43B + CE99A0B2 - LICENSE.md - md - license - A21A3ED2 + Section 6 - Model/project.log + log + test + 00000000 + + + Section 6 - Model/project.osp-journal + osp-journal + test + 00E88397 + + + Section 6 - Model/run.db + db + test + 4D2285B9 + + + Section 6 - Model/files/USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw + epw + test + 3B177CE0 + + + Section 6 - Model/project.osp + osp + test + FD14D013 diff --git a/lib/measures/RenameSpaceSurfacesBasedonParentSpaceandOrientation/tests/RenameSpaceSurfacesBasedonParentSpaceandOrientation_Test.rb b/lib/measures/RenameSpaceSurfacesBasedonParentSpaceandOrientation/tests/RenameSpaceSurfacesBasedonParentSpaceandOrientation_Test.rb index 88b9ecb6..1e5c43d8 100644 --- a/lib/measures/RenameSpaceSurfacesBasedonParentSpaceandOrientation/tests/RenameSpaceSurfacesBasedonParentSpaceandOrientation_Test.rb +++ b/lib/measures/RenameSpaceSurfacesBasedonParentSpaceandOrientation/tests/RenameSpaceSurfacesBasedonParentSpaceandOrientation_Test.rb @@ -37,7 +37,7 @@ require 'openstudio/measure/ShowRunnerOutput' require 'fileutils' -require_relative '../measure.rb' +require_relative '../measure' require 'minitest/autorun' class RenameSpaceSurfacesBasedonParentSpaceandOrientation_Test < Minitest::Test @@ -56,7 +56,7 @@ def test_RenameSpaceSurfacesBasedonParentSpaceandOrientation # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/Section 6 - Model.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/Section 6 - Model.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get diff --git a/lib/measures/RotateBuilding/measure.xml b/lib/measures/RotateBuilding/measure.xml index d5f84768..949f6ee6 100644 --- a/lib/measures/RotateBuilding/measure.xml +++ b/lib/measures/RotateBuilding/measure.xml @@ -3,8 +3,8 @@ 3.0 rotate_building b2742307-bce7-4747-8f94-977718217305 - bdde9591-38c6-47ff-b43d-4e205864b64d - 20210423T142510Z + 6d681308-f06a-49a4-b29c-85e02c940245 + 20220505T182928Z 49BEF039 RotateBuilding Rotate Building @@ -73,12 +73,6 @@ readme 7E721F8C - - RotateBuilding_Test.rb - rb - test - 80D856EC - LICENSE.md md @@ -96,5 +90,11 @@ script 7A45B037 + + RotateBuilding_Test.rb + rb + test + 7844502E + diff --git a/lib/measures/RotateBuilding/tests/RotateBuilding_Test.rb b/lib/measures/RotateBuilding/tests/RotateBuilding_Test.rb index d6099c3f..ce6c3e26 100644 --- a/lib/measures/RotateBuilding/tests/RotateBuilding_Test.rb +++ b/lib/measures/RotateBuilding/tests/RotateBuilding_Test.rb @@ -37,7 +37,7 @@ require 'openstudio/measure/ShowRunnerOutput' require 'fileutils' -require_relative '../measure.rb' +require_relative '../measure' require 'minitest/autorun' class RotateBuilding_Test < Minitest::Test @@ -64,7 +64,7 @@ def test_RotateBuilding # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/RotateBuilding_TestModel_01.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/RotateBuilding_TestModel_01.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get diff --git a/lib/measures/SetExtWallToGroundBoundaryConditionByStory/measure.xml b/lib/measures/SetExtWallToGroundBoundaryConditionByStory/measure.xml index 9e8d6cbe..b49818c7 100644 --- a/lib/measures/SetExtWallToGroundBoundaryConditionByStory/measure.xml +++ b/lib/measures/SetExtWallToGroundBoundaryConditionByStory/measure.xml @@ -3,8 +3,8 @@ 3.0 set_ext_wall_to_ground_boundary_condition_by_story a6da6f2b-2d07-4d25-b2b4-4b1dd62df237 - 561e388e-2470-4fe4-89dd-53da429a4faa - 20210423T142510Z + 1aca0c67-bb5a-4d0d-ad64-42f3829fe1ba + 20220505T182931Z 0F858D9E SetExtWallToGroundBoundaryConditionByStory SetExtWallToGroundBoundaryConditionByStory @@ -76,17 +76,23 @@ script D74BDE59 + + LICENSE.md + md + license + A21A3ED2 + SetExtWallToGroundByStory_Test.rb rb test - 250AF3F7 + 43480F51 - LICENSE.md - md - license - A21A3ED2 + 3Story2Space/run.db + db + test + 761DC6F7 diff --git a/lib/measures/SetExtWallToGroundBoundaryConditionByStory/tests/SetExtWallToGroundByStory_Test.rb b/lib/measures/SetExtWallToGroundBoundaryConditionByStory/tests/SetExtWallToGroundByStory_Test.rb index 519f126c..0758be99 100644 --- a/lib/measures/SetExtWallToGroundBoundaryConditionByStory/tests/SetExtWallToGroundByStory_Test.rb +++ b/lib/measures/SetExtWallToGroundBoundaryConditionByStory/tests/SetExtWallToGroundByStory_Test.rb @@ -37,7 +37,7 @@ require 'openstudio/measure/ShowRunnerOutput' require 'fileutils' -require_relative '../measure.rb' +require_relative '../measure' require 'minitest/autorun' class SetExtWallToGroundBoundaryConditionByStory_Test < Minitest::Test @@ -50,7 +50,7 @@ def test_SetExtWallToGroundBoundaryConditionByStory # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/3Story2Space.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/3Story2Space.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get diff --git a/lib/measures/SetInteriorWallsAndFloorsToAdiabatic/measure.rb b/lib/measures/SetInteriorWallsAndFloorsToAdiabatic/measure.rb index a1123b81..ce443543 100644 --- a/lib/measures/SetInteriorWallsAndFloorsToAdiabatic/measure.rb +++ b/lib/measures/SetInteriorWallsAndFloorsToAdiabatic/measure.rb @@ -69,7 +69,7 @@ def arguments(model) end # looping through sorted hash of storys - construction_args_hash.sort.map do |key, value| # todo - could filter this so only constructions that are valid on opaque surfaces will show up. + construction_args_hash.sort.map do |key, value| # TODO: - could filter this so only constructions that are valid on opaque surfaces will show up. construction_handles << value.handle.to_s construction_display_names << key end diff --git a/lib/measures/SetInteriorWallsAndFloorsToAdiabatic/measure.xml b/lib/measures/SetInteriorWallsAndFloorsToAdiabatic/measure.xml index a1b8cb81..eec52547 100644 --- a/lib/measures/SetInteriorWallsAndFloorsToAdiabatic/measure.xml +++ b/lib/measures/SetInteriorWallsAndFloorsToAdiabatic/measure.xml @@ -3,8 +3,8 @@ 3.0 set_interior_walls_and_floors_to_adiabatic 78cbde97-d7c4-425f-ab74-5053a681cc4b - f5114792-b53a-425c-911d-10fd356d8e79 - 20210423T142510Z + 4ceba5f6-8f6f-4969-848c-0e5ffbfdfe75 + 20220505T182932Z 1E963D9C SetInteriorWallsAndFloorsToAdiabatic SetInteriorWallsAndFloorsToAdiabatic @@ -55,6 +55,12 @@ readme 26905DFE + + LICENSE.md + md + license + A21A3ED2 + OpenStudio @@ -64,19 +70,13 @@ measure.rb rb script - CEFB1A45 + 3EC935EF SetInteriorWallsAndFloorsToSelectedConstruction_Test.rb rb test - 39534274 - - - LICENSE.md - md - license - A21A3ED2 + 55AAC4F2 diff --git a/lib/measures/SetInteriorWallsAndFloorsToAdiabatic/tests/SetInteriorWallsAndFloorsToSelectedConstruction_Test.rb b/lib/measures/SetInteriorWallsAndFloorsToAdiabatic/tests/SetInteriorWallsAndFloorsToSelectedConstruction_Test.rb index 87a1af6d..abc25770 100644 --- a/lib/measures/SetInteriorWallsAndFloorsToAdiabatic/tests/SetInteriorWallsAndFloorsToSelectedConstruction_Test.rb +++ b/lib/measures/SetInteriorWallsAndFloorsToAdiabatic/tests/SetInteriorWallsAndFloorsToSelectedConstruction_Test.rb @@ -37,7 +37,7 @@ require 'openstudio/measure/ShowRunnerOutput' require 'fileutils' -require_relative '../measure.rb' +require_relative '../measure' require 'minitest/autorun' class SetInteriorWallsAndFloorsToAdiabatic_Test < Minitest::Test @@ -50,7 +50,7 @@ def test_SetInteriorWallsAndFloorsToAdiabatic # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/EnvelopeAndLoadTestModel_01.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/EnvelopeAndLoadTestModel_01.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get diff --git a/lib/measures/SetInteriorWallsToSelectedConstruction/measure.rb b/lib/measures/SetInteriorWallsToSelectedConstruction/measure.rb index 81112834..260d14d4 100644 --- a/lib/measures/SetInteriorWallsToSelectedConstruction/measure.rb +++ b/lib/measures/SetInteriorWallsToSelectedConstruction/measure.rb @@ -66,7 +66,7 @@ def arguments(model) end # looping through sorted hash of constructions - construction_args_hash.sort.map do |key, value| # todo - could filter this so only constructions that are valid on opaque surfaces will show up. + construction_args_hash.sort.map do |key, value| # TODO: - could filter this so only constructions that are valid on opaque surfaces will show up. construction_handles << value.handle.to_s construction_display_names << key end diff --git a/lib/measures/SetInteriorWallsToSelectedConstruction/measure.xml b/lib/measures/SetInteriorWallsToSelectedConstruction/measure.xml index f84797eb..b0cf3393 100644 --- a/lib/measures/SetInteriorWallsToSelectedConstruction/measure.xml +++ b/lib/measures/SetInteriorWallsToSelectedConstruction/measure.xml @@ -3,8 +3,8 @@ 3.0 set_interior_walls_to_selected_construction e3d59d0d-1ce8-4cb2-ae59-001f0fa2ac46 - b3a51cf7-1156-4d3b-9c68-3f76f16ae570 - 20210423T142511Z + bb0dd052-2f62-49ef-8e20-2e9c39786802 + 20220505T182927Z 1E963D9C SetInteriorWallsToSelectedConstruction SetInteriorWallsToSelectedConstruction @@ -55,6 +55,12 @@ readme C8974F9D + + LICENSE.md + md + license + A21A3ED2 + OpenStudio @@ -64,19 +70,13 @@ measure.rb rb script - 0293AC5B + DC3C3C85 SetInteriorWallstoSelectedConstruction_Test.rb rb test - EE1A5054 - - - LICENSE.md - md - license - A21A3ED2 + 17B7EFF1 diff --git a/lib/measures/SetInteriorWallsToSelectedConstruction/tests/SetInteriorWallstoSelectedConstruction_Test.rb b/lib/measures/SetInteriorWallsToSelectedConstruction/tests/SetInteriorWallstoSelectedConstruction_Test.rb index 7d7df446..86ed4ecd 100644 --- a/lib/measures/SetInteriorWallsToSelectedConstruction/tests/SetInteriorWallstoSelectedConstruction_Test.rb +++ b/lib/measures/SetInteriorWallsToSelectedConstruction/tests/SetInteriorWallstoSelectedConstruction_Test.rb @@ -37,7 +37,7 @@ require 'openstudio/measure/ShowRunnerOutput' require 'fileutils' -require_relative '../measure.rb' +require_relative '../measure' require 'minitest/autorun' class SetInteriorWallsToSelectedConstruction_Test < Minitest::Test @@ -50,7 +50,7 @@ def test_SetInteriorWallsToSelectedConstruction # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/EnvelopeAndLoadTestModel_01.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/EnvelopeAndLoadTestModel_01.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get diff --git a/lib/measures/SetWindowToWallRatioByFacade/measure.rb b/lib/measures/SetWindowToWallRatioByFacade/measure.rb index 5b718b98..26205098 100644 --- a/lib/measures/SetWindowToWallRatioByFacade/measure.rb +++ b/lib/measures/SetWindowToWallRatioByFacade/measure.rb @@ -202,6 +202,7 @@ def run(model, runner, user_arguments) surfaces = [] model.getSpaces.sort.each do |space| next if !space.partofTotalFloorArea + space.surfaces.sort.each do |surface| surfaces << surface end @@ -265,7 +266,8 @@ def run(model, runner, user_arguments) # remove windows before split at doors s.subSurfaces.each do |sub_surface| - next if ['Door','OverheadDoor'].include? sub_surface.subSurfaceType + next if ['Door', 'OverheadDoor'].include? sub_surface.subSurfaceType + sub_surface.remove end @@ -333,7 +335,7 @@ def run(model, runner, user_arguments) end # remove orig surface - ss.remove + ss.remove end else @@ -342,10 +344,10 @@ def run(model, runner, user_arguments) # add windows all_surfaces2.sort.each do |ss| - orig_sub_surf_constructions = {} ss.subSurfaces.sort.each do |sub_surf| next if sub_surf.subSurfaceType == 'Door' || sub_surf.subSurfaceType == 'OverheadDoor' + if sub_surf.construction.is_initialized if orig_sub_surf_constructions.key?(sub_surf.construction.get) orig_sub_surf_constructions[sub_surf.construction.get] += 1 @@ -369,38 +371,35 @@ def run(model, runner, user_arguments) if wwr > 0 && new_window.empty? # if new window is empty then inset base surface to add window (check may need to skip on base surfaces with doors) - if inset_tri_sub - - # skip of surface already has sub-surfaces or if not triangle - if ss.subSurfaces.empty? && ss.vertices.size <= 3 - # get centroid - vertices = ss.vertices - centroid = OpenStudio.getCentroid(vertices).get - x_cent = centroid.x - y_cent = centroid.y - z_cent = centroid.z - - # reduce vertices towards centroid - scale = Math.sqrt(wwr) - new_vertices = OpenStudio::Point3dVector.new - vertices.each do |vertex| - x = (vertex.x * scale + x_cent * (1.0 - scale)) - y = (vertex.y * scale + y_cent * (1.0 - scale)) - z = (vertex.z * scale + z_cent * (1.0 - scale)) - new_vertices << OpenStudio::Point3d.new(x, y, z) - end - - # create inset window - new_window = OpenStudio::Model::SubSurface.new(new_vertices, model) - new_window.setSurface(ss) - new_window.setSubSurfaceType('FixedWindow') - if non_rect_parent.key?(ss) - new_window.setConstruction(non_rect_parent[ss]) - end - window_confirmed = true + # skip of surface already has sub-surfaces or if not triangle + if inset_tri_sub && (ss.subSurfaces.empty? && ss.vertices.size <= 3) + # get centroid + vertices = ss.vertices + centroid = OpenStudio.getCentroid(vertices).get + x_cent = centroid.x + y_cent = centroid.y + z_cent = centroid.z + + # reduce vertices towards centroid + scale = Math.sqrt(wwr) + new_vertices = OpenStudio::Point3dVector.new + vertices.each do |vertex| + x = (vertex.x * scale + x_cent * (1.0 - scale)) + y = (vertex.y * scale + y_cent * (1.0 - scale)) + z = (vertex.z * scale + z_cent * (1.0 - scale)) + new_vertices << OpenStudio::Point3d.new(x, y, z) end + # create inset window + new_window = OpenStudio::Model::SubSurface.new(new_vertices, model) + new_window.setSurface(ss) + new_window.setSubSurfaceType('FixedWindow') + if non_rect_parent.key?(ss) + new_window.setConstruction(non_rect_parent[ss]) + end + window_confirmed = true end + else if wwr > 0 new_window = new_window.get diff --git a/lib/measures/SetWindowToWallRatioByFacade/measure.xml b/lib/measures/SetWindowToWallRatioByFacade/measure.xml index 00d9deab..e715fdf4 100644 --- a/lib/measures/SetWindowToWallRatioByFacade/measure.xml +++ b/lib/measures/SetWindowToWallRatioByFacade/measure.xml @@ -3,8 +3,8 @@ 3.0 set_window_to_wall_ratio_by_facade c567a0bf-a7d9-4a06-afe9-bf7df79e6bf8 - a09bb8ca-0336-4852-900d-2c6ea38f6dd0 - 20220315T180427Z + d0d69032-509b-4257-a4c5-74e0e4615cc4 + 20220505T182928Z 6DE831F7 SetWindowToWallRatioByFacade Set Window to Wall Ratio by Facade @@ -233,18 +233,18 @@ The measure doesn?t have any cost or lifecycle arguments, however If lifecycle o test 581DA01B - - SetWindowToWallRatioByFacade_Test.rb - rb - test - E24E266E - README.md md readme 7FCCDC8E + + SetWindowToWallRatioByFacade_Test.rb + rb + test + 2FAF08A3 + OpenStudio @@ -254,13 +254,13 @@ The measure doesn?t have any cost or lifecycle arguments, however If lifecycle o measure.rb rb script - F544FCEE + E1F85411 functions.rb rb resource - 63495E18 + 8AFBC32D diff --git a/lib/measures/SetWindowToWallRatioByFacade/resources/functions.rb b/lib/measures/SetWindowToWallRatioByFacade/resources/functions.rb index 88e15398..83082c43 100644 --- a/lib/measures/SetWindowToWallRatioByFacade/resources/functions.rb +++ b/lib/measures/SetWindowToWallRatioByFacade/resources/functions.rb @@ -1,17 +1,51 @@ +# ******************************************************************************* +# OpenStudio(R), Copyright (c) 2008-2021, Alliance for Sustainable Energy, LLC. +# All rights reserved. +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# (1) Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# (2) 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. +# +# (3) Neither the name of the copyright holder nor the names of any contributors +# may be used to endorse or promote products derived from this software without +# specific prior written permission from the respective party. +# +# (4) Other than as required in clauses (1) and (2), distributions in any form +# of modifications or other derivative works may not use the "OpenStudio" +# trademark, "OS", "os", or any other confusingly similar designation without +# specific prior written permission from Alliance for Sustainable Energy, LLC. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) AND ANY 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(S), ANY CONTRIBUTORS, THE +# UNITED STATES GOVERNMENT, OR THE UNITED STATES DEPARTMENT OF ENERGY, NOR ANY OF +# THEIR EMPLOYEES, 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. +# ******************************************************************************* + require 'openstudio' module Functions - # return an array of surfaces or subsurfaces from a specific facade. def self.get_surfaces_or_subsurfaces_by_facade(surfaces_or_subsurfaces, facade) surfaces_or_subsurfaces_by_facade = [] - + surfaces_or_subsurfaces.each do |surface_or_subsurface| - case surface_or_subsurface.class.to_s.gsub('OpenStudio::Model::', '') when 'Surface' - next if surface_or_subsurface.surfaceType != 'Wall' + next if surface_or_subsurface.surfaceType != 'Wall' next if surface_or_subsurface.outsideBoundaryCondition != 'Outdoors' + if surface_or_subsurface.space.empty? runner.registerWarning("#{surface_or_subsurface.name} doesn't have a parent space and won't be included in the measure reporting or modifications.") next @@ -19,30 +53,31 @@ def self.get_surfaces_or_subsurfaces_by_facade(surfaces_or_subsurfaces, facade) direction_of_relative_north = surface_or_subsurface.space.get.directionofRelativeNorth when 'SubSurface' next if surface_or_subsurface.subSurfaceType == 'Door' || surface_or_subsurface.subSurfaceType == 'OverheadDoor' + direction_of_relative_north = surface_or_subsurface.surface.get.space.get.directionofRelativeNorth end - + # get the absoluteAzimuth for the surface so we can categorize it absoluteAzimuth = OpenStudio.convert(surface_or_subsurface.azimuth, 'rad', 'deg').get + direction_of_relative_north + surface_or_subsurface.model.getBuilding.northAxis absoluteAzimuth -= 360.0 until absoluteAzimuth < 360.0 - - if facade == 'North' + + case facade + when 'North' next if !((absoluteAzimuth >= 315.0) || (absoluteAzimuth < 45.0)) - elsif facade == 'East' + when 'East' next if !((absoluteAzimuth >= 45.0) && (absoluteAzimuth < 135.0)) - elsif facade == 'South' + when 'South' next if !((absoluteAzimuth >= 135.0) && (absoluteAzimuth < 225.0)) - elsif facade == 'West' + when 'West' next if !((absoluteAzimuth >= 225.0) && (absoluteAzimuth < 315.0)) - elsif facade == 'All' + when 'All' # no next needed else - runner.registerError('Unexpected value of facade: ' + facade + '.') + runner.registerError("Unexpected value of facade: #{facade}.") return false end surfaces_or_subsurfaces_by_facade << surface_or_subsurface - end return surfaces_or_subsurfaces_by_facade @@ -53,7 +88,8 @@ def self.get_orig_sub_surf_const_for_target(subsurfaces) orig_sub_surf_const_for_target = {} subsurfaces.each do |subsurface| - next if subsurface.subSurfaceType == "Door" || subsurface.subSurfaceType == "OverheadDoor" + next if subsurface.subSurfaceType == 'Door' || subsurface.subSurfaceType == 'OverheadDoor' + if subsurface.construction.is_initialized if orig_sub_surf_const_for_target.key?(subsurface.construction.get) orig_sub_surf_const_for_target[subsurface.construction.get] += 1 @@ -91,7 +127,6 @@ def self.rectangle?(surface) # implements the following part of the applyViewAndDaylightingGlassRatios method, which is what setWindowToWallRatio uses. # https://github.com/NREL/OpenStudio/blob/760613c7ac9c2093f7dbd65f947a6853356c558d/src/utilities/geometry/Geometry.cpp#L605-L695 def self.requested_window_area_greater_than_max?(surface, viewGlassToWallRatio) - daylightingGlassToWallRatio = 0 totalWWR = viewGlassToWallRatio + daylightingGlassToWallRatio @@ -127,17 +162,15 @@ def self.requested_window_area_greater_than_max?(surface, viewGlassToWallRatio) # return false if wallHeight < 2 * minGlassToEdgeDistance + minViewToDaylightDistance maxWindowArea = wallArea - 2 * wallHeight * minGlassToEdgeDistance - - (wallWidth - 2 * minGlassToEdgeDistance) * (2 * minGlassToEdgeDistance + minViewToDaylightDistance) + - (wallWidth - 2 * minGlassToEdgeDistance) * (2 * minGlassToEdgeDistance + minViewToDaylightDistance) requestedViewArea = viewGlassToWallRatio * wallArea requestedDaylightingArea = daylightingGlassToWallRatio * wallArea requestedTotalWindowArea = totalWWR * wallArea - if requestedTotalWindowArea > maxWindowArea + if requestedTotalWindowArea > maxWindowArea return true else return false end - end - end diff --git a/lib/measures/SetWindowToWallRatioByFacade/tests/SetWindowToWallRatioByFacade_Test.rb b/lib/measures/SetWindowToWallRatioByFacade/tests/SetWindowToWallRatioByFacade_Test.rb index ffe72c4f..520e27d6 100644 --- a/lib/measures/SetWindowToWallRatioByFacade/tests/SetWindowToWallRatioByFacade_Test.rb +++ b/lib/measures/SetWindowToWallRatioByFacade/tests/SetWindowToWallRatioByFacade_Test.rb @@ -37,7 +37,7 @@ require 'openstudio/measure/ShowRunnerOutput' require 'fileutils' -require_relative '../measure.rb' +require_relative '../measure' require 'minitest/autorun' class SetWindowToWallRatioByFacade_Test < Minitest::Test @@ -88,7 +88,7 @@ def test_SetWindowToWallRatioByFacade_with_model # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/EnvelopeAndLoadTestModel_01.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/EnvelopeAndLoadTestModel_01.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get @@ -119,7 +119,7 @@ def test_SetWindowToWallRatioByFacade_with_model # assert(result.info.size == 2) # save the model - output_file_path = OpenStudio::Path.new(File.dirname(__FILE__) + '/output/south.osm') + output_file_path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/output/south.osm") model.save(output_file_path, true) end @@ -132,7 +132,7 @@ def test_SetWindowToWallRatioByFacade_with_model_RotationTest # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/EnvelopeAndLoadTestModel_02_RotatedSpaceAndBuilding.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/EnvelopeAndLoadTestModel_02_RotatedSpaceAndBuilding.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get @@ -163,7 +163,7 @@ def test_SetWindowToWallRatioByFacade_with_model_RotationTest # assert(result.info.size == 2) # save the model - output_file_path = OpenStudio::Path.new(File.dirname(__FILE__) + '/output/rotation.osm') + output_file_path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/output/rotation.osm") model.save(output_file_path, true) end @@ -176,7 +176,7 @@ def test_SetWindowToWallRatioByFacade_with_model_MinimalCost # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/EnvelopeAndLoadTestModel_01.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/EnvelopeAndLoadTestModel_01.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get @@ -216,7 +216,7 @@ def test_SetWindowToWallRatioByFacade_with_model_NoCost # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/EnvelopeAndLoadTestModel_01.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/EnvelopeAndLoadTestModel_01.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get @@ -256,7 +256,7 @@ def test_SetWindowToWallRatioByFacade_ReverseTranslatedModel # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/ReverseTranslatedModel.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/ReverseTranslatedModel.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get @@ -335,7 +335,7 @@ def test_triangle # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/Triangles.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/Triangles.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get @@ -367,7 +367,7 @@ def test_triangle assert(result.value.valueName == 'Success') # save the model - output_file_path = OpenStudio::Path.new(File.dirname(__FILE__) + '/output/triangle.osm') + output_file_path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/output/triangle.osm") model.save(output_file_path, true) end @@ -380,7 +380,7 @@ def test_pentagon # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/Triangles.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/Triangles.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get @@ -412,7 +412,7 @@ def test_pentagon # assert(result.value.valueName == 'Success') # save the model - output_file_path = OpenStudio::Path.new(File.dirname(__FILE__) + '/output/pentagon.osm') + output_file_path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/output/pentagon.osm") model.save(output_file_path, true) end @@ -425,7 +425,7 @@ def test_sloped # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/Triangles.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/Triangles.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get @@ -457,7 +457,7 @@ def test_sloped assert(result.value.valueName == 'Success') # save the model - output_file_path = OpenStudio::Path.new(File.dirname(__FILE__) + '/output/sloped.osm') + output_file_path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/output/sloped.osm") model.save(output_file_path, true) end @@ -470,7 +470,7 @@ def test_door_split # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/Triangles.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/Triangles.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get @@ -502,7 +502,7 @@ def test_door_split assert(result.value.valueName == 'Success') # save the model - output_file_path = OpenStudio::Path.new(File.dirname(__FILE__) + '/output/door_split.osm') + output_file_path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/output/door_split.osm") model.save(output_file_path, true) end @@ -515,7 +515,7 @@ def test_door_remove # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/Triangles.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/Triangles.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get @@ -551,7 +551,7 @@ def test_door_remove assert(result.value.valueName == 'Success') # save the model - output_file_path = OpenStudio::Path.new(File.dirname(__FILE__) + '/output/door_remove.osm') + output_file_path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/output/door_remove.osm") model.save(output_file_path, true) end @@ -564,7 +564,7 @@ def test_door_nothing # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/Triangles.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/Triangles.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get @@ -601,7 +601,7 @@ def test_door_nothing assert(result.value.valueName == 'Success') # save the model - output_file_path = OpenStudio::Path.new(File.dirname(__FILE__) + '/output/door_nothing.osm') + output_file_path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/output/door_nothing.osm") model.save(output_file_path, true) end @@ -614,7 +614,7 @@ def test_not_in_floor_area # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/EnvelopeAndLoadTestModel_01.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/EnvelopeAndLoadTestModel_01.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get @@ -647,7 +647,7 @@ def test_not_in_floor_area assert(result.value.valueName == 'Success') # save the model - output_file_path = OpenStudio::Path.new(File.dirname(__FILE__) + '/output/not_in_floor_area.osm') + output_file_path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/output/not_in_floor_area.osm") model.save(output_file_path, true) end @@ -660,7 +660,7 @@ def test_SetWindowToWallRatioByFacade_zero_target # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/EnvelopeAndLoadTestModel_01.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/EnvelopeAndLoadTestModel_01.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get @@ -691,7 +691,7 @@ def test_SetWindowToWallRatioByFacade_zero_target # assert(result.info.size == 2) # save the model - output_file_path = OpenStudio::Path.new(File.dirname(__FILE__) + '/output/zero.osm') + output_file_path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/output/zero.osm") model.save(output_file_path, true) end @@ -704,7 +704,7 @@ def test_SetWindowToWallRatioByFacade_all_orientations # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/EnvelopeAndLoadTestModel_01.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/EnvelopeAndLoadTestModel_01.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get @@ -735,12 +735,12 @@ def test_SetWindowToWallRatioByFacade_all_orientations # assert(result.info.size == 2) # save the model - output_file_path = OpenStudio::Path.new(File.dirname(__FILE__) + '/output/all_orientations.osm') + output_file_path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/output/all_orientations.osm") model.save(output_file_path, true) end # this has multiple sub-surafces in base surfaes, including more than 1 door and more than one window - def test_SetWindowToWallRatioByFacade_sec_school + def test_SetWindowToWallRatioByFacade_sec_school # create an instance of the measure measure = SetWindowToWallRatioByFacade.new @@ -749,7 +749,7 @@ def test_SetWindowToWallRatioByFacade_sec_school # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/prototype_sec_sch.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/prototype_sec_sch.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get @@ -780,7 +780,7 @@ def test_SetWindowToWallRatioByFacade_sec_school # assert(result.info.size == 2) # save the model - output_file_path = OpenStudio::Path.new(File.dirname(__FILE__) + '/output/sec_school.osm') + output_file_path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/output/sec_school.osm") model.save(output_file_path, true) end end diff --git a/lib/measures/SimplifyGeometryToSlicedBar/measure.rb b/lib/measures/SimplifyGeometryToSlicedBar/measure.rb index 506f095b..33c10056 100644 --- a/lib/measures/SimplifyGeometryToSlicedBar/measure.rb +++ b/lib/measures/SimplifyGeometryToSlicedBar/measure.rb @@ -45,7 +45,7 @@ # load OpenStudio measure libraries from openstudio-extension gem require 'openstudio-extension' require 'openstudio/extension/core/os_lib_helper_methods' -require 'openstudio/extension/core/os_lib_geometry.rb' +require 'openstudio/extension/core/os_lib_geometry' # load OpenStudio measure libraries require "#{File.dirname(__FILE__)}/resources/os_lib_cofee" @@ -137,6 +137,7 @@ def run(model, runner, user_arguments) spaceTypes = model.getSpaceTypes spaceTypes.each do |spaceType| next if spaceType.spaces.empty? + result = OsLib_HelperMethods.getAreaOfSpacesInArray(model, spaceType.spaces, areaType = 'floorArea') spaceTypeHash[spaceType] = result['totalArea'] totalSpaceTypeArea += result['totalArea'] @@ -144,7 +145,7 @@ def run(model, runner, user_arguments) 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)}.") - spaceTypeHash.sort_by { |key, value| value }.reverse.each do |k, v| + spaceTypeHash.sort_by { |key, value| value }.reverse_each do |k, v| 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)}.") end @@ -194,7 +195,8 @@ def run(model, runner, user_arguments) runner.registerInfo("Bounding box area is #{areaBounding_display}. #{lengthX_display} by #{lengthY_display}.") # get target footprint size - if logic == 'Maintain Bounding Box Aspect Ratio' + case logic + when 'Maintain Bounding Box Aspect Ratio' areaTarget = totalFloorArea / numStories areaMultiplier = areaTarget / areaBounding edgeMultiplier = Math.sqrt(areaMultiplier) @@ -204,7 +206,7 @@ def run(model, runner, user_arguments) # run def to create bar bar_AspectRatio = OsLib_Cofee.createBar(model, spaceTypeHash, lengthXTarget, lengthYTarget, totalFloorArea, numStories, midFloorMultiplier, xmin, ymin, lengthX, lengthY, zmin, zmax, true) - elsif logic == 'Maintain Total Exterior Wall Area' + when 'Maintain Total Exterior Wall Area' areaTarget = totalFloorArea / numStories perim = exteriorArea_si / (zmax - zmin) lengthYTarget = 0.25 * perim - 0.25 * Math.sqrt(perim**2 - 16 * areaTarget) @@ -229,6 +231,7 @@ def run(model, runner, user_arguments) relativeAzimuth = OpenStudio.convert(surface.azimuth, 'rad', 'deg').get next if surface.outsideBoundaryCondition != 'Outdoors' next if surface.surfaceType != 'Wall' + if (relativeAzimuth.round == 90) || (relativeAzimuth.round == 270) construction = surface.construction # TODO: - this isn't really the construction I want since it wasn't an interior one, but will work for now surface.setOutsideBoundaryCondition('Adiabatic') @@ -257,6 +260,7 @@ def run(model, runner, user_arguments) relativeAzimuth = OpenStudio.convert(surface.azimuth, 'rad', 'deg').get next if surface.outsideBoundaryCondition != 'Outdoors' next if surface.surfaceType != 'Wall' + if (relativeAzimuth.round == 90) || (relativeAzimuth.round == 270) construction = surface.construction # TODO: - this isn't really the construction I want since it wasn't an interior one, but will work for now surface.setOutsideBoundaryCondition('Adiabatic') diff --git a/lib/measures/SimplifyGeometryToSlicedBar/measure.xml b/lib/measures/SimplifyGeometryToSlicedBar/measure.xml index 0c890895..dee988bb 100644 --- a/lib/measures/SimplifyGeometryToSlicedBar/measure.xml +++ b/lib/measures/SimplifyGeometryToSlicedBar/measure.xml @@ -3,8 +3,8 @@ 3.0 simplify_geometry_to_sliced_bar eb218516-5fa5-47fe-948d-274777c7d592 - 43464352-edbd-46d3-9feb-65ad84e6797d - 20210423T142517Z + 13960111-65c1-476c-a206-591ca7423b94 + 20220505T182931Z 45097B60 SimplifyGeometryToSlicedBar SimplifyGeometryToSlicedBar @@ -106,23 +106,23 @@ In a future version I may try to identify similar spaces types and blend them to readmeerb 703C9964 + + LICENSE.md + md + license + A21A3ED2 + os_lib_helper_methods.rb rb resource - B91D04D5 + 37A1A07C os_lib_cofee.rb rb resource - BA716A1A - - - LICENSE.md - md - license - A21A3ED2 + 031AC395 @@ -133,19 +133,37 @@ In a future version I may try to identify similar spaces types and blend them to measure.rb rb script - 6147FE1F + 46B1D452 os_lib_geometry.rb rb resource - F25DC7F1 + 53B30D3C SimplifyGeometryToSlicedBar_Test.rb rb test - 6BEA0A0C + A931C588 + + + UShapedHotelExample/run.db + db + test + 9230B5CD + + + UShapedHotelExample/files/USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw + epw + test + C254B53F + + + UShapedHotelExample/project.osp + osp + test + EE6FAF90 diff --git a/lib/measures/SimplifyGeometryToSlicedBar/resources/os_lib_cofee.rb b/lib/measures/SimplifyGeometryToSlicedBar/resources/os_lib_cofee.rb index ade51029..018ded6a 100644 --- a/lib/measures/SimplifyGeometryToSlicedBar/resources/os_lib_cofee.rb +++ b/lib/measures/SimplifyGeometryToSlicedBar/resources/os_lib_cofee.rb @@ -46,8 +46,9 @@ def self.createBar(model, spaceTypeHash, lengthXTarget, lengthYTarget, totalFloo # create an array to control sort order of spaces in bar customSpaceTypeBar = [] counter = 0 - spaceTypeHash.sort_by { |key, value| value }.reverse.each do |k, v| + spaceTypeHash.sort_by { |key, value| value }.reverse_each do |k, v| next if v == 0 # this line adds support for fractional values of 0 + if counter == 1 if (lengthXTarget * (v / totalFloorArea) > perimeterDepth * perimeterBufferFactor) && endZones customSpaceTypeBar << [k, totalFloorArea * (perimeterDepth / lengthXTarget)] @@ -63,7 +64,7 @@ def self.createBar(model, spaceTypeHash, lengthXTarget, lengthYTarget, totalFloo # add the largest space type to the end counter = 0 - spaceTypeHash.sort_by { |key, value| value }.reverse.each do |k, v| + spaceTypeHash.sort_by { |key, value| value }.reverse_each do |k, v| if counter == 0 # if width is greater than 1.5x perimeter depth then split in half if (lengthXTarget * (v / totalFloorArea) > perimeterDepth * perimeterBufferFactor) && endZones @@ -201,9 +202,10 @@ def self.createBar(model, spaceTypeHash, lengthXTarget, lengthYTarget, totalFloo else z += floor_to_floor_height * midFloorMultiplier - floor_to_floor_height - if storyCounter == 0 + case storyCounter + when 0 ceilingAdiabatic = true - elsif storyCounter == 1 + when 1 floorAdiabatic = true ceilingAdiabatic = true else diff --git a/lib/measures/SimplifyGeometryToSlicedBar/resources/os_lib_geometry.rb b/lib/measures/SimplifyGeometryToSlicedBar/resources/os_lib_geometry.rb index bcee3d60..fe982ecc 100644 --- a/lib/measures/SimplifyGeometryToSlicedBar/resources/os_lib_geometry.rb +++ b/lib/measures/SimplifyGeometryToSlicedBar/resources/os_lib_geometry.rb @@ -63,7 +63,7 @@ def self.lowerSurfaceZvalue(surfaceArray, zValueTarget) end # set vertices to new vertices - surface.setVertices(newVertices) # todo check if this was made, and issue warning if it was not. Could happen if resulting surface not planer. + surface.setVertices(newVertices) # TODO: check if this was made, and issue warning if it was not. Could happen if resulting surface not planer. if flag then counter += 1 end end @@ -95,6 +95,7 @@ def self.createPointAtCenterOfFloor(model, space, zOffset) floors = [] space.surfaces.each do |surface| next if surface.surfaceType != 'Floor' + floors << surface end @@ -407,6 +408,7 @@ def self.make_sliced_bar_multi_polygons(runner, space_types, length, width, foot # adjustments running counter for space type being removed from this story space_types_running_count.each do |k2, v2| next if k2 != first_space[0] + v2[:floor_area] += first_space[1][:floor_area] * v[:multiplier] end @@ -504,10 +506,8 @@ def self.make_sliced_bar_simple_polygons(runner, space_types, length, width, foo re_apply_largest_space_type_at_end = true end end - if space_type == space_types.last[0] - if [length, width].max * space_type_hash[:floor_area] / total_floor_area > max_bar_end_multiplier * perimeter_zone_depth - end_perimeter_width_deduction = perimeter_zone_depth - end + if space_type == space_types.last[0] && ([length, width].max * space_type_hash[:floor_area] / total_floor_area > max_bar_end_multiplier * perimeter_zone_depth) + end_perimeter_width_deduction = perimeter_zone_depth end non_end_adjusted_width = ([length, width].max * space_type_hash[:floor_area] / total_floor_area) - start_perimeter_width_deduction - end_perimeter_width_deduction @@ -772,7 +772,7 @@ def self.makeSpacesFromPolygons(runner, model, footprints, typical_story_height, if story.nil? story = OpenStudio::Model::BuildingStory.new(model) story.setNominalFloortoFloorHeight(story_data[:space_height]) # not used for anything - story.setNominalZCoordinate (story_data[:space_origin_z]) # not used for anything + story.setNominalZCoordinate(story_data[:space_origin_z]) # not used for anything story.setName("Story #{story_name}") end @@ -780,11 +780,12 @@ def self.makeSpacesFromPolygons(runner, model, footprints, typical_story_height, multiplier_story_above = 1 multiplier_story_below = 1 - if index == 0 # bottom floor, only check above + case index + when 0 # bottom floor, only check above if story_hash.size > 1 multiplier_story_above = story_hash.values[index + 1][:multiplier] end - elsif index == story_hash.size - 1 # top floor, check only below + when story_hash.size - 1 # top floor, check only below multiplier_story_below = story_hash.values[index + -1][:multiplier] else # mid floor, check above and below multiplier_story_above = story_hash.values[index + 1][:multiplier] @@ -997,9 +998,11 @@ def self.estimate_perimeter(perim_story) perim_story.spaces.each do |space| space.surfaces.each do |surface| next if (surface.outsideBoundaryCondition != 'Outdoors') || (surface.surfaceType != 'Wall') + area = surface.grossArea z_value_array = OsLib_Geometry.getSurfaceZValues([surface]) next if z_value_array.max == z_value_array.min # shouldn't see this unless wall is horizontal + perimeter += area / (z_value_array.max - z_value_array.min) end end @@ -1044,6 +1047,7 @@ def self.calculate_story_exterior_wall_perimeter(runner, story, optional_multipl edge_hash.each do |k1, v1| # apply to any floor boundary condition. This supports used in floors above basements next if v1[4] != 'Floor' + edge_hash.each do |k2, v2| test_boundary_cond = false next if !tested_wall_boundary_condition.include?(v2[3]) # method arg takes multiple conditions @@ -1161,6 +1165,7 @@ def self.calculate_perimeter(model) edge_hash.each do |k1, v1| next if v1[3] != 'Ground' # skip if not ground exposed floor next if v1[4] != 'Floor' + edge_hash.each do |k2, v2| next if v2[3] != 'Outdoors' # skip if not exterior exposed wall (todo - update to handle basement) next if v2[4] != 'Wall' diff --git a/lib/measures/SimplifyGeometryToSlicedBar/resources/os_lib_helper_methods.rb b/lib/measures/SimplifyGeometryToSlicedBar/resources/os_lib_helper_methods.rb index 7e9cde64..6eb3b596 100644 --- a/lib/measures/SimplifyGeometryToSlicedBar/resources/os_lib_helper_methods.rb +++ b/lib/measures/SimplifyGeometryToSlicedBar/resources/os_lib_helper_methods.rb @@ -353,10 +353,8 @@ def self.getTotalCostForObjects(objectArray, category = 'Construction', onlyYear objectArray.each do |object| object_LCCs = object.lifeCycleCosts object_LCCs.each do |object_LCC| - if object_LCC.category == category - if onlyYearFromStartZero == false || object_LCC.yearsFromStart == 0 - counter += object_LCC.totalCost - end + if object_LCC.category == category && (onlyYearFromStartZero == false || object_LCC.yearsFromStart == 0) + counter += object_LCC.totalCost end end end diff --git a/lib/measures/SimplifyGeometryToSlicedBar/tests/SimplifyGeometryToSlicedBar_Test.rb b/lib/measures/SimplifyGeometryToSlicedBar/tests/SimplifyGeometryToSlicedBar_Test.rb index a711ba62..2c7fa8be 100644 --- a/lib/measures/SimplifyGeometryToSlicedBar/tests/SimplifyGeometryToSlicedBar_Test.rb +++ b/lib/measures/SimplifyGeometryToSlicedBar/tests/SimplifyGeometryToSlicedBar_Test.rb @@ -36,7 +36,7 @@ require 'openstudio' require 'openstudio/measure/ShowRunnerOutput' require 'minitest/autorun' -require_relative '../measure.rb' +require_relative '../measure' class SimplifyGeometryToSlicedBar_Test < MiniTest::Test def test_SimplifyGeometryToSlicedBar @@ -48,7 +48,7 @@ def test_SimplifyGeometryToSlicedBar # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/UShapedHotelExample.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/UShapedHotelExample.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get diff --git a/lib/measures/SpaceTypeAndConstructionSetWizard/measure.rb b/lib/measures/SpaceTypeAndConstructionSetWizard/measure.rb index b48359a4..a5d1755d 100644 --- a/lib/measures/SpaceTypeAndConstructionSetWizard/measure.rb +++ b/lib/measures/SpaceTypeAndConstructionSetWizard/measure.rb @@ -49,7 +49,7 @@ class SpaceTypeAndConstructionSetWizard < OpenStudio::Measure::ModelMeasure # load OpenStudio measure libraries from openstudio-extension gem require 'openstudio-extension' require 'openstudio/extension/core/os_lib_helper_methods' - require 'openstudio/extension/core/os_lib_model_generation.rb' + require 'openstudio/extension/core/os_lib_model_generation' # resource files used by measure include OsLib_HelperMethods diff --git a/lib/measures/SpaceTypeAndConstructionSetWizard/measure.xml b/lib/measures/SpaceTypeAndConstructionSetWizard/measure.xml index 4955ed79..0479e2cd 100644 --- a/lib/measures/SpaceTypeAndConstructionSetWizard/measure.xml +++ b/lib/measures/SpaceTypeAndConstructionSetWizard/measure.xml @@ -3,8 +3,8 @@ 3.0 space_type_and_construction_set_wizard 7c65af63-4316-47c9-b7a5-68d7a019e533 - a0577cf6-a844-4d90-a7c6-2a3f54e65bfd - 20210423T142525Z + c10f0999-8ad9-46fa-8caa-953db92a07e6 + 20220505T182932Z 057E8D9D SpaceTypeAndConstructionSetWizard Space Type and Construction Set Wizard @@ -372,7 +372,7 @@ SpaceTypeAndConstructionSetWizard_Test.rb rb test - A33BC44E + 6904B5F3 @@ -383,7 +383,7 @@ measure.rb rb script - ECB1C32A + 729BA750 diff --git a/lib/measures/SpaceTypeAndConstructionSetWizard/tests/SpaceTypeAndConstructionSetWizard_Test.rb b/lib/measures/SpaceTypeAndConstructionSetWizard/tests/SpaceTypeAndConstructionSetWizard_Test.rb index 3f92d50a..f1a2f9e8 100644 --- a/lib/measures/SpaceTypeAndConstructionSetWizard/tests/SpaceTypeAndConstructionSetWizard_Test.rb +++ b/lib/measures/SpaceTypeAndConstructionSetWizard/tests/SpaceTypeAndConstructionSetWizard_Test.rb @@ -37,7 +37,7 @@ require 'openstudio/measure/ShowRunnerOutput' require 'fileutils' -require_relative '../measure.rb' +require_relative '../measure' require 'minitest/autorun' class SpaceTypeAndConstructionSetWizard_Test < Minitest::Test @@ -52,7 +52,7 @@ def test_empty_seed # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/EmptySeedModel.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/EmptySeedModel.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get @@ -123,7 +123,7 @@ def test_med_off # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/EmptySeedModel.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/EmptySeedModel.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get @@ -192,7 +192,7 @@ def test_two_story_bar # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/two_story_bar.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/two_story_bar.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get @@ -263,7 +263,7 @@ def test_super_market # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/two_story_bar.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/two_story_bar.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get @@ -334,7 +334,7 @@ def test_lg_off_pre_1980 # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/two_story_bar.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/two_story_bar.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get @@ -405,7 +405,7 @@ def test_small_hotel_2007 # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/two_story_bar.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/two_story_bar.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get @@ -474,7 +474,7 @@ def test_sm_off # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/EmptySeedModel.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/EmptySeedModel.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get @@ -535,7 +535,7 @@ def test_strip_mall # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/EmptySeedModel.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/EmptySeedModel.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get diff --git a/lib/measures/SurfaceMatching/measure.rb b/lib/measures/SurfaceMatching/measure.rb index bd87ca79..b84535e4 100644 --- a/lib/measures/SurfaceMatching/measure.rb +++ b/lib/measures/SurfaceMatching/measure.rb @@ -81,6 +81,7 @@ def run(model, runner, user_arguments) surfaces.each do |surface| if surface.outsideBoundaryCondition == 'Surface' next if !surface.adjacentSurface.is_initialized # don't count as matched if boundary condition is right but no matched object + initialMatchedSurfaceCounter += 1 end end diff --git a/lib/measures/SurfaceMatching/measure.xml b/lib/measures/SurfaceMatching/measure.xml index ae1c8e8d..649462e4 100644 --- a/lib/measures/SurfaceMatching/measure.xml +++ b/lib/measures/SurfaceMatching/measure.xml @@ -3,8 +3,8 @@ 3.0 surface_matching e9c69c36-bf33-4ac4-b695-41dee26ee880 - 1b01d623-5de5-4dbf-a775-82119cbc16f4 - 20210423T142525Z + 35935b9b-4dc3-4f1b-a680-050c6b356365 + 20220505T182930Z 45097B60 SurfaceMatching SurfaceMatching @@ -66,6 +66,12 @@ readme FBF56DB2 + + LICENSE.md + md + license + A21A3ED2 + OpenStudio @@ -75,19 +81,13 @@ measure.rb rb script - 2C1EB547 + BE5B9A0D SurfaceMatching_Test.rb rb test - C729BC9F - - - LICENSE.md - md - license - A21A3ED2 + 726F8146 diff --git a/lib/measures/SurfaceMatching/tests/SurfaceMatching_Test.rb b/lib/measures/SurfaceMatching/tests/SurfaceMatching_Test.rb index 9d649575..29f56934 100644 --- a/lib/measures/SurfaceMatching/tests/SurfaceMatching_Test.rb +++ b/lib/measures/SurfaceMatching/tests/SurfaceMatching_Test.rb @@ -37,7 +37,7 @@ require 'openstudio/measure/ShowRunnerOutput' require 'fileutils' -require_relative '../measure.rb' +require_relative '../measure' require 'minitest/autorun' class SurfaceMatching_Test < Minitest::Test @@ -50,7 +50,7 @@ def test_SurfaceMatching # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/SurfaceMatching_test.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/SurfaceMatching_test.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get diff --git a/lib/measures/blended_space_type_from_floor_area_ratios/measure.rb b/lib/measures/blended_space_type_from_floor_area_ratios/measure.rb index 09d04502..1053cfd8 100644 --- a/lib/measures/blended_space_type_from_floor_area_ratios/measure.rb +++ b/lib/measures/blended_space_type_from_floor_area_ratios/measure.rb @@ -41,8 +41,8 @@ # load OpenStudio measure libraries from openstudio-extension gem require 'openstudio-extension' require 'openstudio/extension/core/os_lib_helper_methods' -require 'openstudio/extension/core/os_lib_model_generation.rb' -require 'openstudio/extension/core/os_lib_model_simplification.rb' +require 'openstudio/extension/core/os_lib_model_generation' +require 'openstudio/extension/core/os_lib_model_simplification' # start the measure class BlendedSpaceTypeFromFloorAreaRatios < OpenStudio::Measure::ModelMeasure @@ -188,7 +188,7 @@ def run(model, runner, user_arguments) # make hash of out string arguemnt in eval. Rescue if can't be made into hash begin space_type_ratio_hash = eval("{#{space_type_ratio_string}}") - rescue SyntaxError => se + rescue SyntaxError => e runner.registerError("{#{space_type_ratio_string}} could not be converted to a hash.") return false end @@ -217,6 +217,7 @@ def run(model, runner, user_arguments) # remove all space type assignments, except for spaces not included in building area. model.getSpaces.each do |space| next if !space.partofTotalFloorArea + space.resetSpaceType end end diff --git a/lib/measures/blended_space_type_from_floor_area_ratios/measure.xml b/lib/measures/blended_space_type_from_floor_area_ratios/measure.xml index 7e95b76a..e0349588 100644 --- a/lib/measures/blended_space_type_from_floor_area_ratios/measure.xml +++ b/lib/measures/blended_space_type_from_floor_area_ratios/measure.xml @@ -3,8 +3,8 @@ 3.0 blended_space_type_from_floor_area_ratios 48ff1765-871b-4c9c-9996-a22757c534ad - c6e020e9-193d-43b4-a26b-3720fb92fefa - 20210423T142526Z + a53055e8-ed44-4bef-8f7b-f31090e769f7 + 20220505T182931Z 05C5DFDC BlendedSpaceTypeFromFloorAreaRatios Blended Space Type from Floor Area Ratios @@ -148,7 +148,7 @@ measure_test.rb rb test - AA55F056 + 8CD7EC26 @@ -159,7 +159,7 @@ measure.rb rb script - 57F50F90 + E1767BA6 diff --git a/lib/measures/blended_space_type_from_floor_area_ratios/tests/measure_test.rb b/lib/measures/blended_space_type_from_floor_area_ratios/tests/measure_test.rb index ad70a5e6..f334b4bc 100644 --- a/lib/measures/blended_space_type_from_floor_area_ratios/tests/measure_test.rb +++ b/lib/measures/blended_space_type_from_floor_area_ratios/tests/measure_test.rb @@ -36,7 +36,7 @@ require 'openstudio' require 'openstudio/measure/ShowRunnerOutput' require 'minitest/autorun' -require_relative '../measure.rb' +require_relative '../measure' require 'fileutils' class BlendedSpaceTypeFromFloorAreaRatiosTest < MiniTest::Test @@ -58,7 +58,7 @@ def test_example_model # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/example_model.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/example_model.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get @@ -111,7 +111,7 @@ def test_small_office_2010 # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/1002_SmallOffice_2010_2a.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/1002_SmallOffice_2010_2a.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get @@ -164,7 +164,7 @@ def test_retail_standalone_2013 # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/1002_RetailStandalone2013.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/1002_RetailStandalone2013.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get diff --git a/lib/measures/blended_space_type_from_model/measure.rb b/lib/measures/blended_space_type_from_model/measure.rb index c76c1b76..041c50d1 100644 --- a/lib/measures/blended_space_type_from_model/measure.rb +++ b/lib/measures/blended_space_type_from_model/measure.rb @@ -38,7 +38,7 @@ # load OpenStudio measure libraries from openstudio-extension gem require 'openstudio-extension' -require 'openstudio/extension/core/os_lib_model_simplification.rb' +require 'openstudio/extension/core/os_lib_model_simplification' # start the measure class BlendedSpaceTypeFromModel < OpenStudio::Measure::ModelMeasure @@ -96,7 +96,8 @@ def run(model, runner, user_arguments) # divide the building up based on blend method space_type_hash = {} - if blend_method == 'Building Type' + case blend_method + when 'Building Type' # loop through spaces and organize by building type model.getSpaceTypes.each do |space_type| @@ -117,7 +118,7 @@ def run(model, runner, user_arguments) space_type_hash[building_type] << space_type end - elsif blend_method == 'Building Story' + when 'Building Story' # loop through building stories model.getBuildingStorys.sort.each do |story| @@ -165,6 +166,7 @@ def run(model, runner, user_arguments) # warn if spaces in model that are not on building story (re-assign to cloned space type) model.getSpaces.each do |space| next if space.buildingStory.is_initialized + runner.registerWarning("#{space.name} is not assigned to a building story. It will be ignored.") end @@ -176,13 +178,16 @@ def run(model, runner, user_arguments) initial_cond_space_type_hash = {} model.getSpaceTypes.sort.each do |space_type| next if space_type.floorArea == 0 + floor_area_si = 0 # loop through spaces so I can skip if not included in floor area space_type.spaces.each do |space| next if !space.partofTotalFloorArea + floor_area_si += space.floorArea * space.multiplier end next if floor_area_si == 0 + initial_cond_space_type_hash[space_type] = floor_area_si end runner.registerInitialCondition("The initial building uses #{initial_cond_space_type_hash.size} spaces types.") @@ -204,9 +209,11 @@ def run(model, runner, user_arguments) # loop through spaces so I can skip if not included in floor area space_type.spaces.each do |space| next if !space.partofTotalFloorArea + floor_area_si += space.floorArea * space.multiplier end next if floor_area_si == 0 + final_cond_space_type_hash[space_type] = floor_area_si end runner.registerFinalCondition("The final building uses #{final_cond_space_type_hash.size} spaces types.") diff --git a/lib/measures/blended_space_type_from_model/measure.xml b/lib/measures/blended_space_type_from_model/measure.xml index 5dc7218d..0dd74d55 100644 --- a/lib/measures/blended_space_type_from_model/measure.xml +++ b/lib/measures/blended_space_type_from_model/measure.xml @@ -3,8 +3,8 @@ 3.0 blended_space_type_from_model 667c2f1f-0927-4dbd-a7be-1087b5c15181 - 51464ec5-37db-4bfd-9055-544422bbaf6b - 20220420T035154Z + db1f44c5-9a13-450e-aa39-3a64b755d13d + 20220505T182932Z 28AD5222 BlendedSpaceTypeFromModel Blended Space Type from Model @@ -132,11 +132,17 @@ license A21A3ED2 + + replace_occupied_spaces_with_blended_space_type_design_doc.txt + txt + doc + C2673B6F + measure_test.rb rb test - 28954A91 + 60597097 @@ -147,13 +153,7 @@ measure.rb rb script - 943C9732 - - - replace_occupied_spaces_with_blended_space_type_design_doc.txt - txt - doc - C2673B6F + BD6EC5A7 diff --git a/lib/measures/blended_space_type_from_model/tests/measure_test.rb b/lib/measures/blended_space_type_from_model/tests/measure_test.rb index b9b6667e..2518e25b 100644 --- a/lib/measures/blended_space_type_from_model/tests/measure_test.rb +++ b/lib/measures/blended_space_type_from_model/tests/measure_test.rb @@ -36,7 +36,7 @@ require 'openstudio' require 'openstudio/measure/ShowRunnerOutput' require 'minitest/autorun' -require_relative '../measure.rb' +require_relative '../measure' require 'fileutils' class BlendedSpaceTypeFromModelTest < MiniTest::Test @@ -54,7 +54,7 @@ def apply_measure_to_model(test_name, args, model_name = nil, result_value = 'Su else # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/' + model_name) + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/#{model_name}") model = translator.loadModel(path) assert(!model.empty?) model = model.get diff --git a/lib/measures/clone_building_from_external_model/measure.xml b/lib/measures/clone_building_from_external_model/measure.xml index 3389cc04..e997d511 100644 --- a/lib/measures/clone_building_from_external_model/measure.xml +++ b/lib/measures/clone_building_from_external_model/measure.xml @@ -3,8 +3,8 @@ 3.0 clone_building_from_external_model 09711168-01a7-4abc-b710-b49d59d927d8 - c5085191-28b7-4dec-a425-d5af83949797 - 20210423T142527Z + 444db266-08fc-4c5f-9c49-0153dde8d053 + 20220505T182930Z AFECFDDF CloneBuildingFromExternalModel Clone Building From External Model @@ -114,7 +114,7 @@ clone_building_from_external_model_test.rb rb test - C4490998 + D9BEC6C9 diff --git a/lib/measures/clone_building_from_external_model/tests/clone_building_from_external_model_test.rb b/lib/measures/clone_building_from_external_model/tests/clone_building_from_external_model_test.rb index 9324022a..54ddd78b 100644 --- a/lib/measures/clone_building_from_external_model/tests/clone_building_from_external_model_test.rb +++ b/lib/measures/clone_building_from_external_model/tests/clone_building_from_external_model_test.rb @@ -36,7 +36,7 @@ require 'openstudio' require 'openstudio/measure/ShowRunnerOutput' require 'minitest/autorun' -require_relative '../measure.rb' +require_relative '../measure' require 'fileutils' class CloneBuildingFromExternalModelTest < MiniTest::Test @@ -55,7 +55,7 @@ def test_good_argument_values # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/example_model.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/example_model.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get @@ -67,7 +67,7 @@ def test_good_argument_values # create hash of argument values. # If the argument has a default that you want to use, you don't need it in the hash args_hash = {} - args_hash['external_model_name'] = File.dirname(__FILE__) + '/AedgK12HvacDualDuctDoas_ASHRAE 169-2006-5B.osm' + args_hash['external_model_name'] = "#{File.dirname(__FILE__)}/AedgK12HvacDualDuctDoas_ASHRAE 169-2006-5B.osm" # populate argument with specified hash value if specified arguments.each do |arg| @@ -91,7 +91,7 @@ def test_good_argument_values # assert(result.warnings.size == 0) # save the model to test output directory - output_file_path = OpenStudio::Path.new(File.dirname(__FILE__) + '/output/test_output.osm') + output_file_path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/output/test_output.osm") model.save(output_file_path, true) end @@ -100,13 +100,13 @@ def test_file_name_only measure = CloneBuildingFromExternalModel.new # create an instance of a runner with OSW - osw_path = OpenStudio::Path.new(File.dirname(__FILE__) + '/measure_test.osw') + osw_path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/measure_test.osw") osw = OpenStudio::WorkflowJSON.load(osw_path).get runner = OpenStudio::Measure::OSRunner.new(osw) # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/example_model.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/example_model.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get @@ -142,7 +142,7 @@ def test_file_name_only # assert(result.warnings.size == 0) # save the model to test output directory - output_file_path = OpenStudio::Path.new(File.dirname(__FILE__) + '/output/test_output.osm') + output_file_path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/output/test_output.osm") model.save(output_file_path, true) end end diff --git a/lib/measures/create_DOE_prototype_building/measure.rb b/lib/measures/create_DOE_prototype_building/measure.rb index 5a052dea..d77d62b5 100644 --- a/lib/measures/create_DOE_prototype_building/measure.rb +++ b/lib/measures/create_DOE_prototype_building/measure.rb @@ -204,7 +204,7 @@ def run(model, runner, user_arguments) reset_log return true - end # end the run method + end # Get all the log messages and put into output # for users to see. @@ -233,7 +233,7 @@ def log_msgs end @runner.registerInfo("Total Time = #{(Time.new - @start_time).round}sec.") end -end # end the measure +end # this allows the measure to be use by the application CreateDOEPrototypeBuilding.new.registerWithApplication diff --git a/lib/measures/create_DOE_prototype_building/measure.xml b/lib/measures/create_DOE_prototype_building/measure.xml index 6b6859a4..971e22ca 100644 --- a/lib/measures/create_DOE_prototype_building/measure.xml +++ b/lib/measures/create_DOE_prototype_building/measure.xml @@ -3,8 +3,8 @@ 3.0 create_doe_prototype_building be90fd0b-a651-467a-bc8d-29d310b0f937 - 9232ffc7-5ae7-44b9-bf8a-111df77e6585 - 20210806T162711Z + b825517f-4598-48b4-8ffe-69e040ba0015 + 20220505T182930Z 057E8D9D CreateDOEPrototypeBuilding Create DOE Prototype Building @@ -234,368 +234,380 @@ Not Applicable - ALTURAS_725958_CZ2010.epw - ALTURAS_725958_CZ2010.epw + USA_CO_Denver-Aurora-Buckley.AFB.724695_TMY3.epw + USA_CO_Denver-Aurora-Buckley.AFB.724695_TMY3.epw - ARCATA_725945_CZ2010.epw - ARCATA_725945_CZ2010.epw + CAN_AB_Grande.Prairie.AP.719400_CWEC2016.epw + CAN_AB_Grande.Prairie.AP.719400_CWEC2016.epw - ARE_DU_Dubai.Intl.AP.411940_TMYx.epw - ARE_DU_Dubai.Intl.AP.411940_TMYx.epw + SAN-DIEGO-GILLESPIE_722907_CZ2010.epw + SAN-DIEGO-GILLESPIE_722907_CZ2010.epw - BAKERSFIELD_723840_CZ2010.epw - BAKERSFIELD_723840_CZ2010.epw + CAN_BC_Prince.George.Intl.AP.718960_CWEC2016.epw + CAN_BC_Prince.George.Intl.AP.718960_CWEC2016.epw - BISHOP_724800_CZ2010.epw - BISHOP_724800_CZ2010.epw + USA_WA_Seattle-Tacoma.Intl.AP.727930_TMY3.epw + USA_WA_Seattle-Tacoma.Intl.AP.727930_TMY3.epw - BLUE-CANYON_725845_CZ2010.epw - BLUE-CANYON_725845_CZ2010.epw + LOS-ANGELES-INTL_722950_CZ2010.epw + LOS-ANGELES-INTL_722950_CZ2010.epw - BLYTHE-RIVERSIDE-CO_747188_CZ2010.epw - BLYTHE-RIVERSIDE-CO_747188_CZ2010.epw + CAN_ON_Moosonee.AP.713980_CWEC2016.epw + CAN_ON_Moosonee.AP.713980_CWEC2016.epw - BURBANK-GLENDALE_722880_CZ2010.epw - BURBANK-GLENDALE_722880_CZ2010.epw + CAN_NL_Stephenville.Intl.AP.718150_CWEC2016.epw + CAN_NL_Stephenville.Intl.AP.718150_CWEC2016.epw - CAMARILLO_723926_CZ2010.epw - CAMARILLO_723926_CZ2010.epw + CAN_ON_Hamilton.Intl.AP.712630_CWEC2016.epw + CAN_ON_Hamilton.Intl.AP.712630_CWEC2016.epw - CAMP-PENDLETON_722926_CZ2010.epw - CAMP-PENDLETON_722926_CZ2010.epw + CAN_QC_Sherbrooke.AP.716100_TMYx.2004-2018.epw + CAN_QC_Sherbrooke.AP.716100_TMYx.2004-2018.epw - CAN_AB_Banff.CS.711220_CWEC2016.epw - CAN_AB_Banff.CS.711220_CWEC2016.epw + CHINO_722899_CZ2010.epw + CHINO_722899_CZ2010.epw - CAN_AB_Calgary.Intl.AP.718770_CWEC2016.epw - CAN_AB_Calgary.Intl.AP.718770_CWEC2016.epw + MOUNT-SHASTA_725957_CZ2010.epw + MOUNT-SHASTA_725957_CZ2010.epw - CAN_AB_Edmonton.Intl.AP.711230_CWEC2016.epw - CAN_AB_Edmonton.Intl.AP.711230_CWEC2016.epw + CAN_ON_Sarnia-Hadfield.AP.717040_TMYx.2004-2018.epw + CAN_ON_Sarnia-Hadfield.AP.717040_TMYx.2004-2018.epw - CAN_AB_Edmonton.Stony.Plain.AP.711270_CWEC2016.epw - CAN_AB_Edmonton.Stony.Plain.AP.711270_CWEC2016.epw + CAN_AB_Red.Deer.Rgnl.AP.718780_CWEC2016.epw + CAN_AB_Red.Deer.Rgnl.AP.718780_CWEC2016.epw - CAN_AB_Fort.McMurray.AP.716890_CWEC2016.epw - CAN_AB_Fort.McMurray.AP.716890_CWEC2016.epw + USA_CO_Denver.Intl.AP.725650_TMY3.epw + USA_CO_Denver.Intl.AP.725650_TMY3.epw - CAN_AB_Grande.Prairie.AP.719400_CWEC2016.epw - CAN_AB_Grande.Prairie.AP.719400_CWEC2016.epw + MOJAVE_722953_CZ2010.epw + MOJAVE_722953_CZ2010.epw - CAN_AB_Lethbridge.AP.712430_CWEC2016.epw - CAN_AB_Lethbridge.AP.712430_CWEC2016.epw + STOCKTON_724920_CZ2010.epw + STOCKTON_724920_CZ2010.epw - CAN_AB_Lloydminster.AP.718710_CWEC2016.epw - CAN_AB_Lloydminster.AP.718710_CWEC2016.epw + HAYWARD_724935_CZ2010.epw + HAYWARD_724935_CZ2010.epw - CAN_AB_Medicine.Hat.AP.710260_CWEC2016.epw - CAN_AB_Medicine.Hat.AP.710260_CWEC2016.epw + CAN_NS_Halifax.Dockyard.713280_CWEC2016.epw + CAN_NS_Halifax.Dockyard.713280_CWEC2016.epw - CAN_AB_Red.Deer.Regl.AP.718780_CWEC2016.epw - CAN_AB_Red.Deer.Regl.AP.718780_CWEC2016.epw + BLUE-CANYON_725845_CZ2010.epw + BLUE-CANYON_725845_CZ2010.epw - CAN_AB_Red.Deer.Rgnl.AP.718780_CWEC2016.epw - CAN_AB_Red.Deer.Rgnl.AP.718780_CWEC2016.epw + LOS-ALAMITOS_722975_CZ2010.epw + LOS-ALAMITOS_722975_CZ2010.epw - CAN_BC_Abbotsford.Intl.AP.711080_CWEC2016.epw - CAN_BC_Abbotsford.Intl.AP.711080_CWEC2016.epw + USA_MN_Duluth.Intl.AP.727450_TMY3.epw + USA_MN_Duluth.Intl.AP.727450_TMY3.epw - CAN_BC_Comox.Valley.AP.718930_CWEC2016.epw - CAN_BC_Comox.Valley.AP.718930_CWEC2016.epw + CAN_AB_Medicine.Hat.AP.710260_CWEC2016.epw + CAN_AB_Medicine.Hat.AP.710260_CWEC2016.epw - CAN_BC_Crankbrook-Canadian.Rockies.Intl.AP.718800_CWEC2016.epw - CAN_BC_Crankbrook-Canadian.Rockies.Intl.AP.718800_CWEC2016.epw + USA_FL_Miami.Intl.AP.722020_TMY3.epw + USA_FL_Miami.Intl.AP.722020_TMY3.epw - CAN_BC_Fort.St.John-North.Peace.Rgnl.AP.719430_CWEC2016.epw - CAN_BC_Fort.St.John-North.Peace.Rgnl.AP.719430_CWEC2016.epw + CAN_QC_Granby.710367_TMYx.2004-2018.epw + CAN_QC_Granby.710367_TMYx.2004-2018.epw - CAN_BC_Hope.Rgnl.Airpark.711870_CWEC2016.epw - CAN_BC_Hope.Rgnl.Airpark.711870_CWEC2016.epw + UKIAH_725905_CZ2010.epw + UKIAH_725905_CZ2010.epw - CAN_BC_Kamloops.AP.718870_CWEC2016.epw - CAN_BC_Kamloops.AP.718870_CWEC2016.epw + SAN-NICHOLAS-IS_722910_CZ2010.epw + SAN-NICHOLAS-IS_722910_CZ2010.epw - CAN_BC_Kelowna.Intl.AP.712030_CWEC2016.epw - CAN_BC_Kelowna.Intl.AP.712030_CWEC2016.epw + CAN_AB_Red.Deer.Regl.AP.718780_CWEC2016.epw + CAN_AB_Red.Deer.Regl.AP.718780_CWEC2016.epw - CAN_BC_Port.Hardy.AP.711090_CWEC2016.epw - CAN_BC_Port.Hardy.AP.711090_CWEC2016.epw + INYOKERN_723826_CZ2010.epw + INYOKERN_723826_CZ2010.epw - CAN_BC_Prince.George.Intl.AP.718960_CWEC2016.epw - CAN_BC_Prince.George.Intl.AP.718960_CWEC2016.epw + CAN_ON_Region.of.Waterloo.Intl.AP.713680_TMYx.2004-2018.epw + CAN_ON_Region.of.Waterloo.Intl.AP.713680_TMYx.2004-2018.epw - CAN_BC_Smithers.Rgnl.AP.719500_CWEC2016.epw - CAN_BC_Smithers.Rgnl.AP.719500_CWEC2016.epw + CAN_SK_CFB.Moose.Jaw.715390_CWEC2016.epw + CAN_SK_CFB.Moose.Jaw.715390_CWEC2016.epw - CAN_BC_Summerland.717680_CWEC2016.epw - CAN_BC_Summerland.717680_CWEC2016.epw + LOS-ANGELES-DOWNTOWN_722874_CZ2010.epw + LOS-ANGELES-DOWNTOWN_722874_CZ2010.epw - CAN_BC_Vancouver.Intl.AP.718920_CWEC2016.epw - CAN_BC_Vancouver.Intl.AP.718920_CWEC2016.epw + RED-BLUFF_725910_CZ2010.epw + RED-BLUFF_725910_CZ2010.epw - CAN_BC_Victoria.Intl.AP.717990_CWEC2016.epw - CAN_BC_Victoria.Intl.AP.717990_CWEC2016.epw + CAN_SK_Estevan.Rgnl.AP.718620_CWEC2016.epw + CAN_SK_Estevan.Rgnl.AP.718620_CWEC2016.epw - CAN_MB_Brandon.Muni.AP.711400_CWEC2016.epw - CAN_MB_Brandon.Muni.AP.711400_CWEC2016.epw + PALO-ALTO_724937_CZ2010.epw + PALO-ALTO_724937_CZ2010.epw - CAN_MB_Portage-Southport.AP.718510_CWEC2016.epw - CAN_MB_Portage-Southport.AP.718510_CWEC2016.epw + USA_NY_New.York-John.F.Kennedy.Intl.AP.744860_TMY3.epw + USA_NY_New.York-John.F.Kennedy.Intl.AP.744860_TMY3.epw - CAN_MB_The.Pas.AP.718670_CWEC2016.epw - CAN_MB_The.Pas.AP.718670_CWEC2016.epw + SAN-LUIS-CO_722897_CZ2010.epw + SAN-LUIS-CO_722897_CZ2010.epw - CAN_MB_Winnipeg-Richardson.Intl.AP.718520_CWEC2016.epw - CAN_MB_Winnipeg-Richardson.Intl.AP.718520_CWEC2016.epw + MONTEREY_724915_CZ2010.epw + MONTEREY_724915_CZ2010.epw - CAN_NB_Bathurst.Rgnl.AP.715740_CWEC2016.epw - CAN_NB_Bathurst.Rgnl.AP.715740_CWEC2016.epw + TRUCKEE-TAHOE_725846_CZ2010.epw + TRUCKEE-TAHOE_725846_CZ2010.epw - CAN_NB_Fredericton.Intl.AP.717000_CWEC2016.epw - CAN_NB_Fredericton.Intl.AP.717000_CWEC2016.epw + SAN-JOSE-INTL_724945_CZ2010.epw + SAN-JOSE-INTL_724945_CZ2010.epw - CAN_NB_Miramichi.AP.717440_CWEC2016.epw - CAN_NB_Miramichi.AP.717440_CWEC2016.epw + USA_MN_International.Falls.Intl.AP.727470_TMY3.epw + USA_MN_International.Falls.Intl.AP.727470_TMY3.epw + + + CAN_QC_Kuujjuaq.AP.719060_CWEC2016.epw + CAN_QC_Kuujjuaq.AP.719060_CWEC2016.epw + + + CAN_ON_Armstrong.AP.718410_CWEC2016.epw + CAN_ON_Armstrong.AP.718410_CWEC2016.epw + + + CAN_BC_Victoria.Intl.AP.717990_CWEC2016.epw + CAN_BC_Victoria.Intl.AP.717990_CWEC2016.epw CAN_NB_Moncton-Greater.Moncton.LeBlanc.Intl.AP.717050_CWEC2016.epw CAN_NB_Moncton-Greater.Moncton.LeBlanc.Intl.AP.717050_CWEC2016.epw - CAN_NB_Saint.John.AP.716090_CWEC2016.epw - CAN_NB_Saint.John.AP.716090_CWEC2016.epw + CRESCENT-CITY_725946_CZ2010.epw + CRESCENT-CITY_725946_CZ2010.epw - CAN_NL_Corner.Brook.719730_CWEC2016.epw - CAN_NL_Corner.Brook.719730_CWEC2016.epw + YUBA-CO_724838_CZ2010.epw + YUBA-CO_724838_CZ2010.epw - CAN_NL_Gander.Intl.AP-CFB.Gander.718030_CWEC2016.epw - CAN_NL_Gander.Intl.AP-CFB.Gander.718030_CWEC2016.epw + CAN_BC_Comox.Valley.AP.718930_CWEC2016.epw + CAN_BC_Comox.Valley.AP.718930_CWEC2016.epw - CAN_NL_Goose.Bay.AP-CFB.Goose.Bay.718160_CWEC2016.epw - CAN_NL_Goose.Bay.AP-CFB.Goose.Bay.718160_CWEC2016.epw + MARYSVILLE-BEALE-AFB_724837_CZ2010.epw + MARYSVILLE-BEALE-AFB_724837_CZ2010.epw - CAN_NL_St.Johns.Intl.AP.718010_CWEC2016.epw - CAN_NL_St.Johns.Intl.AP.718010_CWEC2016.epw + CAN_ON_Windsor.Intl.AP.715380_CWEC2016.epw + CAN_ON_Windsor.Intl.AP.715380_CWEC2016.epw - CAN_NL_Stephenville.Intl.AP.718150_CWEC2016.epw - CAN_NL_Stephenville.Intl.AP.718150_CWEC2016.epw + IMPERIAL_747185_CZ2010.epw + IMPERIAL_747185_CZ2010.epw - CAN_NS_CFB.Greenwood.713970_CWEC2016.epw - CAN_NS_CFB.Greenwood.713970_CWEC2016.epw + CAN_NL_Goose.Bay.AP-CFB.Goose.Bay.718160_CWEC2016.epw + CAN_NL_Goose.Bay.AP-CFB.Goose.Bay.718160_CWEC2016.epw - CAN_NS_CFB.Shearwater.716010_CWEC2016.epw - CAN_NS_CFB.Shearwater.716010_CWEC2016.epw + USA_FL_Tampa-MacDill.AFB.747880_TMY3.epw + USA_FL_Tampa-MacDill.AFB.747880_TMY3.epw - CAN_NS_Halifax.Dockyard.713280_CWEC2016.epw - CAN_NS_Halifax.Dockyard.713280_CWEC2016.epw + BLYTHE-RIVERSIDE-CO_747188_CZ2010.epw + BLYTHE-RIVERSIDE-CO_747188_CZ2010.epw - CAN_NS_Sable.Island.Natl.Park.716000_CWEC2016.epw - CAN_NS_Sable.Island.Natl.Park.716000_CWEC2016.epw + SOUTH-LAKE-TAHOE_725847_CZ2010.epw + SOUTH-LAKE-TAHOE_725847_CZ2010.epw - CAN_NS_Sydney-McCurdy.AP.717070_8205701_CWEC2016.epw - CAN_NS_Sydney-McCurdy.AP.717070_8205701_CWEC2016.epw + SALINAS_724917_CZ2010.epw + SALINAS_724917_CZ2010.epw - CAN_NS_Sydney-McCurdy.AP.717070_CWEC2016.epw - CAN_NS_Sydney-McCurdy.AP.717070_CWEC2016.epw + CAN_ON_Sault.Ste.Marie.AP.712600_CWEC2016.epw + CAN_ON_Sault.Ste.Marie.AP.712600_CWEC2016.epw - CAN_NS_Truro.713980_CWEC.epw - CAN_NS_Truro.713980_CWEC.epw + CAN_QC_Saguenay-Bagotville.AP-CFB.Bagotville.717270_CWEC2016.epw + CAN_QC_Saguenay-Bagotville.AP-CFB.Bagotville.717270_CWEC2016.epw - CAN_NS_Yarmouth.Intl.AP.716030_CWEC2016.epw - CAN_NS_Yarmouth.Intl.AP.716030_CWEC2016.epw + CAN_SK_Prince.Albert.AP.718690_CWEC2016.epw + CAN_SK_Prince.Albert.AP.718690_CWEC2016.epw - CAN_NT_Inuvik-Zubko.AP.719570_CWEC2016.epw - CAN_NT_Inuvik-Zubko.AP.719570_CWEC2016.epw + CAN_ON_Timmins.Power.AP.717390_CWEC2016.epw + CAN_ON_Timmins.Power.AP.717390_CWEC2016.epw - CAN_NT_Yellowknife.AP.719360_CWEC2016.epw - CAN_NT_Yellowknife.AP.719360_CWEC2016.epw + CAN_AB_Edmonton.Stony.Plain.AP.711270_CWEC2016.epw + CAN_AB_Edmonton.Stony.Plain.AP.711270_CWEC2016.epw - CAN_NU_Resolute.AP.719240_CWEC2016.epw - CAN_NU_Resolute.AP.719240_CWEC2016.epw + CAN_QC_Mont-Joli.AP.717180_CWEC2016.epw + CAN_QC_Mont-Joli.AP.717180_CWEC2016.epw - CAN_ON_Armstrong.AP.718410_CWEC2016.epw - CAN_ON_Armstrong.AP.718410_CWEC2016.epw + SACRAMENTO-EXECUTIVE_724830_CZ2010.epw + SACRAMENTO-EXECUTIVE_724830_CZ2010.epw - CAN_ON_Barrie.Oro.713140_CWEC2016.epw - CAN_ON_Barrie.Oro.713140_CWEC2016.epw + CAN_QC_Montreal-Trudeau.Intl.AP.716270_CWEC2016.epw + CAN_QC_Montreal-Trudeau.Intl.AP.716270_CWEC2016.epw - CAN_ON_CFB.Trenton.716210_CWEC2016.epw - CAN_ON_CFB.Trenton.716210_CWEC2016.epw + CAN_AB_Lloydminster.AP.718710_CWEC2016.epw + CAN_AB_Lloydminster.AP.718710_CWEC2016.epw - CAN_ON_Dryden.Rgnl.AP.715270_CWEC2016.epw - CAN_ON_Dryden.Rgnl.AP.715270_CWEC2016.epw + CAN_MB_Brandon.Muni.AP.711400_CWEC2016.epw + CAN_MB_Brandon.Muni.AP.711400_CWEC2016.epw - CAN_ON_Hamilton.Intl.AP.712630_CWEC2016.epw - CAN_ON_Hamilton.Intl.AP.712630_CWEC2016.epw + LOMPOC_722895_CZ2010.epw + LOMPOC_722895_CZ2010.epw - CAN_ON_Kingston.AP.718200_TMYx.2004-2018.epw - CAN_ON_Kingston.AP.718200_TMYx.2004-2018.epw + CAN_QC_Lac.Eon.AP.714210_CWEC2016.epw + CAN_QC_Lac.Eon.AP.714210_CWEC2016.epw - CAN_ON_London.Intl.AP.716230_CWEC2016.epw - CAN_ON_London.Intl.AP.716230_CWEC2016.epw + CAN_BC_Vancouver.Intl.AP.718920_CWEC2016.epw + CAN_BC_Vancouver.Intl.AP.718920_CWEC2016.epw - CAN_ON_Moosonee.AP.713980_CWEC2016.epw - CAN_ON_Moosonee.AP.713980_CWEC2016.epw + BISHOP_724800_CZ2010.epw + BISHOP_724800_CZ2010.epw - CAN_ON_Mount.Forest.716310_CWEC2016.epw - CAN_ON_Mount.Forest.716310_CWEC2016.epw + CAN_MB_Portage-Southport.AP.718510_CWEC2016.epw + CAN_MB_Portage-Southport.AP.718510_CWEC2016.epw - CAN_ON_North.Bay-Garland.AP.717310_CWEC2016.epw - CAN_ON_North.Bay-Garland.AP.717310_CWEC2016.epw + FRESNO_723890_CZ2010.epw + FRESNO_723890_CZ2010.epw - CAN_ON_Ottawa-Macdonald-Cartier.Intl.AP.716280_CWEC2016.epw - CAN_ON_Ottawa-Macdonald-Cartier.Intl.AP.716280_CWEC2016.epw + ARCATA_725945_CZ2010.epw + ARCATA_725945_CZ2010.epw - CAN_ON_Peterborough.Muni.AP.714360_CWEC2016.epw - CAN_ON_Peterborough.Muni.AP.714360_CWEC2016.epw + USA_AZ_Phoenix-Sky.Harbor.Intl.AP.722780_TMY3.epw + USA_AZ_Phoenix-Sky.Harbor.Intl.AP.722780_TMY3.epw - CAN_ON_Region.of.Waterloo.Intl.AP.713680_TMYx.2004-2018.epw - CAN_ON_Region.of.Waterloo.Intl.AP.713680_TMYx.2004-2018.epw + PALMDALE_723820_CZ2010.epw + PALMDALE_723820_CZ2010.epw - CAN_ON_Sarnia-Hadfield.AP.717040_TMYx.2004-2018.epw - CAN_ON_Sarnia-Hadfield.AP.717040_TMYx.2004-2018.epw + CAMP-PENDLETON_722926_CZ2010.epw + CAMP-PENDLETON_722926_CZ2010.epw - CAN_ON_Sault.Ste.Marie.AP.712600_CWEC2016.epw - CAN_ON_Sault.Ste.Marie.AP.712600_CWEC2016.epw + NEEDLES_723805_CZ2010.epw + NEEDLES_723805_CZ2010.epw - CAN_ON_Sudbury.AP.717300_CWEC2016.epw - CAN_ON_Sudbury.AP.717300_CWEC2016.epw + ALTURAS_725958_CZ2010.epw + ALTURAS_725958_CZ2010.epw - CAN_ON_Thunder.Bay.Intl.AP.716670_CWEC2016.epw - CAN_ON_Thunder.Bay.Intl.AP.716670_CWEC2016.epw + CAN_BC_Port.Hardy.AP.711090_CWEC2016.epw + CAN_BC_Port.Hardy.AP.711090_CWEC2016.epw - CAN_ON_Timmins.Power.AP.717390_CWEC2016.epw - CAN_ON_Timmins.Power.AP.717390_CWEC2016.epw + CAN_AB_Lethbridge.AP.712430_CWEC2016.epw + CAN_AB_Lethbridge.AP.712430_CWEC2016.epw - CAN_ON_Toronto.Pearson.Intl.AP.716240_CWEC2016.epw - CAN_ON_Toronto.Pearson.Intl.AP.716240_CWEC2016.epw + USA_CA_San.Deigo-Brown.Field.Muni.AP.722904_TMY3.epw + USA_CA_San.Deigo-Brown.Field.Muni.AP.722904_TMY3.epw - CAN_ON_Windsor.Intl.AP.715380_CWEC2016.epw - CAN_ON_Windsor.Intl.AP.715380_CWEC2016.epw + CAN_BC_Crankbrook-Canadian.Rockies.Intl.AP.718800_CWEC2016.epw + CAN_BC_Crankbrook-Canadian.Rockies.Intl.AP.718800_CWEC2016.epw - CAN_PE_Charlottetown.AP.717060_CWEC2016.epw - CAN_PE_Charlottetown.AP.717060_CWEC2016.epw + LEMOORE_747020_CZ2010.epw + LEMOORE_747020_CZ2010.epw - CAN_PE_Summerside.AP.717020_CWEC2016.epw - CAN_PE_Summerside.AP.717020_CWEC2016.epw + HAWTHORNE-NORTHROP-FLD_722956_CZ2010.epw + HAWTHORNE-NORTHROP-FLD_722956_CZ2010.epw - CAN_QC_Cap.Madelaine.714250_CWEC2016.epw - CAN_QC_Cap.Madelaine.714250_CWEC2016.epw + CAN_AB_Edmonton.Intl.AP.711230_CWEC2016.epw + CAN_AB_Edmonton.Intl.AP.711230_CWEC2016.epw - CAN_QC_Gatineau.AP.716279_TMYx.2004-2018.epw - CAN_QC_Gatineau.AP.716279_TMYx.2004-2018.epw + LANCASTER_723816_CZ2010.epw + LANCASTER_723816_CZ2010.epw - CAN_QC_Granby.710367_TMYx.2004-2018.epw - CAN_QC_Granby.710367_TMYx.2004-2018.epw + IND_DL_New.Delhi-Safdarjung.AP.421820_TMYx.epw + IND_DL_New.Delhi-Safdarjung.AP.421820_TMYx.epw - CAN_QC_Kuujjuaq.AP.719060_CWEC2016.epw - CAN_QC_Kuujjuaq.AP.719060_CWEC2016.epw + FAIRFLD-TRAVIS-AFB_745160_CZ2010.epw + FAIRFLD-TRAVIS-AFB_745160_CZ2010.epw - CAN_QC_Kuujuarapik.AP.719050_CWEC2016.epw - CAN_QC_Kuujuarapik.AP.719050_CWEC2016.epw + CAN_BC_Kamloops.AP.718870_CWEC2016.epw + CAN_BC_Kamloops.AP.718870_CWEC2016.epw - CAN_QC_Lac.Eon.AP.714210_CWEC2016.epw - CAN_QC_Lac.Eon.AP.714210_CWEC2016.epw + USA_OR_Salem-McNary.Field.726940_TMY3.epw + USA_OR_Salem-McNary.Field.726940_TMY3.epw - CAN_QC_Mont-Joli.AP.717180_CWEC2016.epw - CAN_QC_Mont-Joli.AP.717180_CWEC2016.epw + CAN_BC_Abbotsford.Intl.AP.711080_CWEC2016.epw + CAN_BC_Abbotsford.Intl.AP.711080_CWEC2016.epw - CAN_QC_Montreal-Mirabel.Intl.AP.719050_CWEC2016.epw - CAN_QC_Montreal-Mirabel.Intl.AP.719050_CWEC2016.epw + ARE_DU_Dubai.Intl.AP.411940_TMYx.epw + ARE_DU_Dubai.Intl.AP.411940_TMYx.epw - CAN_QC_Montreal-St-Hubert.Longueuil.AP.713710_CWEC2016.epw - CAN_QC_Montreal-St-Hubert.Longueuil.AP.713710_CWEC2016.epw + CAN_BC_Hope.Rgnl.Airpark.711870_CWEC2016.epw + CAN_BC_Hope.Rgnl.Airpark.711870_CWEC2016.epw - CAN_QC_Montreal-Trudeau.Intl.AP.716270_CWEC2016.epw - CAN_QC_Montreal-Trudeau.Intl.AP.716270_CWEC2016.epw + OXNARD_723927_CZ2010.epw + OXNARD_723927_CZ2010.epw CAN_QC_Quebec-Lesage.Intl.AP.717140_CWEC2016.epw @@ -606,512 +618,504 @@ CAN_QC_Riviere-du-Loup.717150_CWEC2016.epw - CAN_QC_Roberval.AP.717280_CWEC2016.epw - CAN_QC_Roberval.AP.717280_CWEC2016.epw + CAN_NB_Bathurst.Rgnl.AP.715740_CWEC2016.epw + CAN_NB_Bathurst.Rgnl.AP.715740_CWEC2016.epw - CAN_QC_Rouyn-Noranda.AP.717255_CWEC2016.epw - CAN_QC_Rouyn-Noranda.AP.717255_CWEC2016.epw + BAKERSFIELD_723840_CZ2010.epw + BAKERSFIELD_723840_CZ2010.epw - CAN_QC_Saguenay-Bagotville.AP-CFB.Bagotville.717270_CWEC2016.epw - CAN_QC_Saguenay-Bagotville.AP-CFB.Bagotville.717270_CWEC2016.epw + OAKLAND_724930_CZ2010.epw + OAKLAND_724930_CZ2010.epw - CAN_QC_Schefferville.AP.718280_CWEC2016.epw - CAN_QC_Schefferville.AP.718280_CWEC2016.epw + CAN_PE_Summerside.AP.717020_CWEC2016.epw + CAN_PE_Summerside.AP.717020_CWEC2016.epw - CAN_QC_Sept-Iles.AP.718110_CWEC2016.epw - CAN_QC_Sept-Iles.AP.718110_CWEC2016.epw + CAN_NS_Yarmouth.Intl.AP.716030_CWEC2016.epw + CAN_NS_Yarmouth.Intl.AP.716030_CWEC2016.epw - CAN_QC_Sherbrooke.AP.716100_TMYx.2004-2018.epw - CAN_QC_Sherbrooke.AP.716100_TMYx.2004-2018.epw + PALM-SPRINGS-THERMAL_747187_CZ2010.epw + PALM-SPRINGS-THERMAL_747187_CZ2010.epw - CAN_QC_Trois.Rivieres.717240_TMYx.2004-2018.epw - CAN_QC_Trois.Rivieres.717240_TMYx.2004-2018.epw + USA_GA_Atlanta-Hartsfield.Jackson.Intl.AP.722190_TMY3.epw + USA_GA_Atlanta-Hartsfield.Jackson.Intl.AP.722190_TMY3.epw - CAN_QC_Val-d-Or.Rgnl.AP.717250_CWEC2016.epw - CAN_QC_Val-d-Or.Rgnl.AP.717250_CWEC2016.epw + LONG-BEACH_722970_CZ2010.epw + LONG-BEACH_722970_CZ2010.epw - CAN_SK_CFB.Moose.Jaw.715390_CWEC2016.epw - CAN_SK_CFB.Moose.Jaw.715390_CWEC2016.epw + CAN_SK_Regina.Intl.AP.715140_CWEC2016.epw + CAN_SK_Regina.Intl.AP.715140_CWEC2016.epw - CAN_SK_Estevan.Rgnl.AP.718620_CWEC2016.epw - CAN_SK_Estevan.Rgnl.AP.718620_CWEC2016.epw + CAN_NS_CFB.Shearwater.716010_CWEC2016.epw + CAN_NS_CFB.Shearwater.716010_CWEC2016.epw - CAN_SK_North.Battleford.AP.718760_CWEC2016.epw - CAN_SK_North.Battleford.AP.718760_CWEC2016.epw + CAN_NU_Iqaluit.AP.719090_CWEC2016.epw + CAN_NU_Iqaluit.AP.719090_CWEC2016.epw - CAN_SK_Prince.Albert.AP.718690_CWEC2016.epw - CAN_SK_Prince.Albert.AP.718690_CWEC2016.epw + USA_NM_Albuquerque.Intl.Sunport.723650_TMY3.epw + USA_NM_Albuquerque.Intl.Sunport.723650_TMY3.epw - CAN_SK_Regina.Intl.AP.715140_CWEC2016.epw - CAN_SK_Regina.Intl.AP.715140_CWEC2016.epw + USA_VT_Burlington.Intl.AP.726170_TMY3.epw + USA_VT_Burlington.Intl.AP.726170_TMY3.epw - CAN_SK_Saskatoon.Intl.AP.718660_CWEC2016.epw - CAN_SK_Saskatoon.Intl.AP.718660_CWEC2016.epw + CARLSBAD_722927_CZ2010.epw + CARLSBAD_722927_CZ2010.epw - CAN_YT_Whitehorse.Intl.AP.719640_CWEC2016.epw - CAN_YT_Whitehorse.Intl.AP.719640_CWEC2016.epw + USA_NY_Buffalo.Niagara.Intl.AP.725280_TMY3.epw + USA_NY_Buffalo.Niagara.Intl.AP.725280_TMY3.epw - CARLSBAD_722927_CZ2010.epw - CARLSBAD_722927_CZ2010.epw + IMPERIAL-BEACH_722909_CZ2010.epw + IMPERIAL-BEACH_722909_CZ2010.epw - CHINA-LAKE_746120_CZ2010.epw - CHINA-LAKE_746120_CZ2010.epw + RIVERSIDE_722869_CZ2010.epw + RIVERSIDE_722869_CZ2010.epw - CHINO_722899_CZ2010.epw - CHINO_722899_CZ2010.epw + SANTA-BARBARA_723925_CZ2010.epw + SANTA-BARBARA_723925_CZ2010.epw - CONCORD_724936_CZ2010.epw - CONCORD_724936_CZ2010.epw + USA_WA_Port.Angeles-William.R.Fairchild.Intl.AP.727885_TMY3.epw + USA_WA_Port.Angeles-William.R.Fairchild.Intl.AP.727885_TMY3.epw - CRESCENT-CITY_725946_CZ2010.epw - CRESCENT-CITY_725946_CZ2010.epw + EL-CENTRO_722810_CZ2010.epw + EL-CENTRO_722810_CZ2010.epw - DAGGETT-BARSTOW_723815_CZ2010.epw - DAGGETT-BARSTOW_723815_CZ2010.epw + CAN_AB_Calgary.Intl.AP.718770_CWEC2016.epw + CAN_AB_Calgary.Intl.AP.718770_CWEC2016.epw - EDWARDS-AFB_723810_CZ2010.epw - EDWARDS-AFB_723810_CZ2010.epw + CAN_NB_Miramichi.AP.717440_CWEC2016.epw + CAN_NB_Miramichi.AP.717440_CWEC2016.epw - EL-CENTRO_722810_CZ2010.epw - EL-CENTRO_722810_CZ2010.epw + CAN_SK_North.Battleford.AP.718760_CWEC2016.epw + CAN_SK_North.Battleford.AP.718760_CWEC2016.epw - EUREKA_725940_CZ2010.epw - EUREKA_725940_CZ2010.epw + CAN_NL_Gander.Intl.AP-CFB.Gander.718030_CWEC2016.epw + CAN_NL_Gander.Intl.AP-CFB.Gander.718030_CWEC2016.epw - FAIRFLD-TRAVIS-AFB_745160_CZ2010.epw - FAIRFLD-TRAVIS-AFB_745160_CZ2010.epw + CAN_NT_Inuvik-Zubko.AP.719570_CWEC2016.epw + CAN_NT_Inuvik-Zubko.AP.719570_CWEC2016.epw - FRESNO_723890_CZ2010.epw - FRESNO_723890_CZ2010.epw + CAN_ON_Kingston.AP.718200_TMYx.2004-2018.epw + CAN_ON_Kingston.AP.718200_TMYx.2004-2018.epw - FULLERTON_722976_CZ2010.epw - FULLERTON_722976_CZ2010.epw + SAN-DIEGO-NORTH-IS_722906_CZ2010.epw + SAN-DIEGO-NORTH-IS_722906_CZ2010.epw - HAWTHORNE-NORTHROP-FLD_722956_CZ2010.epw - HAWTHORNE-NORTHROP-FLD_722956_CZ2010.epw + CAN_AB_Banff.CS.711220_CWEC2016.epw + CAN_AB_Banff.CS.711220_CWEC2016.epw - HAYWARD_724935_CZ2010.epw - HAYWARD_724935_CZ2010.epw + PORTERVILLE_723895_CZ2010.epw + PORTERVILLE_723895_CZ2010.epw - IMPERIAL-BEACH_722909_CZ2010.epw - IMPERIAL-BEACH_722909_CZ2010.epw + SANDBERG_723830_CZ2010.epw + SANDBERG_723830_CZ2010.epw - IMPERIAL_747185_CZ2010.epw - IMPERIAL_747185_CZ2010.epw + TWENTYNINE-PALMS_690150_CZ2010.epw + TWENTYNINE-PALMS_690150_CZ2010.epw - IND_DL_New.Delhi-Safdarjung.AP.421820_TMYx.epw - IND_DL_New.Delhi-Safdarjung.AP.421820_TMYx.epw + CAN_ON_Barrie.Oro.713140_CWEC2016.epw + CAN_ON_Barrie.Oro.713140_CWEC2016.epw - INYOKERN_723826_CZ2010.epw - INYOKERN_723826_CZ2010.epw + VANDENBERG-AFB_723930_CZ2010.epw + VANDENBERG-AFB_723930_CZ2010.epw - LANCASTER_723816_CZ2010.epw - LANCASTER_723816_CZ2010.epw + CAN_ON_Mount.Forest.716310_CWEC2016.epw + CAN_ON_Mount.Forest.716310_CWEC2016.epw - LEMOORE_747020_CZ2010.epw - LEMOORE_747020_CZ2010.epw + DAGGETT-BARSTOW_723815_CZ2010.epw + DAGGETT-BARSTOW_723815_CZ2010.epw - LIVERMORE_724927_CZ2010.epw - LIVERMORE_724927_CZ2010.epw + CAN_QC_Kuujuarapik.AP.719050_CWEC2016.epw + CAN_QC_Kuujuarapik.AP.719050_CWEC2016.epw - LOMPOC_722895_CZ2010.epw - LOMPOC_722895_CZ2010.epw + CAN_ON_London.Intl.AP.716230_CWEC2016.epw + CAN_ON_London.Intl.AP.716230_CWEC2016.epw - LONG-BEACH_722970_CZ2010.epw - LONG-BEACH_722970_CZ2010.epw + USA_HI_Honolulu.Intl.AP.911820_TMY3.epw + USA_HI_Honolulu.Intl.AP.911820_TMY3.epw - LOS-ALAMITOS_722975_CZ2010.epw - LOS-ALAMITOS_722975_CZ2010.epw + SANTA-ROSA_724957_CZ2010.epw + SANTA-ROSA_724957_CZ2010.epw - LOS-ANGELES-DOWNTOWN_722874_CZ2010.epw - LOS-ANGELES-DOWNTOWN_722874_CZ2010.epw + CAN_ON_Toronto.Pearson.Intl.AP.716240_CWEC2016.epw + CAN_ON_Toronto.Pearson.Intl.AP.716240_CWEC2016.epw - LOS-ANGELES-INTL_722950_CZ2010.epw - LOS-ANGELES-INTL_722950_CZ2010.epw + LIVERMORE_724927_CZ2010.epw + LIVERMORE_724927_CZ2010.epw - MARYSVILLE-BEALE-AFB_724837_CZ2010.epw - MARYSVILLE-BEALE-AFB_724837_CZ2010.epw + CHINA-LAKE_746120_CZ2010.epw + CHINA-LAKE_746120_CZ2010.epw - MERCED_724815_CZ2010.epw - MERCED_724815_CZ2010.epw + CAN_BC_Smithers.Rgnl.AP.719500_CWEC2016.epw + CAN_BC_Smithers.Rgnl.AP.719500_CWEC2016.epw - MODESTO_724926_CZ2010.epw - MODESTO_724926_CZ2010.epw + SANTA-ANA_722977_CZ2010.epw + SANTA-ANA_722977_CZ2010.epw - MOJAVE_722953_CZ2010.epw - MOJAVE_722953_CZ2010.epw + BURBANK-GLENDALE_722880_CZ2010.epw + BURBANK-GLENDALE_722880_CZ2010.epw - MONTAGUE-SISKIYOU-CO_725955_CZ2010.epw - MONTAGUE-SISKIYOU-CO_725955_CZ2010.epw + USA_ID_Boise.Air.Terminal.726810_TMY3.epw + USA_ID_Boise.Air.Terminal.726810_TMY3.epw - MONTEREY_724915_CZ2010.epw - MONTEREY_724915_CZ2010.epw + CAN_ON_North.Bay-Garland.AP.717310_CWEC2016.epw + CAN_ON_North.Bay-Garland.AP.717310_CWEC2016.epw - MOUNT-SHASTA_725957_CZ2010.epw - MOUNT-SHASTA_725957_CZ2010.epw + CAN_QC_Montreal-Mirabel.Intl.AP.719050_CWEC2016.epw + CAN_QC_Montreal-Mirabel.Intl.AP.719050_CWEC2016.epw - NAPA-CO_724955_CZ2010.epw - NAPA-CO_724955_CZ2010.epw + SANTA-MARIA_723940_CZ2010.epw + SANTA-MARIA_723940_CZ2010.epw - NEEDLES_723805_CZ2010.epw - NEEDLES_723805_CZ2010.epw + SAN-CLEMENTE-IS_722925_CZ2010.epw + SAN-CLEMENTE-IS_722925_CZ2010.epw - OAKLAND_724930_CZ2010.epw - OAKLAND_724930_CZ2010.epw + CAN_NU_Resolute.AP.719240_CWEC2016.epw + CAN_NU_Resolute.AP.719240_CWEC2016.epw - OXNARD_723927_CZ2010.epw - OXNARD_723927_CZ2010.epw + CAN_BC_Kelowna.Intl.AP.712030_CWEC2016.epw + CAN_BC_Kelowna.Intl.AP.712030_CWEC2016.epw - PALM-SPRINGS-INTL_722868_CZ2010.epw - PALM-SPRINGS-INTL_722868_CZ2010.epw + TORRANCE_722955_CZ2010.epw + TORRANCE_722955_CZ2010.epw - PALM-SPRINGS-THERMAL_747187_CZ2010.epw - PALM-SPRINGS-THERMAL_747187_CZ2010.epw + CAN_QC_Sept-Iles.AP.718110_CWEC2016.epw + CAN_QC_Sept-Iles.AP.718110_CWEC2016.epw - PALMDALE_723820_CZ2010.epw - PALMDALE_723820_CZ2010.epw + CAN_ON_Thunder.Bay.Intl.AP.716670_CWEC2016.epw + CAN_ON_Thunder.Bay.Intl.AP.716670_CWEC2016.epw - PALO-ALTO_724937_CZ2010.epw - PALO-ALTO_724937_CZ2010.epw + CAN_ON_CFB.Trenton.716210_CWEC2016.epw + CAN_ON_CFB.Trenton.716210_CWEC2016.epw - PASO-ROBLES_723965_CZ2010.epw - PASO-ROBLES_723965_CZ2010.epw + USA_TX_Houston-Bush.Intercontinental.AP.722430_TMY3.epw + USA_TX_Houston-Bush.Intercontinental.AP.722430_TMY3.epw - POINT-MUGU_723910_CZ2010.epw - POINT-MUGU_723910_CZ2010.epw + CAN_QC_Cap.Madelaine.714250_CWEC2016.epw + CAN_QC_Cap.Madelaine.714250_CWEC2016.epw - PORTERVILLE_723895_CZ2010.epw - PORTERVILLE_723895_CZ2010.epw + CAN_QC_Roberval.AP.717280_CWEC2016.epw + CAN_QC_Roberval.AP.717280_CWEC2016.epw - RED-BLUFF_725910_CZ2010.epw - RED-BLUFF_725910_CZ2010.epw + CAN_ON_Ottawa-Macdonald-Cartier.Intl.AP.716280_CWEC2016.epw + CAN_ON_Ottawa-Macdonald-Cartier.Intl.AP.716280_CWEC2016.epw + + + CAN_MB_Winnipeg-Richardson.Intl.AP.718520_CWEC2016.epw + CAN_MB_Winnipeg-Richardson.Intl.AP.718520_CWEC2016.epw - REDDING_725920_CZ2010.epw - REDDING_725920_CZ2010.epw + SAN-FRANCISCO-INTL_724940_CZ2010.epw + SAN-FRANCISCO-INTL_724940_CZ2010.epw RIVERSIDE-MARCH-AFB_722860_CZ2010.epw RIVERSIDE-MARCH-AFB_722860_CZ2010.epw - RIVERSIDE_722869_CZ2010.epw - RIVERSIDE_722869_CZ2010.epw + USA_NM_Albuquerque.Intl.AP.723650_TMY3.epw + USA_NM_Albuquerque.Intl.AP.723650_TMY3.epw - SACRAMENTO-EXECUTIVE_724830_CZ2010.epw - SACRAMENTO-EXECUTIVE_724830_CZ2010.epw + CAN_BC_Fort.St.John-North.Peace.Rgnl.AP.719430_CWEC2016.epw + CAN_BC_Fort.St.John-North.Peace.Rgnl.AP.719430_CWEC2016.epw - SACRAMENTO-METRO_724839_CZ2010.epw - SACRAMENTO-METRO_724839_CZ2010.epw + MODESTO_724926_CZ2010.epw + MODESTO_724926_CZ2010.epw - SALINAS_724917_CZ2010.epw - SALINAS_724917_CZ2010.epw + SAU_RI_Riyadh.AB.404380_TMYx.epw + SAU_RI_Riyadh.AB.404380_TMYx.epw - SAN-CARLOS_724938_CZ2010.epw - SAN-CARLOS_724938_CZ2010.epw + USA_AZ_Tucson-Davis-Monthan.AFB.722745_TMY3.epw + USA_AZ_Tucson-Davis-Monthan.AFB.722745_TMY3.epw - SAN-CLEMENTE-IS_722925_CZ2010.epw - SAN-CLEMENTE-IS_722925_CZ2010.epw + CAN_ON_Peterborough.Muni.AP.714360_CWEC2016.epw + CAN_ON_Peterborough.Muni.AP.714360_CWEC2016.epw - SAN-DIEGO-GILLESPIE_722907_CZ2010.epw - SAN-DIEGO-GILLESPIE_722907_CZ2010.epw + CAN_ON_Dryden.Rgnl.AP.715270_CWEC2016.epw + CAN_ON_Dryden.Rgnl.AP.715270_CWEC2016.epw - SAN-DIEGO-LINDBERGH_722900_CZ2010.epw - SAN-DIEGO-LINDBERGH_722900_CZ2010.epw + USA_CO_Boulder-Broomfield-Jefferson.County.AP.724699_TMY3.epw + USA_CO_Boulder-Broomfield-Jefferson.County.AP.724699_TMY3.epw SAN-DIEGO-MONTGOMER_722903_CZ2010.epw SAN-DIEGO-MONTGOMER_722903_CZ2010.epw - SAN-DIEGO-NORTH-IS_722906_CZ2010.epw - SAN-DIEGO-NORTH-IS_722906_CZ2010.epw - - - SAN-FRANCISCO-INTL_724940_CZ2010.epw - SAN-FRANCISCO-INTL_724940_CZ2010.epw - - - SAN-JOSE-INTL_724945_CZ2010.epw - SAN-JOSE-INTL_724945_CZ2010.epw + USA_MN_Rochester.Intl.AP.726440_TMY3.epw + USA_MN_Rochester.Intl.AP.726440_TMY3.epw - SAN-JOSE-REID_724946_CZ2010.epw - SAN-JOSE-REID_724946_CZ2010.epw + CAN_MB_The.Pas.AP.718670_CWEC2016.epw + CAN_MB_The.Pas.AP.718670_CWEC2016.epw - SAN-LUIS-CO_722897_CZ2010.epw - SAN-LUIS-CO_722897_CZ2010.epw + CAN_AB_Fort.McMurray.AP.716890_CWEC2016.epw + CAN_AB_Fort.McMurray.AP.716890_CWEC2016.epw - SAN-NICHOLAS-IS_722910_CZ2010.epw - SAN-NICHOLAS-IS_722910_CZ2010.epw + SANTA-MONICA_722885_CZ2010.epw + SANTA-MONICA_722885_CZ2010.epw - SANDBERG_723830_CZ2010.epw - SANDBERG_723830_CZ2010.epw + USA_CA_San.Francisco.Intl.AP.724940_TMY3.epw + USA_CA_San.Francisco.Intl.AP.724940_TMY3.epw - SANTA-ANA_722977_CZ2010.epw - SANTA-ANA_722977_CZ2010.epw + VNM_SVN_Ho.Chi.Minh-Tan.Son.Nhat.Intl.AP.489000_TMYx.epw + VNM_SVN_Ho.Chi.Minh-Tan.Son.Nhat.Intl.AP.489000_TMYx.epw - SANTA-BARBARA_723925_CZ2010.epw - SANTA-BARBARA_723925_CZ2010.epw + SAN-DIEGO-LINDBERGH_722900_CZ2010.epw + SAN-DIEGO-LINDBERGH_722900_CZ2010.epw - SANTA-MARIA_723940_CZ2010.epw - SANTA-MARIA_723940_CZ2010.epw + NAPA-CO_724955_CZ2010.epw + NAPA-CO_724955_CZ2010.epw - SANTA-MONICA_722885_CZ2010.epw - SANTA-MONICA_722885_CZ2010.epw + CONCORD_724936_CZ2010.epw + CONCORD_724936_CZ2010.epw - SANTA-ROSA_724957_CZ2010.epw - SANTA-ROSA_724957_CZ2010.epw + CAN_QC_Val-d-Or.Rgnl.AP.717250_CWEC2016.epw + CAN_QC_Val-d-Or.Rgnl.AP.717250_CWEC2016.epw - SAU_RI_Riyadh.AB.404380_TMYx.epw - SAU_RI_Riyadh.AB.404380_TMYx.epw + USA_CO_Fort.Collins.AWOS.724769_TMY3.epw + USA_CO_Fort.Collins.AWOS.724769_TMY3.epw - SOUTH-LAKE-TAHOE_725847_CZ2010.epw - SOUTH-LAKE-TAHOE_725847_CZ2010.epw + CAN_PE_Charlottetown.AP.717060_CWEC2016.epw + CAN_PE_Charlottetown.AP.717060_CWEC2016.epw - STOCKTON_724920_CZ2010.epw - STOCKTON_724920_CZ2010.epw + CAN_QC_Gatineau.AP.716279_TMYx.2004-2018.epw + CAN_QC_Gatineau.AP.716279_TMYx.2004-2018.epw - TORRANCE_722955_CZ2010.epw - TORRANCE_722955_CZ2010.epw + USA_TX_El.Paso.Intl.AP.722700_TMY3.epw + USA_TX_El.Paso.Intl.AP.722700_TMY3.epw - TRUCKEE-TAHOE_725846_CZ2010.epw - TRUCKEE-TAHOE_725846_CZ2010.epw + CAN_QC_Trois.Rivieres.717240_TMYx.2004-2018.epw + CAN_QC_Trois.Rivieres.717240_TMYx.2004-2018.epw - TWENTYNINE-PALMS_690150_CZ2010.epw - TWENTYNINE-PALMS_690150_CZ2010.epw + CAN_NB_Saint.John.AP.716090_CWEC2016.epw + CAN_NB_Saint.John.AP.716090_CWEC2016.epw - UKIAH_725905_CZ2010.epw - UKIAH_725905_CZ2010.epw + CAN_NS_CFB.Greenwood.713970_CWEC2016.epw + CAN_NS_CFB.Greenwood.713970_CWEC2016.epw - USA_AK_Fairbanks.Intl.AP.702610_TMY3.epw - USA_AK_Fairbanks.Intl.AP.702610_TMY3.epw + PALM-SPRINGS-INTL_722868_CZ2010.epw + PALM-SPRINGS-INTL_722868_CZ2010.epw - USA_AZ_Phoenix-Sky.Harbor.Intl.AP.722780_TMY3.epw - USA_AZ_Phoenix-Sky.Harbor.Intl.AP.722780_TMY3.epw + EUREKA_725940_CZ2010.epw + EUREKA_725940_CZ2010.epw - USA_AZ_Tucson-Davis-Monthan.AFB.722745_TMY3.epw - USA_AZ_Tucson-Davis-Monthan.AFB.722745_TMY3.epw + FULLERTON_722976_CZ2010.epw + FULLERTON_722976_CZ2010.epw - USA_CA_San.Deigo-Brown.Field.Muni.AP.722904_TMY3.epw - USA_CA_San.Deigo-Brown.Field.Muni.AP.722904_TMY3.epw + CAN_BC_Summerland.717680_CWEC2016.epw + CAN_BC_Summerland.717680_CWEC2016.epw - USA_CA_San.Francisco.Intl.AP.724940_TMY3.epw - USA_CA_San.Francisco.Intl.AP.724940_TMY3.epw + CAN_QC_Montreal-St-Hubert.Longueuil.AP.713710_CWEC2016.epw + CAN_QC_Montreal-St-Hubert.Longueuil.AP.713710_CWEC2016.epw - USA_CO_Boulder-Broomfield-Jefferson.County.AP.724699_TMY3.epw - USA_CO_Boulder-Broomfield-Jefferson.County.AP.724699_TMY3.epw + MONTAGUE-SISKIYOU-CO_725955_CZ2010.epw + MONTAGUE-SISKIYOU-CO_725955_CZ2010.epw - USA_CO_Denver-Aurora-Buckley.AFB.724695_TMY3.epw - USA_CO_Denver-Aurora-Buckley.AFB.724695_TMY3.epw + USA_AK_Fairbanks.Intl.AP.702610_TMY3.epw + USA_AK_Fairbanks.Intl.AP.702610_TMY3.epw - USA_CO_Denver.Intl.AP.725650_TMY3.epw - USA_CO_Denver.Intl.AP.725650_TMY3.epw + CAN_NS_Sydney-McCurdy.AP.717070_CWEC2016.epw + CAN_NS_Sydney-McCurdy.AP.717070_CWEC2016.epw - USA_CO_Fort.Collins.AWOS.724769_TMY3.epw - USA_CO_Fort.Collins.AWOS.724769_TMY3.epw + MERCED_724815_CZ2010.epw + MERCED_724815_CZ2010.epw - USA_FL_Miami.Intl.AP.722020_TMY3.epw - USA_FL_Miami.Intl.AP.722020_TMY3.epw + CAN_NB_Fredericton.Intl.AP.717000_CWEC2016.epw + CAN_NB_Fredericton.Intl.AP.717000_CWEC2016.epw - USA_FL_Tampa-MacDill.AFB.747880_TMY3.epw - USA_FL_Tampa-MacDill.AFB.747880_TMY3.epw + SAN-JOSE-REID_724946_CZ2010.epw + SAN-JOSE-REID_724946_CZ2010.epw - USA_GA_Atlanta-Hartsfield.Jackson.Intl.AP.722190_TMY3.epw - USA_GA_Atlanta-Hartsfield.Jackson.Intl.AP.722190_TMY3.epw + CAN_ON_Sudbury.AP.717300_CWEC2016.epw + CAN_ON_Sudbury.AP.717300_CWEC2016.epw - USA_HI_Honolulu.Intl.AP.911820_TMY3.epw - USA_HI_Honolulu.Intl.AP.911820_TMY3.epw + CAN_NS_Sable.Island.Natl.Park.716000_CWEC2016.epw + CAN_NS_Sable.Island.Natl.Park.716000_CWEC2016.epw - USA_ID_Boise.Air.Terminal.726810_TMY3.epw - USA_ID_Boise.Air.Terminal.726810_TMY3.epw + VISALIA_723896_CZ2010.epw + VISALIA_723896_CZ2010.epw - USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw - USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw + USA_MT_Great.Falls.Intl.AP.727750_TMY3.epw + USA_MT_Great.Falls.Intl.AP.727750_TMY3.epw - USA_MD_Baltimore-Washington.Intl.AP.724060_TMY3.epw - USA_MD_Baltimore-Washington.Intl.AP.724060_TMY3.epw + CAN_NT_Yellowknife.AP.719360_CWEC2016.epw + CAN_NT_Yellowknife.AP.719360_CWEC2016.epw - USA_MN_Duluth.Intl.AP.727450_TMY3.epw - USA_MN_Duluth.Intl.AP.727450_TMY3.epw + CAN_YT_Whitehorse.Intl.AP.719640_CWEC2016.epw + CAN_YT_Whitehorse.Intl.AP.719640_CWEC2016.epw - USA_MN_International.Falls.Intl.AP.727470_TMY3.epw - USA_MN_International.Falls.Intl.AP.727470_TMY3.epw + REDDING_725920_CZ2010.epw + REDDING_725920_CZ2010.epw - USA_MN_Rochester.Intl.AP.726440_TMY3.epw - USA_MN_Rochester.Intl.AP.726440_TMY3.epw + EDWARDS-AFB_723810_CZ2010.epw + EDWARDS-AFB_723810_CZ2010.epw - USA_MT_Great.Falls.Intl.AP.727750_TMY3.epw - USA_MT_Great.Falls.Intl.AP.727750_TMY3.epw + SAN-CARLOS_724938_CZ2010.epw + SAN-CARLOS_724938_CZ2010.epw USA_MT_Helena.Rgnl.AP.727720_TMY3.epw USA_MT_Helena.Rgnl.AP.727720_TMY3.epw - USA_NM_Albuquerque.Intl.AP.723650_TMY3.epw - USA_NM_Albuquerque.Intl.AP.723650_TMY3.epw - - - USA_NM_Albuquerque.Intl.Sunport.723650_TMY3.epw - USA_NM_Albuquerque.Intl.Sunport.723650_TMY3.epw - - - USA_NY_Buffalo.Niagara.Intl.AP.725280_TMY3.epw - USA_NY_Buffalo.Niagara.Intl.AP.725280_TMY3.epw + USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw + USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw - USA_NY_New.York-John.F.Kennedy.Intl.AP.744860_TMY3.epw - USA_NY_New.York-John.F.Kennedy.Intl.AP.744860_TMY3.epw + CAN_NL_Corner.Brook.719730_CWEC2016.epw + CAN_NL_Corner.Brook.719730_CWEC2016.epw - USA_OR_Salem-McNary.Field.726940_TMY3.epw - USA_OR_Salem-McNary.Field.726940_TMY3.epw + CAN_QC_Schefferville.AP.718280_CWEC2016.epw + CAN_QC_Schefferville.AP.718280_CWEC2016.epw USA_TN_Memphis.Intl.AP.723340_TMY3.epw USA_TN_Memphis.Intl.AP.723340_TMY3.epw - USA_TX_El.Paso.Intl.AP.722700_TMY3.epw - USA_TX_El.Paso.Intl.AP.722700_TMY3.epw + USA_MD_Baltimore-Washington.Intl.AP.724060_TMY3.epw + USA_MD_Baltimore-Washington.Intl.AP.724060_TMY3.epw - USA_TX_Houston-Bush.Intercontinental.AP.722430_TMY3.epw - USA_TX_Houston-Bush.Intercontinental.AP.722430_TMY3.epw + VAN-NUYS_722886_CZ2010.epw + VAN-NUYS_722886_CZ2010.epw - USA_VT_Burlington.Intl.AP.726170_TMY3.epw - USA_VT_Burlington.Intl.AP.726170_TMY3.epw + CAN_SK_Saskatoon.Intl.AP.718660_CWEC2016.epw + CAN_SK_Saskatoon.Intl.AP.718660_CWEC2016.epw - USA_WA_Port.Angeles-William.R.Fairchild.Intl.AP.727885_TMY3.epw - USA_WA_Port.Angeles-William.R.Fairchild.Intl.AP.727885_TMY3.epw + SACRAMENTO-METRO_724839_CZ2010.epw + SACRAMENTO-METRO_724839_CZ2010.epw - USA_WA_Seattle-Tacoma.Intl.AP.727930_TMY3.epw - USA_WA_Seattle-Tacoma.Intl.AP.727930_TMY3.epw + CAN_NS_Sydney-McCurdy.AP.717070_8205701_CWEC2016.epw + CAN_NS_Sydney-McCurdy.AP.717070_8205701_CWEC2016.epw - VAN-NUYS_722886_CZ2010.epw - VAN-NUYS_722886_CZ2010.epw + CAN_NS_Truro.713980_CWEC.epw + CAN_NS_Truro.713980_CWEC.epw - VANDENBERG-AFB_723930_CZ2010.epw - VANDENBERG-AFB_723930_CZ2010.epw + PASO-ROBLES_723965_CZ2010.epw + PASO-ROBLES_723965_CZ2010.epw - VISALIA_723896_CZ2010.epw - VISALIA_723896_CZ2010.epw + POINT-MUGU_723910_CZ2010.epw + POINT-MUGU_723910_CZ2010.epw - VNM_SVN_Ho.Chi.Minh-Tan.Son.Nhat.Intl.AP.489000_TMYx.epw - VNM_SVN_Ho.Chi.Minh-Tan.Son.Nhat.Intl.AP.489000_TMYx.epw + CAMARILLO_723926_CZ2010.epw + CAMARILLO_723926_CZ2010.epw - YUBA-CO_724838_CZ2010.epw - YUBA-CO_724838_CZ2010.epw + CAN_QC_Rouyn-Noranda.AP.717255_CWEC2016.epw + CAN_QC_Rouyn-Noranda.AP.717255_CWEC2016.epw + + + CAN_NL_St.Johns.Intl.AP.718010_CWEC2016.epw + CAN_NL_St.Johns.Intl.AP.718010_CWEC2016.epw @@ -1167,13 +1171,13 @@ measure.rb rb script - 0194573E + 7518F51E create_DOE_prototype_building_test.rb rb test - 1FCC0194 + 40B8E8A4 diff --git a/lib/measures/create_DOE_prototype_building/tests/create_DOE_prototype_building_test.rb b/lib/measures/create_DOE_prototype_building/tests/create_DOE_prototype_building_test.rb index 02de1ec0..1ce94a02 100644 --- a/lib/measures/create_DOE_prototype_building/tests/create_DOE_prototype_building_test.rb +++ b/lib/measures/create_DOE_prototype_building/tests/create_DOE_prototype_building_test.rb @@ -37,7 +37,7 @@ require 'openstudio/measure/ShowRunnerOutput' require 'fileutils' -require_relative '../measure.rb' +require_relative '../measure' require 'minitest/autorun' require 'json' diff --git a/lib/measures/create_and_assign_thermal_zones_for_unassigned_spaces/measure.xml b/lib/measures/create_and_assign_thermal_zones_for_unassigned_spaces/measure.xml index 9207824e..f219ca25 100644 --- a/lib/measures/create_and_assign_thermal_zones_for_unassigned_spaces/measure.xml +++ b/lib/measures/create_and_assign_thermal_zones_for_unassigned_spaces/measure.xml @@ -3,8 +3,8 @@ 3.0 create_and_assign_thermal_zones_for_unassigned_spaces ddaa752e-5d40-49b2-88de-62e71697e614 - e04b7726-cf35-4a49-90d4-0fefc662349d - 20210423T142528Z + 2cbf67e2-52f5-4bcc-9dfd-5c7d3787f2b6 + 20220505T182929Z 2AF3A68E CreateAndAssignThermalZonesForUnassignedSpaces Create and Assign Thermal Zones for Unassigned Spaces @@ -78,7 +78,7 @@ create_and_assign_thermal_zones_for_unassigned_spaces_test.rb rb test - CEA966EB + 1E1BC1F1 diff --git a/lib/measures/create_and_assign_thermal_zones_for_unassigned_spaces/tests/create_and_assign_thermal_zones_for_unassigned_spaces_test.rb b/lib/measures/create_and_assign_thermal_zones_for_unassigned_spaces/tests/create_and_assign_thermal_zones_for_unassigned_spaces_test.rb index f6c21866..b954b169 100644 --- a/lib/measures/create_and_assign_thermal_zones_for_unassigned_spaces/tests/create_and_assign_thermal_zones_for_unassigned_spaces_test.rb +++ b/lib/measures/create_and_assign_thermal_zones_for_unassigned_spaces/tests/create_and_assign_thermal_zones_for_unassigned_spaces_test.rb @@ -36,7 +36,7 @@ require 'openstudio' require 'openstudio/measure/ShowRunnerOutput' require 'minitest/autorun' -require_relative '../measure.rb' +require_relative '../measure' require 'fileutils' class CreateAndAssignThermalZonesForUnassignedSpaces_Test < MiniTest::Test @@ -49,7 +49,7 @@ def test_good_argument_values # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/example_model.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/example_model.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get @@ -86,7 +86,7 @@ def test_good_argument_values # assert(result.warnings.size == 0) # save the model to test output directory - output_file_path = OpenStudio::Path.new(File.dirname(__FILE__) + '/output/test_output.osm') + output_file_path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/output/test_output.osm") model.save(output_file_path, true) end end diff --git a/lib/measures/create_bar_from_building_type_ratios/measure.rb b/lib/measures/create_bar_from_building_type_ratios/measure.rb index 693e6530..13ee89be 100644 --- a/lib/measures/create_bar_from_building_type_ratios/measure.rb +++ b/lib/measures/create_bar_from_building_type_ratios/measure.rb @@ -41,9 +41,9 @@ # load OpenStudio measure libraries fro m openstudio-extension gem require 'openstudio-extension' require 'openstudio/extension/core/os_lib_helper_methods' -require 'openstudio/extension/core/os_lib_geometry.rb' -require 'openstudio/extension/core/os_lib_model_generation.rb' -require 'openstudio/extension/core/os_lib_model_simplification.rb' +require 'openstudio/extension/core/os_lib_geometry' +require 'openstudio/extension/core/os_lib_model_generation' +require 'openstudio/extension/core/os_lib_model_simplification' # start the measure class CreateBarFromBuildingTypeRatios < OpenStudio::Measure::ModelMeasure diff --git a/lib/measures/create_bar_from_building_type_ratios/measure.xml b/lib/measures/create_bar_from_building_type_ratios/measure.xml index 900a6862..99bffeba 100644 --- a/lib/measures/create_bar_from_building_type_ratios/measure.xml +++ b/lib/measures/create_bar_from_building_type_ratios/measure.xml @@ -3,8 +3,8 @@ 3.0 create_bar_from_building_type_ratios 6e3a14f8-c3c7-4e03-bc51-bef8a52e1a05 - 48c0bf21-b4c0-4755-83ae-a192dd5201cf - 20211029T200900Z + 56af8c9a-d4d3-46a4-b28b-1a4b92328fba + 20220505T182925Z 2AF3A68E CreateBarFromBuildingTypeRatios Create Bar From Building Type Ratios @@ -1682,17 +1682,6 @@ license A21A3ED2 - - - OpenStudio - 2.0.0 - 3.0.0 - - measure.rb - rb - script - 1EE59BDB - README.md.erb erb @@ -1705,11 +1694,22 @@ readme 831A2956 + + + OpenStudio + 2.0.0 + 3.0.0 + + measure.rb + rb + script + 4814537F + create_bar_from_building_type_ratios_test.rb rb test - 1E066661 + 1FFA3539 diff --git a/lib/measures/create_bar_from_building_type_ratios/tests/create_bar_from_building_type_ratios_test.rb b/lib/measures/create_bar_from_building_type_ratios/tests/create_bar_from_building_type_ratios_test.rb index bf0345a8..af3d14b9 100644 --- a/lib/measures/create_bar_from_building_type_ratios/tests/create_bar_from_building_type_ratios_test.rb +++ b/lib/measures/create_bar_from_building_type_ratios/tests/create_bar_from_building_type_ratios_test.rb @@ -36,7 +36,7 @@ require 'openstudio' require 'openstudio/measure/ShowRunnerOutput' require 'minitest/autorun' -require_relative '../measure.rb' +require_relative '../measure' require 'fileutils' class CreateBarFromBuildingTypeRatios_Test < Minitest::Test @@ -54,7 +54,7 @@ def apply_measure_to_model(test_name, args, model_name = nil, result_value = 'Su else # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/' + model_name) + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/#{model_name}") model = translator.loadModel(path) assert(!model.empty?) model = model.get @@ -177,7 +177,8 @@ def test_non_zero_rotation_primary_school apply_measure_to_model(__method__.to_s.gsub('test_', ''), args, nil, nil, nil) end - def test_non_zero_rotation_primary_school_adiabatic # to test intersection of just walls but not floors + # to test intersection of just walls but not floors + def test_non_zero_rotation_primary_school_adiabatic args = {} args['total_bldg_floor_area'] = 100000.0 args['num_stories_above_grade'] = 3 diff --git a/lib/measures/create_bar_from_deer_building_type_ratios/measure.rb b/lib/measures/create_bar_from_deer_building_type_ratios/measure.rb index bc347758..1c0fd460 100644 --- a/lib/measures/create_bar_from_deer_building_type_ratios/measure.rb +++ b/lib/measures/create_bar_from_deer_building_type_ratios/measure.rb @@ -41,9 +41,9 @@ # load OpenStudio measure libraries from openstudio-extension gem require 'openstudio-extension' require 'openstudio/extension/core/os_lib_helper_methods' -require 'openstudio/extension/core/os_lib_geometry.rb' -require 'openstudio/extension/core/os_lib_model_generation.rb' -require 'openstudio/extension/core/os_lib_model_simplification.rb' +require 'openstudio/extension/core/os_lib_geometry' +require 'openstudio/extension/core/os_lib_model_generation' +require 'openstudio/extension/core/os_lib_model_simplification' # start the measure class CreateBarFromDEERBuildingTypeRatios < OpenStudio::Measure::ModelMeasure diff --git a/lib/measures/create_bar_from_deer_building_type_ratios/measure.xml b/lib/measures/create_bar_from_deer_building_type_ratios/measure.xml index a5e69948..e4c9e64a 100644 --- a/lib/measures/create_bar_from_deer_building_type_ratios/measure.xml +++ b/lib/measures/create_bar_from_deer_building_type_ratios/measure.xml @@ -3,8 +3,8 @@ 3.0 create_bar_from_deer_building_type_ratios aa4a7ecf-5bfd-4c5e-b0ca-e68babbacff1 - a7331b3c-b881-4181-8e47-f74a9e84e795 - 20210716T215730Z + 2f6b3974-dc2a-44f9-9d28-51f11aa4c539 + 20220505T182932Z B31F0C1F CreateBarFromDEERBuildingTypeRatios Create Bar From DEER Building Type Ratios @@ -1054,11 +1054,23 @@ license A21A3ED2 + + README.md.erb + erb + readmeerb + 8FAE2C4C + + + README.md + md + readme + CC366365 + create_bar_from_deer_building_type_ratios_test.rb rb test - E1730A64 + 6BFE4A78 @@ -1069,19 +1081,7 @@ measure.rb rb script - B28CBC41 - - - README.md.erb - erb - readmeerb - 8FAE2C4C - - - README.md - md - readme - CC366365 + 48932749 diff --git a/lib/measures/create_bar_from_deer_building_type_ratios/tests/create_bar_from_deer_building_type_ratios_test.rb b/lib/measures/create_bar_from_deer_building_type_ratios/tests/create_bar_from_deer_building_type_ratios_test.rb index d2d64b27..b257d3b6 100644 --- a/lib/measures/create_bar_from_deer_building_type_ratios/tests/create_bar_from_deer_building_type_ratios_test.rb +++ b/lib/measures/create_bar_from_deer_building_type_ratios/tests/create_bar_from_deer_building_type_ratios_test.rb @@ -36,7 +36,7 @@ require 'openstudio' require 'openstudio/measure/ShowRunnerOutput' require 'minitest/autorun' -require_relative '../measure.rb' +require_relative '../measure' require 'fileutils' class CreateBarFromDEERBuildingTypeRatios_Test < Minitest::Test @@ -54,7 +54,7 @@ def apply_measure_to_model(test_name, args, model_name = nil, result_value = 'Su else # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/' + model_name) + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/#{model_name}") model = translator.loadModel(path) assert(!model.empty?) model = model.get diff --git a/lib/measures/create_bar_from_doe_building_type_ratios/measure.rb b/lib/measures/create_bar_from_doe_building_type_ratios/measure.rb index f0f7a39c..af50278a 100644 --- a/lib/measures/create_bar_from_doe_building_type_ratios/measure.rb +++ b/lib/measures/create_bar_from_doe_building_type_ratios/measure.rb @@ -41,9 +41,9 @@ # load OpenStudio measure libraries from openstudio-extension gem require 'openstudio-extension' require 'openstudio/extension/core/os_lib_helper_methods' -require 'openstudio/extension/core/os_lib_geometry.rb' -require 'openstudio/extension/core/os_lib_model_generation.rb' -require 'openstudio/extension/core/os_lib_model_simplification.rb' +require 'openstudio/extension/core/os_lib_geometry' +require 'openstudio/extension/core/os_lib_model_generation' +require 'openstudio/extension/core/os_lib_model_simplification' # start the measure class CreateBarFromDOEBuildingTypeRatios < OpenStudio::Measure::ModelMeasure diff --git a/lib/measures/create_bar_from_doe_building_type_ratios/measure.xml b/lib/measures/create_bar_from_doe_building_type_ratios/measure.xml index cb76606f..072877df 100644 --- a/lib/measures/create_bar_from_doe_building_type_ratios/measure.xml +++ b/lib/measures/create_bar_from_doe_building_type_ratios/measure.xml @@ -3,8 +3,8 @@ 3.0 create_bar_from_doe_building_type_ratios 0de3cff9-c805-42c4-964e-18cb43a22c63 - b22052fe-59c2-43ce-b4eb-9685a9469847 - 20211029T201024Z + f5f51bc7-16a3-4829-82fb-3bcbb773a33a + 20220505T182934Z 5F523097 CreateBarFromDOEBuildingTypeRatios Create Bar From DOE Building Type Ratios @@ -994,17 +994,6 @@ license A21A3ED2 - - - OpenStudio - 2.0.0 - 3.0.0 - - measure.rb - rb - script - F458CCEC - README.md.erb erb @@ -1017,11 +1006,22 @@ readme 7D3973D6 + + + OpenStudio + 2.0.0 + 3.0.0 + + measure.rb + rb + script + 415570D1 + create_bar_from_doe_building_type_ratios_test.rb rb test - A5886CCE + 0CABBDFA diff --git a/lib/measures/create_bar_from_doe_building_type_ratios/tests/create_bar_from_doe_building_type_ratios_test.rb b/lib/measures/create_bar_from_doe_building_type_ratios/tests/create_bar_from_doe_building_type_ratios_test.rb index 36edef50..e1a95861 100644 --- a/lib/measures/create_bar_from_doe_building_type_ratios/tests/create_bar_from_doe_building_type_ratios_test.rb +++ b/lib/measures/create_bar_from_doe_building_type_ratios/tests/create_bar_from_doe_building_type_ratios_test.rb @@ -36,7 +36,7 @@ require 'openstudio' require 'openstudio/measure/ShowRunnerOutput' require 'minitest/autorun' -require_relative '../measure.rb' +require_relative '../measure' require 'fileutils' class CreateBarFromDOEBuildingTypeRatios_Test < Minitest::Test @@ -54,7 +54,7 @@ def apply_measure_to_model(test_name, args, model_name = nil, result_value = 'Su else # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/' + model_name) + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/#{model_name}") model = translator.loadModel(path) assert(!model.empty?) model = model.get diff --git a/lib/measures/create_bar_from_model/measure.rb b/lib/measures/create_bar_from_model/measure.rb index fb08e0e7..e6023fe7 100644 --- a/lib/measures/create_bar_from_model/measure.rb +++ b/lib/measures/create_bar_from_model/measure.rb @@ -39,9 +39,9 @@ # load OpenStudio measure libraries from openstudio-extension gem require 'openstudio-extension' require 'openstudio/extension/core/os_lib_helper_methods' -require 'openstudio/extension/core/os_lib_geometry.rb' -require 'openstudio/extension/core/os_lib_model_generation.rb' -require 'openstudio/extension/core/os_lib_model_simplification.rb' +require 'openstudio/extension/core/os_lib_geometry' +require 'openstudio/extension/core/os_lib_model_generation' +require 'openstudio/extension/core/os_lib_model_simplification' # start the measure class CreateBarFromModel < OpenStudio::Measure::ModelMeasure @@ -302,11 +302,12 @@ def run(model, runner, user_arguments) # end # define length and with of bar - if bar_calc_method == 'Bar - Reduced Bounding Box' + case bar_calc_method + when 'Bar - Reduced Bounding Box' bar_calc = calc_bar_reduced_bounding_box(envelope_data_hash) - elsif bar_calc_method == 'Bar - Reduced Width' + when 'Bar - Reduced Width' bar_calc = calc_bar_reduced_width(envelope_data_hash) - elsif bar_calc_method == 'Bar - Stretched' + when 'Bar - Stretched' bar_calc = calc_bar_stretched(envelope_data_hash) end @@ -345,6 +346,7 @@ def run(model, runner, user_arguments) zone_hash = {} # key is zone value is floor area. It excludes zones with non 1 multiplier model.getThermalZones.each do |thermal_zone| next if thermal_zone.multiplier > 1 + zone_hash[thermal_zone] = thermal_zone.floorArea end target_zone = zone_hash.key(zone_hash.values.max) @@ -372,6 +374,7 @@ def run(model, runner, user_arguments) # restore thermostats for space type saved from old geometry model.getThermalZones.each do |thermal_zone| next if !thermal_zone.spaces.first.spaceType.is_initialized + space_type = thermal_zone.spaces.first.spaceType.get new_thermostat = OpenStudio::Model::ThermostatSetpointDualSetpoint.new(model) new_thermostat.setHeatingSetpointTemperatureSchedule(htg_setpoints[space_type]) @@ -388,6 +391,7 @@ def run(model, runner, user_arguments) final_ratios = {} model.getSpaceTypes.each do |space_type| next if space_type.floorArea == 0.0 + final_ratios[space_type] = space_type.floorArea / final_floor_area end Hash[final_ratios.sort_by { |k, v| v }.reverse].each do |k, v| diff --git a/lib/measures/create_bar_from_model/measure.xml b/lib/measures/create_bar_from_model/measure.xml index 47ae60b1..8db4cb60 100644 --- a/lib/measures/create_bar_from_model/measure.xml +++ b/lib/measures/create_bar_from_model/measure.xml @@ -3,8 +3,8 @@ 3.0 create_bar_from_model 87fb0783-7a38-4900-8969-40e744c67814 - bcb08c03-d88f-4ab0-bd66-02b0e869cb63 - 20210423T142531Z + c5c23516-2e33-4fe3-8c26-bfedc90f3584 + 20220505T182934Z 2AF3A68E CreateBarFromModel Create Bar From Model @@ -153,13 +153,13 @@ measure.rb rb script - 1DD6A1AD + 364B6970 create_bar_from_model_test.rb rb test - 3A9E300C + B77C7D72 diff --git a/lib/measures/create_bar_from_model/tests/create_bar_from_model_test.rb b/lib/measures/create_bar_from_model/tests/create_bar_from_model_test.rb index c7683fcd..5db8f00c 100644 --- a/lib/measures/create_bar_from_model/tests/create_bar_from_model_test.rb +++ b/lib/measures/create_bar_from_model/tests/create_bar_from_model_test.rb @@ -36,7 +36,7 @@ require 'openstudio' require 'openstudio/measure/ShowRunnerOutput' require 'minitest/autorun' -require_relative '../measure.rb' +require_relative '../measure' require 'fileutils' class CreateBarFromModel_Test < MiniTest::Test @@ -49,7 +49,7 @@ def test_good_argument_values # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/example_model.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/example_model.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get @@ -87,7 +87,7 @@ def test_good_argument_values # assert(result.warnings.size == 0) # save the model to test output directory - output_file_path = OpenStudio::Path.new(File.dirname(__FILE__) + '/output/test_output.osm') + output_file_path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/output/test_output.osm") model.save(output_file_path, true) end @@ -100,7 +100,7 @@ def test_single_space_type # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/example_model.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/example_model.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get @@ -138,7 +138,7 @@ def test_single_space_type # assert(result.warnings.size == 0) # save the model to test output directory - output_file_path = OpenStudio::Path.new(File.dirname(__FILE__) + '/output/test_single_space_type.osm') + output_file_path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/output/test_single_space_type.osm") model.save(output_file_path, true) end @@ -151,7 +151,7 @@ def test_multiplier_multi_slice # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/example_model_multipliers.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/example_model_multipliers.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get @@ -189,7 +189,7 @@ def test_multiplier_multi_slice # assert(result.warnings.size == 0) # save the model to test output directory - output_file_path = OpenStudio::Path.new(File.dirname(__FILE__) + '/output/multiplier_simple_slice_test_output.osm') + output_file_path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/output/multiplier_simple_slice_test_output.osm") model.save(output_file_path, true) end @@ -202,7 +202,7 @@ def test_multiplier_simple_slice # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/example_model_multipliers.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/example_model_multipliers.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get @@ -240,7 +240,7 @@ def test_multiplier_simple_slice # assert(result.warnings.size == 0) # save the model to test output directory - output_file_path = OpenStudio::Path.new(File.dirname(__FILE__) + '/output/multiplier_multi_slice_test_output.osm') + output_file_path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/output/multiplier_multi_slice_test_output.osm") model.save(output_file_path, true) end @@ -253,7 +253,7 @@ def test_plenum # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/med_office.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/med_office.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get @@ -291,7 +291,7 @@ def test_plenum # assert(result.warnings.size == 0) # save the model to test output directory - output_file_path = OpenStudio::Path.new(File.dirname(__FILE__) + '/output/plenum_test_output.osm') + output_file_path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/output/plenum_test_output.osm") model.save(output_file_path, true) end @@ -305,7 +305,7 @@ def test_secondary_school # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/secondary_school.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/secondary_school.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get @@ -346,7 +346,7 @@ def test_secondary_school # assert(result.warnings.size == 0) # save the model to test output directory - output_file_path = OpenStudio::Path.new(File.dirname(__FILE__) + '/output/secondary_school_test_output.osm') + output_file_path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/output/secondary_school_test_output.osm") model.save(output_file_path, true) end @@ -360,7 +360,7 @@ def test_sliver_start # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/sliver_start.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/sliver_start.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get @@ -401,7 +401,7 @@ def test_sliver_start # assert(result.warnings.size == 0) # save the model to test output directory - output_file_path = OpenStudio::Path.new(File.dirname(__FILE__) + '/output/sliver_start_test_output.osm') + output_file_path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/output/sliver_start_test_output.osm") model.save(output_file_path, true) end @@ -415,7 +415,7 @@ def test_sliver_end # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/sliver_end.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/sliver_end.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get @@ -456,7 +456,7 @@ def test_sliver_end # assert(result.warnings.size == 0) # save the model to test output directory - output_file_path = OpenStudio::Path.new(File.dirname(__FILE__) + '/output/sliver_end_test_output.osm') + output_file_path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/output/sliver_end_test_output.osm") model.save(output_file_path, true) end @@ -470,7 +470,7 @@ def test_sliver_multiplier # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/sliver_multiplier.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/sliver_multiplier.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get @@ -511,7 +511,7 @@ def test_sliver_multiplier # assert(result.warnings.size == 0) # save the model to test output directory - output_file_path = OpenStudio::Path.new(File.dirname(__FILE__) + '/output/sliver_multiplier_test_output.osm') + output_file_path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/output/sliver_multiplier_test_output.osm") model.save(output_file_path, true) end end diff --git a/lib/measures/create_bar_from_space_type_ratios/measure.rb b/lib/measures/create_bar_from_space_type_ratios/measure.rb index a0618049..c45d6cb5 100644 --- a/lib/measures/create_bar_from_space_type_ratios/measure.rb +++ b/lib/measures/create_bar_from_space_type_ratios/measure.rb @@ -47,9 +47,9 @@ # load OpenStudio measure libraries from openstudio-extension gem require 'openstudio-extension' require 'openstudio/extension/core/os_lib_helper_methods' -require 'openstudio/extension/core/os_lib_geometry.rb' -require 'openstudio/extension/core/os_lib_model_generation.rb' -require 'openstudio/extension/core/os_lib_model_simplification.rb' +require 'openstudio/extension/core/os_lib_geometry' +require 'openstudio/extension/core/os_lib_model_generation' +require 'openstudio/extension/core/os_lib_model_simplification' # start the measure class CreateBarFromSpaceTypeRatios < OpenStudio::Measure::ModelMeasure diff --git a/lib/measures/create_bar_from_space_type_ratios/measure.xml b/lib/measures/create_bar_from_space_type_ratios/measure.xml index b25f69eb..e4065135 100644 --- a/lib/measures/create_bar_from_space_type_ratios/measure.xml +++ b/lib/measures/create_bar_from_space_type_ratios/measure.xml @@ -3,8 +3,8 @@ 3.0 create_bar_from_space_type_ratios 3e988765-9673-46f8-9b65-99d5b86c2b22 - fb84a039-2d3a-452d-bdda-a2ced9133628 - 20210716T215705Z + 29ef75fa-0a73-4a08-85bb-a421d8aebbf2 + 20220505T182936Z 49BEF039 CreateBarFromSpaceTypeRatios Create Bar From Space Type Ratios @@ -654,11 +654,23 @@ license A21A3ED2 + + README.md.erb + erb + readmeerb + 0BC848FD + + + README.md + md + readme + F153B1B9 + create_bar_from_space_type_ratios_test.rb rb test - 61FDF1C4 + 5A8700A0 @@ -669,19 +681,7 @@ measure.rb rb script - B33DCF44 - - - README.md.erb - erb - readmeerb - 0BC848FD - - - README.md - md - readme - F153B1B9 + CA930408 diff --git a/lib/measures/create_bar_from_space_type_ratios/tests/create_bar_from_space_type_ratios_test.rb b/lib/measures/create_bar_from_space_type_ratios/tests/create_bar_from_space_type_ratios_test.rb index bbc6eb3b..bb6f2bc1 100644 --- a/lib/measures/create_bar_from_space_type_ratios/tests/create_bar_from_space_type_ratios_test.rb +++ b/lib/measures/create_bar_from_space_type_ratios/tests/create_bar_from_space_type_ratios_test.rb @@ -36,7 +36,7 @@ require 'openstudio' require 'openstudio/measure/ShowRunnerOutput' require 'minitest/autorun' -require_relative '../measure.rb' +require_relative '../measure' require 'fileutils' class CreateBarFromSpaceTypeRatios_Test < Minitest::Test @@ -54,7 +54,7 @@ def apply_measure_to_model(test_name, args, model_name = nil, result_value = 'Su else # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/' + model_name) + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/#{model_name}") model = translator.loadModel(path) assert(!model.empty?) model = model.get diff --git a/lib/measures/create_baseline_building/measure.rb b/lib/measures/create_baseline_building/measure.rb index 1eb96a20..0eb26f80 100644 --- a/lib/measures/create_baseline_building/measure.rb +++ b/lib/measures/create_baseline_building/measure.rb @@ -233,7 +233,7 @@ def run(model, runner, user_arguments) log_msgs(debug) return success - end # end the run method + end # Get all the log messages and put into output # for users to see. @@ -253,6 +253,7 @@ def log_msgs(debug) msg.logChannel.include?('Translator') || # Forward translator and geometry translator msg.logMessage.include?('UseWeatherFile') || # 'UseWeatherFile' is not yet a supported option for YearDescription msg.logMessage.include?('has multiple parents') # Object of type 'OS:Curve:Cubic' and named 'VSD-TWR-FAN-FPLR' has multiple parents. Returning the first. + # Report the message in the correct way if msg.logLevel == OpenStudio::Info @runner.registerInfo(msg.logMessage) @@ -267,7 +268,7 @@ def log_msgs(debug) end @runner.registerInfo("Total Time = #{(Time.new - @start_time).round}sec.") end -end # end the measure +end # this allows the measure to be use by the application CreateBaselineBuilding.new.registerWithApplication diff --git a/lib/measures/create_baseline_building/measure.xml b/lib/measures/create_baseline_building/measure.xml index 14972445..46086ed8 100644 --- a/lib/measures/create_baseline_building/measure.xml +++ b/lib/measures/create_baseline_building/measure.xml @@ -3,8 +3,8 @@ 3.0 create_baseline_building 4de56e21-b6cd-45d9-8466-862507d228b2 - f28d8b88-4892-4645-bbf0-21f21d0f7ad1 - 20210806T162711Z + 0b726224-752c-4961-9422-505c2e506f99 + 20220505T182926Z A514F332 CreateBaselineBuilding Create Baseline Building @@ -269,7 +269,7 @@ create_baseline_building_test.rb rb test - 5A345F10 + 56AD4C78 @@ -280,7 +280,7 @@ measure.rb rb script - 5520207F + 70026B27 diff --git a/lib/measures/create_baseline_building/tests/create_baseline_building_test.rb b/lib/measures/create_baseline_building/tests/create_baseline_building_test.rb index 7e273edf..116a2685 100644 --- a/lib/measures/create_baseline_building/tests/create_baseline_building_test.rb +++ b/lib/measures/create_baseline_building/tests/create_baseline_building_test.rb @@ -39,7 +39,7 @@ require 'openstudio/measure/ShowRunnerOutput' require 'fileutils' -require_relative '../measure.rb' +require_relative '../measure' require 'minitest/autorun' require 'json' diff --git a/lib/measures/create_deer_prototype_building/measure.xml b/lib/measures/create_deer_prototype_building/measure.xml index 44fa9ee3..df49e2b1 100644 --- a/lib/measures/create_deer_prototype_building/measure.xml +++ b/lib/measures/create_deer_prototype_building/measure.xml @@ -3,8 +3,8 @@ 3.0 create_deer_prototype_building 752055bd-10d9-4ede-8a35-18487fedf579 - aac0839a-93de-40a4-8b40-82b809d84edb - 20210806T162711Z + 8b85f282-639e-4a80-af9d-cdfefeb38c47 + 20220505T182926Z A514F332 CreateDEERPrototypeBuilding Create DEER Prototype Building ALPHA Version @@ -839,7 +839,7 @@ create_DEER_prototype_building_test.rb rb test - D80681DA + 94E3EAF7 diff --git a/lib/measures/create_deer_prototype_building/tests/create_DEER_prototype_building_test.rb b/lib/measures/create_deer_prototype_building/tests/create_DEER_prototype_building_test.rb index 55d6cece..354164eb 100644 --- a/lib/measures/create_deer_prototype_building/tests/create_DEER_prototype_building_test.rb +++ b/lib/measures/create_deer_prototype_building/tests/create_DEER_prototype_building_test.rb @@ -37,7 +37,7 @@ require 'openstudio/measure/ShowRunnerOutput' require 'minitest/autorun' require 'json' -require_relative '../measure.rb' +require_relative '../measure' require 'fileutils' require 'socket' diff --git a/lib/measures/create_parametric_schedules/measure.rb b/lib/measures/create_parametric_schedules/measure.rb index aa74aa49..b22ab6c3 100644 --- a/lib/measures/create_parametric_schedules/measure.rb +++ b/lib/measures/create_parametric_schedules/measure.rb @@ -41,7 +41,7 @@ # load OpenStudio measure libraries from openstudio-extension gem require 'openstudio-extension' require 'openstudio/extension/core/os_lib_helper_methods' -require 'openstudio/extension/core/os_lib_schedules.rb' +require 'openstudio/extension/core/os_lib_schedules' # start the measure class CreateParametricSchedules < OpenStudio::Measure::ModelMeasure @@ -206,7 +206,7 @@ def arguments(model) occupancy_profiles.setDefaultValue(string.join(', ')) args << occupancy_profiles - # note: infiltration, setpoints, and hvac availability follow the same time parameters but use different values + # NOTE: infiltration, setpoints, and hvac availability follow the same time parameters but use different values # Make argument for infiltration_profiles string = [] @@ -336,13 +336,14 @@ def process_hash(runner, string, args, profile_override = [], ruleset_name) # day_type specific gsub temp_array.each_with_index do |string, i| day_type = string.split('=>').first.delete(':') - if day_type == 'default' + case day_type + when 'default' hoo_start = args['hoo_start_wkdy'] hoo_end = args['hoo_end_wkdy'] - elsif day_type == 'saturday' + when 'saturday' hoo_start = args['hoo_start_sat'] hoo_end = args['hoo_end_sat'] - elsif day_type == 'sunday' + when 'sunday' hoo_start = args['hoo_start_sun'] hoo_end = args['hoo_end_sun'] end @@ -364,7 +365,7 @@ def process_hash(runner, string, args, profile_override = [], ruleset_name) final_string = temp_array.join(']], :') hash = eval("{#{final_string}}").to_hash - rescue SyntaxError => se + rescue SyntaxError => e runner.registerError("{#{final_string}} could not be converted to a hash.") return false end @@ -478,7 +479,7 @@ def process_hash(runner, string, args, profile_override = [], ruleset_name) time_values_used << time_value_pair[0] end end - items_to_remove.reverse.each do |i| + items_to_remove.reverse_each do |i| time_value_pairs.delete_at(i) end @@ -500,11 +501,12 @@ def process_hash(runner, string, args, profile_override = [], ruleset_name) end # add on text needed for createComplexSchedule - if day_type == :saturday + case day_type + when :saturday time_value_pairs.insert(0, 'Sat') time_value_pairs.insert(0, '1/1-12/31') time_value_pairs.insert(0, 'Saturday') - elsif day_type == :sunday + when :sunday time_value_pairs.insert(0, 'Sun') time_value_pairs.insert(0, '1/1-12/31') time_value_pairs.insert(0, 'Sunday') @@ -623,6 +625,7 @@ def run(model, runner, user_arguments) next if space_type.standardsSpaceType.get != args['standards_space_type'] end next if space_type.spaces.empty? + space_types_to_alter << space_type end @@ -646,6 +649,7 @@ def run(model, runner, user_arguments) # remove schedule sets. model.getDefaultScheduleSets.each do |sch_set| next if sch_set == default_schedule_set + sch_set.remove end @@ -703,6 +707,7 @@ def run(model, runner, user_arguments) if args['alter_swh_wo_space'] model.getWaterUseEquipments.each do |water_use_equipment| next if water_use_equipment.space.is_initialized + water_use_equipment_to_alter << water_use_equipment end end @@ -860,7 +865,7 @@ def run(model, runner, user_arguments) hash = process_hash(runner, args['hvac_availability_profiles'], args, profile_override, ruleset_name) if !hash then runner.registerError("Failed to generate #{ruleset_name}"); return false end winter_design_day = [[24, 1]] # TODO: - confirm proper value - summer_design_day = [[24, 1]] # todo - confirm proper value + summer_design_day = [[24, 1]] # TODO: - confirm proper value default_day = hash[:default] rules = [] rules << hash[:saturday] diff --git a/lib/measures/create_parametric_schedules/measure.xml b/lib/measures/create_parametric_schedules/measure.xml index 58dbba63..00b7ad85 100644 --- a/lib/measures/create_parametric_schedules/measure.xml +++ b/lib/measures/create_parametric_schedules/measure.xml @@ -3,8 +3,8 @@ 3.0 create_parametric_schedules befa8099-c6a7-4045-8792-53fc7124b862 - 844a1ee9-3be8-400e-b01c-340cc0046442 - 20210423T142533Z + 41022be2-227f-4c93-8ff0-8970d23eef8e + 20220505T182933Z 03F02484 CreateParametricSchedules Create Parametric Schedules @@ -332,13 +332,13 @@ measure.rb rb script - 5245FA2C + 374552A6 create_parametric_schedules_test.rb rb test - 07FB92F6 + 691911FE diff --git a/lib/measures/create_parametric_schedules/tests/create_parametric_schedules_test.rb b/lib/measures/create_parametric_schedules/tests/create_parametric_schedules_test.rb index 7c06bd67..e02698f3 100644 --- a/lib/measures/create_parametric_schedules/tests/create_parametric_schedules_test.rb +++ b/lib/measures/create_parametric_schedules/tests/create_parametric_schedules_test.rb @@ -36,7 +36,7 @@ require 'openstudio' require 'openstudio/measure/ShowRunnerOutput' require 'minitest/autorun' -require_relative '../measure.rb' +require_relative '../measure' require 'fileutils' class CreateParametricSchedules_Test < MiniTest::Test @@ -54,7 +54,7 @@ def apply_measure_to_model(test_name, args, model_name = nil, result_value = 'Su else # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/' + model_name) + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/#{model_name}") model = translator.loadModel(path) assert(!model.empty?) model = model.get diff --git a/lib/measures/create_typical_building_from_model/measure.rb b/lib/measures/create_typical_building_from_model/measure.rb index f6699f7a..07643ce3 100644 --- a/lib/measures/create_typical_building_from_model/measure.rb +++ b/lib/measures/create_typical_building_from_model/measure.rb @@ -38,7 +38,7 @@ # load OpenStudio measure libraries from openstudio-extension gem require 'openstudio-extension' require 'openstudio/extension/core/os_lib_helper_methods' -require 'openstudio/extension/core/os_lib_model_generation.rb' +require 'openstudio/extension/core/os_lib_model_generation' require_relative 'resources/Model.hvac' # DLM: should this be in openstudio-standards? dfg some tests fail without it diff --git a/lib/measures/create_typical_building_from_model/measure.xml b/lib/measures/create_typical_building_from_model/measure.xml index a12729fe..c7f9e2f3 100644 --- a/lib/measures/create_typical_building_from_model/measure.xml +++ b/lib/measures/create_typical_building_from_model/measure.xml @@ -3,8 +3,8 @@ 3.0 create_typical_building_from_model 339a2e3a-273c-4494-bb50-bfe586a0647c - 97112603-b027-4802-9310-d0e02b78200d - 20210716T214830Z + 31f3a460-1a03-4b60-abe2-26a20388685f + 20220505T182926Z EE13F09F CreateTypicalBuildingFromModel Create Typical Building from Model @@ -1544,18 +1544,6 @@ license A21A3ED2 - - measure_test_hvac.rb - rb - test - DEB61C22 - - - create_typical_building_from_model_test.rb - rb - test - 1C2C0385 - Model.hvac.rb rb @@ -1568,6 +1556,24 @@ readmeerb 6A400402 + + README.md + md + readme + AC908059 + + + measure_test_hvac.rb + rb + test + 3ADA2599 + + + create_typical_building_from_model_test.rb + rb + test + 70747188 + OpenStudio @@ -1577,13 +1583,7 @@ measure.rb rb script - D98EF78A - - - README.md - md - readme - AC908059 + A6580D22 diff --git a/lib/measures/create_typical_building_from_model/tests/create_typical_building_from_model_test.rb b/lib/measures/create_typical_building_from_model/tests/create_typical_building_from_model_test.rb index 989bf686..ec2b9b55 100644 --- a/lib/measures/create_typical_building_from_model/tests/create_typical_building_from_model_test.rb +++ b/lib/measures/create_typical_building_from_model/tests/create_typical_building_from_model_test.rb @@ -36,7 +36,7 @@ require 'openstudio' require 'openstudio/measure/ShowRunnerOutput' require 'minitest/autorun' -require_relative '../measure.rb' +require_relative '../measure' require 'fileutils' class CreateTypicalBuildingFromModel_Test < Minitest::Test @@ -55,7 +55,7 @@ def apply_measure_to_model(test_name, args, model_name = nil, result_value = 'Su measure = CreateTypicalBuildingFromModel.new # create an instance of a runner with OSW - osw_path = OpenStudio::Path.new(File.dirname(__FILE__) + '/measure_test.osw') + osw_path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/measure_test.osw") osw = OpenStudio::WorkflowJSON.load(osw_path).get runner = OpenStudio::Measure::OSRunner.new(osw) @@ -65,7 +65,7 @@ def apply_measure_to_model(test_name, args, model_name = nil, result_value = 'Su else # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/' + model_name) + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/#{model_name}") model = translator.loadModel(path) assert(!model.empty?) model = model.get diff --git a/lib/measures/create_typical_building_from_model/tests/measure_test_hvac.rb b/lib/measures/create_typical_building_from_model/tests/measure_test_hvac.rb index cc68e7c4..c5013e37 100644 --- a/lib/measures/create_typical_building_from_model/tests/measure_test_hvac.rb +++ b/lib/measures/create_typical_building_from_model/tests/measure_test_hvac.rb @@ -36,7 +36,7 @@ require 'openstudio' require 'openstudio/measure/ShowRunnerOutput' require 'minitest/autorun' -require_relative '../measure.rb' +require_relative '../measure' require 'fileutils' class AddHVACSystemTest < MiniTest::Test diff --git a/lib/measures/create_typical_deer_building_from_model/measure.rb b/lib/measures/create_typical_deer_building_from_model/measure.rb index 4db376fd..d55f21d6 100644 --- a/lib/measures/create_typical_deer_building_from_model/measure.rb +++ b/lib/measures/create_typical_deer_building_from_model/measure.rb @@ -41,7 +41,7 @@ # load OpenStudio measure libraries from openstudio-extension gem require 'openstudio-extension' require 'openstudio/extension/core/os_lib_helper_methods' -require 'openstudio/extension/core/os_lib_model_generation.rb' +require 'openstudio/extension/core/os_lib_model_generation' require_relative 'resources/Model.hvac' # DLM: should this be in openstudio-standards? dfg some tests fail without it diff --git a/lib/measures/create_typical_deer_building_from_model/measure.xml b/lib/measures/create_typical_deer_building_from_model/measure.xml index bd3f990e..d130912d 100644 --- a/lib/measures/create_typical_deer_building_from_model/measure.xml +++ b/lib/measures/create_typical_deer_building_from_model/measure.xml @@ -3,8 +3,8 @@ 3.0 create_typical_deer_building_from_model 09cc23db-5e9b-4b11-b167-1852a15ed339 - bdfa6001-d655-473d-94bd-02c58b4808a8 - 20210729T163235Z + f8a8e7e4-350b-4b0f-a27a-18e1ddf170fd + 20220505T182935Z AABAC479 CreateTypicalDEERBuildingFromModel Create Typical DEER Building from Model @@ -1381,18 +1381,6 @@ license A21A3ED2 - - measure_test_hvac.rb - rb - test - B00E4105 - - - create_typical_deer_building_from_model_test.rb - rb - test - F3844890 - Model.hvac.rb rb @@ -1405,6 +1393,24 @@ readmeerb DD4698D3 + + README.md + md + readme + 1B2E71EB + + + measure_test_hvac.rb + rb + test + 3FE8544B + + + create_typical_deer_building_from_model_test.rb + rb + test + B3C5409D + OpenStudio @@ -1414,13 +1420,7 @@ measure.rb rb script - 10822852 - - - README.md - md - readme - 1B2E71EB + 088F9AFB diff --git a/lib/measures/create_typical_deer_building_from_model/tests/create_typical_deer_building_from_model_test.rb b/lib/measures/create_typical_deer_building_from_model/tests/create_typical_deer_building_from_model_test.rb index f0ab3f1d..874aefa9 100644 --- a/lib/measures/create_typical_deer_building_from_model/tests/create_typical_deer_building_from_model_test.rb +++ b/lib/measures/create_typical_deer_building_from_model/tests/create_typical_deer_building_from_model_test.rb @@ -36,7 +36,7 @@ require 'openstudio' require 'openstudio/measure/ShowRunnerOutput' require 'minitest/autorun' -require_relative '../measure.rb' +require_relative '../measure' require 'fileutils' class CreateTypicalDEERBuildingFromModel_Test < Minitest::Test @@ -58,7 +58,7 @@ def apply_measure_to_model(test_name, args, model_name = nil, result_value = 'Su measure = CreateTypicalDEERBuildingFromModel.new # create an instance of a runner with OSW - osw_path = OpenStudio::Path.new(File.dirname(__FILE__) + '/measure_test.osw') + osw_path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/measure_test.osw") osw = OpenStudio::WorkflowJSON.load(osw_path).get runner = OpenStudio::Measure::OSRunner.new(osw) @@ -68,7 +68,7 @@ def apply_measure_to_model(test_name, args, model_name = nil, result_value = 'Su else # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/' + model_name) + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/#{model_name}") model = translator.loadModel(path) assert(!model.empty?) model = model.get diff --git a/lib/measures/create_typical_deer_building_from_model/tests/measure_test_hvac.rb b/lib/measures/create_typical_deer_building_from_model/tests/measure_test_hvac.rb index ee8e4877..7e6fd472 100644 --- a/lib/measures/create_typical_deer_building_from_model/tests/measure_test_hvac.rb +++ b/lib/measures/create_typical_deer_building_from_model/tests/measure_test_hvac.rb @@ -36,7 +36,7 @@ require 'openstudio' require 'openstudio/measure/ShowRunnerOutput' require 'minitest/autorun' -require_relative '../measure.rb' +require_relative '../measure' require 'fileutils' class AddHVACSystemTest < MiniTest::Test diff --git a/lib/measures/create_typical_doe_building_from_model/measure.rb b/lib/measures/create_typical_doe_building_from_model/measure.rb index be8e2735..8036cf4a 100644 --- a/lib/measures/create_typical_doe_building_from_model/measure.rb +++ b/lib/measures/create_typical_doe_building_from_model/measure.rb @@ -41,7 +41,7 @@ # load OpenStudio measure libraries from openstudio-extension gem require 'openstudio-extension' require 'openstudio/extension/core/os_lib_helper_methods' -require 'openstudio/extension/core/os_lib_model_generation.rb' +require 'openstudio/extension/core/os_lib_model_generation' require_relative 'resources/Model.hvac' # DLM: should this be in openstudio-standards? dfg some tests fail without it diff --git a/lib/measures/create_typical_doe_building_from_model/measure.xml b/lib/measures/create_typical_doe_building_from_model/measure.xml index 38bcd6c3..9ce6655f 100644 --- a/lib/measures/create_typical_doe_building_from_model/measure.xml +++ b/lib/measures/create_typical_doe_building_from_model/measure.xml @@ -3,8 +3,8 @@ 3.0 create_typical_doe_building_from_model b2c80210-33b3-4dfd-8267-535efd81f552 - 6272a546-b267-4de2-a0cc-0ea8d18c5159 - 20210716T214758Z + bd01bf11-d315-49ed-8c05-3ce269edbc1f + 20220505T182933Z 99E7000D CreateTypicalDOEBuildingFromModel Create Typical DOE Building from Model @@ -1378,18 +1378,6 @@ license A21A3ED2 - - create_typical_doe_building_from_model_test.rb - rb - test - 59AEB6FD - - - measure_test_hvac.rb - rb - test - 188F5F6B - Model.hvac.rb rb @@ -1402,6 +1390,24 @@ readmeerb BDCE44E6 + + README.md + md + readme + 7F39813C + + + create_typical_doe_building_from_model_test.rb + rb + test + 2DF721BA + + + measure_test_hvac.rb + rb + test + 9B04EEB7 + OpenStudio @@ -1411,13 +1417,7 @@ measure.rb rb script - 7A862D5A - - - README.md - md - readme - 7F39813C + 72714DCB diff --git a/lib/measures/create_typical_doe_building_from_model/tests/create_typical_doe_building_from_model_test.rb b/lib/measures/create_typical_doe_building_from_model/tests/create_typical_doe_building_from_model_test.rb index 854370a9..18e04d22 100644 --- a/lib/measures/create_typical_doe_building_from_model/tests/create_typical_doe_building_from_model_test.rb +++ b/lib/measures/create_typical_doe_building_from_model/tests/create_typical_doe_building_from_model_test.rb @@ -36,7 +36,7 @@ require 'openstudio' require 'openstudio/measure/ShowRunnerOutput' require 'minitest/autorun' -require_relative '../measure.rb' +require_relative '../measure' require 'fileutils' class CreateTypicalDOEBuildingFromModel_Test < Minitest::Test @@ -58,7 +58,7 @@ def apply_measure_to_model(test_name, args, model_name = nil, result_value = 'Su measure = CreateTypicalDOEBuildingFromModel.new # create an instance of a runner with OSW - osw_path = OpenStudio::Path.new(File.dirname(__FILE__) + '/measure_test.osw') + osw_path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/measure_test.osw") osw = OpenStudio::WorkflowJSON.load(osw_path).get runner = OpenStudio::Measure::OSRunner.new(osw) @@ -68,7 +68,7 @@ def apply_measure_to_model(test_name, args, model_name = nil, result_value = 'Su else # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/' + model_name) + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/#{model_name}") model = translator.loadModel(path) assert(!model.empty?) model = model.get diff --git a/lib/measures/create_typical_doe_building_from_model/tests/measure_test_hvac.rb b/lib/measures/create_typical_doe_building_from_model/tests/measure_test_hvac.rb index 8efa1b81..1fc37d43 100644 --- a/lib/measures/create_typical_doe_building_from_model/tests/measure_test_hvac.rb +++ b/lib/measures/create_typical_doe_building_from_model/tests/measure_test_hvac.rb @@ -36,7 +36,7 @@ require 'openstudio' require 'openstudio/measure/ShowRunnerOutput' require 'minitest/autorun' -require_relative '../measure.rb' +require_relative '../measure' require 'fileutils' class AddHVACSystemTest < MiniTest::Test diff --git a/lib/measures/deer_space_type_and_construction_set_wizard/measure.rb b/lib/measures/deer_space_type_and_construction_set_wizard/measure.rb index 6e983594..56c88626 100644 --- a/lib/measures/deer_space_type_and_construction_set_wizard/measure.rb +++ b/lib/measures/deer_space_type_and_construction_set_wizard/measure.rb @@ -49,7 +49,7 @@ class DEERSpaceTypeAndConstructionSetWizard < OpenStudio::Measure::ModelMeasure # load OpenStudio measure libraries from openstudio-extension gem require 'openstudio-extension' require 'openstudio/extension/core/os_lib_helper_methods' - require 'openstudio/extension/core/os_lib_model_generation.rb' + require 'openstudio/extension/core/os_lib_model_generation' # resource files used by measure include OsLib_HelperMethods diff --git a/lib/measures/deer_space_type_and_construction_set_wizard/measure.xml b/lib/measures/deer_space_type_and_construction_set_wizard/measure.xml index c589d944..93ae9920 100644 --- a/lib/measures/deer_space_type_and_construction_set_wizard/measure.xml +++ b/lib/measures/deer_space_type_and_construction_set_wizard/measure.xml @@ -3,8 +3,8 @@ 3.0 deer_space_type_and_construction_set_wizard d8effcbd-52b2-4e5c-866c-e85091142aa6 - 745737d5-1816-4dc6-8a95-0059b881b88a - 20210423T142536Z + ef3a2767-2503-4ef7-97aa-ad2e64a859a4 + 20220505T182929Z A514F332 DEERSpaceTypeAndConstructionSetWizard DEER Space Type and Construction Set Wizard @@ -363,7 +363,7 @@ deer_space_type_and_construction_set_wizard_Test.rb rb test - 854655C1 + 8B39BFC0 @@ -374,7 +374,7 @@ measure.rb rb script - D6961EE1 + B9BC7D57 diff --git a/lib/measures/deer_space_type_and_construction_set_wizard/tests/deer_space_type_and_construction_set_wizard_Test.rb b/lib/measures/deer_space_type_and_construction_set_wizard/tests/deer_space_type_and_construction_set_wizard_Test.rb index 38ae4382..ad2c5983 100644 --- a/lib/measures/deer_space_type_and_construction_set_wizard/tests/deer_space_type_and_construction_set_wizard_Test.rb +++ b/lib/measures/deer_space_type_and_construction_set_wizard/tests/deer_space_type_and_construction_set_wizard_Test.rb @@ -37,7 +37,7 @@ require 'openstudio/measure/ShowRunnerOutput' require 'fileutils' -require_relative '../measure.rb' +require_relative '../measure' require 'minitest/autorun' class DEERSpaceTypeAndConstructionSetWizard_Test < Minitest::Test @@ -52,7 +52,7 @@ def test_empty_seed # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/EmptySeedModel.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/EmptySeedModel.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get diff --git a/lib/measures/find_and_replace_in_all_thermal_zone_names/measure.xml b/lib/measures/find_and_replace_in_all_thermal_zone_names/measure.xml index 7c147692..e2237742 100644 --- a/lib/measures/find_and_replace_in_all_thermal_zone_names/measure.xml +++ b/lib/measures/find_and_replace_in_all_thermal_zone_names/measure.xml @@ -3,8 +3,8 @@ 3.0 find_and_replace_in_all_thermal_zone_names 3573d81e-e7de-4949-be50-8abcd0f95a35 - 85da1815-b093-45ef-a399-1c8cc9b46956 - 20210423T142537Z + aa8dce36-46c8-4bd1-a755-e5368218a0c1 + 20220505T182935Z 057E8D9D FindAndReplaceInAllThermalZoneNames Find And Replace In All Thermal Zone Names @@ -85,7 +85,7 @@ find_and_replace_in_all_thermal_zone_names_test.rb rb test - 5EF10DDA + 1ACD900C diff --git a/lib/measures/find_and_replace_in_all_thermal_zone_names/tests/find_and_replace_in_all_thermal_zone_names_test.rb b/lib/measures/find_and_replace_in_all_thermal_zone_names/tests/find_and_replace_in_all_thermal_zone_names_test.rb index 48035820..05335ac0 100644 --- a/lib/measures/find_and_replace_in_all_thermal_zone_names/tests/find_and_replace_in_all_thermal_zone_names_test.rb +++ b/lib/measures/find_and_replace_in_all_thermal_zone_names/tests/find_and_replace_in_all_thermal_zone_names_test.rb @@ -37,7 +37,7 @@ require 'openstudio/measure/ShowRunnerOutput' require 'fileutils' -require_relative '../measure.rb' +require_relative '../measure' require 'minitest/autorun' class FindAndReplaceInAllThermalZoneNamesTest < Minitest::Test @@ -90,7 +90,7 @@ def test_imported_idf_model # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/ImportedIdf_RefFsr.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/ImportedIdf_RefFsr.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get diff --git a/lib/measures/make_shading_surfaces_based_on_zone_multipliers/measure.rb b/lib/measures/make_shading_surfaces_based_on_zone_multipliers/measure.rb index 642da33d..6604b5a5 100644 --- a/lib/measures/make_shading_surfaces_based_on_zone_multipliers/measure.rb +++ b/lib/measures/make_shading_surfaces_based_on_zone_multipliers/measure.rb @@ -132,6 +132,7 @@ def run(model, runner, user_arguments) space.surfaces.each do |surface| next if surface.outsideBoundaryCondition != 'Outdoors' + surfaces_to_copy[surface] = multiplier # store vertices @@ -157,6 +158,7 @@ def run(model, runner, user_arguments) space.surfaces.each do |surface| next if surface.outsideBoundaryCondition != 'Outdoors' + surfaces_to_copy[surface] = multiplier # store vertices diff --git a/lib/measures/make_shading_surfaces_based_on_zone_multipliers/measure.xml b/lib/measures/make_shading_surfaces_based_on_zone_multipliers/measure.xml index 467a97c0..0307cc4c 100644 --- a/lib/measures/make_shading_surfaces_based_on_zone_multipliers/measure.xml +++ b/lib/measures/make_shading_surfaces_based_on_zone_multipliers/measure.xml @@ -3,8 +3,8 @@ 3.0 make_shading_surfaces_based_on_zone_multipliers 57d7314d-2ff0-4c13-bf07-b63380bfdea6 - 280fcc05-b5d1-4f95-9bc3-f0a426fa1a1f - 20210423T142537Z + b6f2e9fb-355d-4e3d-acee-3ec908d95ef3 + 20220505T182926Z 2AF3A68E MakeShadingSurfacesBasedOnZoneMultipliers Make Shading Surfaces Based on Zone Multipliers @@ -97,13 +97,13 @@ measure.rb rb script - 2A4A98D5 + 5DEA693D make_shading_surfaces_based_on_zone_multipliers_test.rb rb test - E7C200C9 + E4A4E702 diff --git a/lib/measures/make_shading_surfaces_based_on_zone_multipliers/tests/make_shading_surfaces_based_on_zone_multipliers_test.rb b/lib/measures/make_shading_surfaces_based_on_zone_multipliers/tests/make_shading_surfaces_based_on_zone_multipliers_test.rb index 973a0e9c..645a257a 100644 --- a/lib/measures/make_shading_surfaces_based_on_zone_multipliers/tests/make_shading_surfaces_based_on_zone_multipliers_test.rb +++ b/lib/measures/make_shading_surfaces_based_on_zone_multipliers/tests/make_shading_surfaces_based_on_zone_multipliers_test.rb @@ -36,7 +36,7 @@ require 'openstudio' require 'openstudio/measure/ShowRunnerOutput' require 'minitest/autorun' -require_relative '../measure.rb' +require_relative '../measure' require 'fileutils' class MakeShadingSurfacesBasedOnZoneMultipliersTest < MiniTest::Test @@ -55,7 +55,7 @@ def test_good_argument_values # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/1003_LargeOffice_5b_Pre 1980.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/1003_LargeOffice_5b_Pre 1980.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get @@ -93,7 +93,7 @@ def test_good_argument_values # assert(result.warnings.size == 0) # save the model to test output directory - output_file_path = OpenStudio::Path.new(File.dirname(__FILE__) + '/output/test_output.osm') + output_file_path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/output/test_output.osm") model.save(output_file_path, true) end end diff --git a/lib/measures/merge_floorspace_js_with_model/measure.rb b/lib/measures/merge_floorspace_js_with_model/measure.rb index 4bf9b862..32dde82b 100644 --- a/lib/measures/merge_floorspace_js_with_model/measure.rb +++ b/lib/measures/merge_floorspace_js_with_model/measure.rb @@ -143,12 +143,14 @@ def run(model, runner, user_arguments) fixed = false vertices.each do |vertex| next if fixed + if array.include?(vertex) # create a new set of vertices new_vertices = OpenStudio::Point3dVector.new array_b = [] surface.vertices.each do |vertex_b| next if array_b.include?(vertex_b) + new_vertices << vertex_b array_b << vertex_b end @@ -184,6 +186,7 @@ def run(model, runner, user_arguments) surfaces_b.each do |surface_b| next if surface_a == surface_b # dont' test against same surface + if surface_a.equalVertices(surface_b) runner.registerWarning("#{surface_a.name} and #{surface_b.name} in #{space.name} have duplicate geometry, removing #{surface_b.name}.") surface_b.remove @@ -221,7 +224,7 @@ def run(model, runner, user_arguments) json = JSON.parse(File.read(path.get.to_s)) # error checking - unless !json['space_types'].empty? + if json['space_types'].empty? runner.registerInfo('No space types were created.') end diff --git a/lib/measures/merge_floorspace_js_with_model/measure.xml b/lib/measures/merge_floorspace_js_with_model/measure.xml index 8375075a..ed1519d8 100644 --- a/lib/measures/merge_floorspace_js_with_model/measure.xml +++ b/lib/measures/merge_floorspace_js_with_model/measure.xml @@ -3,8 +3,8 @@ 3.0 merge_floorspace_js_with_model 16ef6369-6420-4f17-894c-a767895bcaa4 - cd8c6e2c-6e2b-45d3-a9a2-aaccb5dd38a9 - 20210423T142537Z + e9c8d42e-69b7-4d09-9cf8-9090ce62e4e2 + 20220505T182931Z 0AD1E2E2 MergeFloorspaceJsWithModel Merge FloorspaceJs with Model @@ -98,13 +98,13 @@ measure.rb rb script - B66DBC8C + 66A3D44B merge_floorspace_js_with_model_test.rb rb test - 33A937E8 + F51D04E3 diff --git a/lib/measures/merge_floorspace_js_with_model/tests/merge_floorspace_js_with_model_test.rb b/lib/measures/merge_floorspace_js_with_model/tests/merge_floorspace_js_with_model_test.rb index 7e688026..000f6af9 100644 --- a/lib/measures/merge_floorspace_js_with_model/tests/merge_floorspace_js_with_model_test.rb +++ b/lib/measures/merge_floorspace_js_with_model/tests/merge_floorspace_js_with_model_test.rb @@ -38,7 +38,7 @@ require 'openstudio' require 'openstudio/measure/ShowRunnerOutput' require 'minitest/autorun' -require_relative '../measure.rb' +require_relative '../measure' require 'fileutils' class MergeFloorspaceJsWithModelTest < Minitest::Test @@ -51,7 +51,7 @@ def test_good_argument_values # runner = OpenStudio::Measure::OSRunner.new(osw) # create an instance of a runner with OSW - osw_path = OpenStudio::Path.new(File.dirname(__FILE__) + '/measure_test.osw') + osw_path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/measure_test.osw") osw = OpenStudio::WorkflowJSON.load(osw_path).get runner = OpenStudio::Measure::OSRunner.new(osw) diff --git a/lib/measures/merge_spaces_from_external_file/measure.xml b/lib/measures/merge_spaces_from_external_file/measure.xml index 81404816..f4da8e30 100644 --- a/lib/measures/merge_spaces_from_external_file/measure.xml +++ b/lib/measures/merge_spaces_from_external_file/measure.xml @@ -3,8 +3,8 @@ 3.0 merge_spaces_from_external_file e439a1a9-d075-4a25-9f83-2dca79d2826e - d727f4c4-a1b5-485f-8ed0-984dc2083fc0 - 20210423T142538Z + 407db88d-c74e-4220-b538-cd528b293e2e + 20220505T182935Z D8922A73 MergeSpacesFromExternalFile Merge Spaces from External File @@ -238,7 +238,7 @@ merge_spaces_from_external_file_test.rb rb test - 9AAAEDBF + 2D93C8DF diff --git a/lib/measures/merge_spaces_from_external_file/tests/merge_spaces_from_external_file_test.rb b/lib/measures/merge_spaces_from_external_file/tests/merge_spaces_from_external_file_test.rb index 794cc478..ce4b193b 100644 --- a/lib/measures/merge_spaces_from_external_file/tests/merge_spaces_from_external_file_test.rb +++ b/lib/measures/merge_spaces_from_external_file/tests/merge_spaces_from_external_file_test.rb @@ -36,7 +36,7 @@ require 'openstudio' require 'openstudio/measure/ShowRunnerOutput' require 'minitest/autorun' -require_relative '../measure.rb' +require_relative '../measure' require 'fileutils' class MergeSpacesFromExternalFile_Test < MiniTest::Test @@ -47,13 +47,13 @@ def test_geo_loads_attributes measure = MergeSpacesFromExternalFile.new # create an instance of a runner with OSW - osw_path = OpenStudio::Path.new(File.dirname(__FILE__) + '/measure_test.osw') + osw_path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/measure_test.osw") osw = OpenStudio::WorkflowJSON.load(osw_path).get runner = OpenStudio::Measure::OSRunner.new(osw) # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/current_model_test.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/current_model_test.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get @@ -104,13 +104,13 @@ def test_geo measure = MergeSpacesFromExternalFile.new # create an instance of a runner with OSW - osw_path = OpenStudio::Path.new(File.dirname(__FILE__) + '/measure_test.osw') + osw_path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/measure_test.osw") osw = OpenStudio::WorkflowJSON.load(osw_path).get runner = OpenStudio::Measure::OSRunner.new(osw) # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/current_model_test.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/current_model_test.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get @@ -159,13 +159,13 @@ def test_loads_attributes measure = MergeSpacesFromExternalFile.new # create an instance of a runner with OSW - osw_path = OpenStudio::Path.new(File.dirname(__FILE__) + '/measure_test.osw') + osw_path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/measure_test.osw") osw = OpenStudio::WorkflowJSON.load(osw_path).get runner = OpenStudio::Measure::OSRunner.new(osw) # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/current_model_test.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/current_model_test.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get @@ -214,13 +214,13 @@ def test_none measure = MergeSpacesFromExternalFile.new # create an instance of a runner with OSW - osw_path = OpenStudio::Path.new(File.dirname(__FILE__) + '/measure_test.osw') + osw_path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/measure_test.osw") osw = OpenStudio::WorkflowJSON.load(osw_path).get runner = OpenStudio::Measure::OSRunner.new(osw) # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/current_model_test.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/current_model_test.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get diff --git a/lib/measures/radiance_measure/measure.rb b/lib/measures/radiance_measure/measure.rb index 28596d49..3831ba22 100644 --- a/lib/measures/radiance_measure/measure.rb +++ b/lib/measures/radiance_measure/measure.rb @@ -50,6 +50,7 @@ class Array def average raise 'Cannot average 0 items' if empty? + sum = inject(:+) (sum / size).to_f @@ -126,6 +127,7 @@ def read_illuminance_file(filename, runner) print_statement("Reading '#{filename}'", runner) raise "Could not find illuminance file #{filename}" unless File.exist?(filename) + File.read(filename).each_line do |line| data_section = true if line =~ /^\s?\d/ if data_section @@ -360,9 +362,10 @@ def which(cmd) coreCount = OpenStudio::System.numberOfProcessors sim_cores = '1' - if use_cores == 'Max' + case use_cores + when 'Max' sim_cores = coreCount - elsif use_cores == 'Min' + when 'Min' sim_cores = 1 else sim_cores = coreCount - 1 @@ -422,12 +425,12 @@ def which(cmd) perlpath = OpenStudio.getApplicationRunDirectory.parent_path / OpenStudio::Path.new('strawberry-perl-5.16.2.1-32bit-portable-reduced/perl/bin') end - print_statement('Adding path for local perl: ' + perlpath.to_s, runner) - ENV['PATH'] = path + ';' + ENV['PATH'] + ';' + perlpath.to_s - ENV['RAYPATH'] = path + ';' + raypath + ';.' + print_statement("Adding path for local perl: #{perlpath}", runner) + ENV['PATH'] = "#{path};#{ENV['PATH']};#{perlpath}" + ENV['RAYPATH'] = "#{path};#{raypath};." else - ENV['PATH'] = path + ':' + ENV['PATH'] - ENV['RAYPATH'] = path + ':' + raypath + ':.' + ENV['PATH'] = "#{path}:#{ENV['PATH']}" + ENV['RAYPATH'] = "#{path}:#{raypath}:." end end @@ -512,14 +515,10 @@ def which(cmd) print_statement('Running on Windows (sorry)', runner) if OS.windows && debug_mode print_statement('Running on unix', runner) if OS.unix && debug_mode - if !got_2x - - if Dir.glob(epw2weapath + programExtension).empty? - - runner.registerError("Cannot find epw2wea tool in radiance installation at '#{radiancePath}'. You may need to install a newer version of Radiance.") - exit false + if !got_2x && Dir.glob(epw2weapath + programExtension).empty? - end + runner.registerError("Cannot find epw2wea tool in radiance installation at '#{radiancePath}'. You may need to install a newer version of Radiance.") + exit false end @@ -738,7 +737,7 @@ def which(cmd) tempSettings = tempIO.split(' ') options_klemsDensity = "#{tempSettings[0]} #{tempSettings[1]}" options_skyvecDensity = tempSettings[3].split(':')[1] - options_tregVars = tempSettings[2..-1].join(' ') + options_tregVars = tempSettings[2..].join(' ') end File.open("#{radPath}/options/dmx.opt", 'r') do |file| @@ -777,11 +776,13 @@ def calculateDaylightCoeffecients(radPath, sim_cores, t_catCommand, options_treg windowGroupCheck = File.open('bsdf/mapping.rad') windowGroupCheck.each do |row| next if row[0] == '#' + wg = row.split(',')[0] - if wg == 'WG0' + case wg + when 'WG0' haveWG0 = 'True' - elsif wg == 'WG1' + when 'WG1' haveWG1 = 'True' end end @@ -804,6 +805,7 @@ def calculateDaylightCoeffecients(radPath, sim_cores, t_catCommand, options_treg windowMaps.each do |row| next if row[0] == '#' + wg = row.split(',')[0] rad_command = '' @@ -968,11 +970,13 @@ def runSimulation(t_space_names_to_calculate, t_sqlFile, t_simCores, t_options_s windowGroupCheck = File.open('bsdf/mapping.rad') windowGroupCheck.each do |row| next if row[0] == '#' + wg = row.split(',')[0] - if wg == 'WG0' + case wg + when 'WG0' haveWG0 = 'True' - elsif wg == 'WG1' + when 'WG1' haveWG1 = 'True' end end @@ -992,6 +996,7 @@ def runSimulation(t_space_names_to_calculate, t_sqlFile, t_simCores, t_options_s windowMaps.each do |row| # skip header next if row[0] == '#' + wg = row.split(',')[0] # do uncontrolled windows (WG0) @@ -1027,7 +1032,7 @@ def runSimulation(t_space_names_to_calculate, t_sqlFile, t_simCores, t_options_s else - wgXMLs = row.split(',')[4..-1] + wgXMLs = row.split(',')[4..] if wgXMLs.size > 2 print_statement("WARN: Window Group #{wg} has #{wgXMLs.size} BSDFs (2 max supported by OpenStudio application).", runner) end @@ -1071,6 +1076,7 @@ def runSimulation(t_space_names_to_calculate, t_sqlFile, t_simCores, t_options_s windowGroups = File.open('bsdf/mapping.rad') windowGroups.each do |wg| next if wg[0] == '#' # skip header + windowGroup = wg.split(',')[0] next if windowGroup == 'WG0' # skip unshaded windows @@ -1087,10 +1093,10 @@ def runSimulation(t_space_names_to_calculate, t_sqlFile, t_simCores, t_options_s wg_normal_z = wg_normal.split(' ')[2].to_f # DLM: hacktastic way to implement these options for now - if shadeControlType == 'AlwaysOn' + case shadeControlType + when 'AlwaysOn' shadeControlSetpoint = -1000 - elsif - shadeControlType == 'AlwaysOff' + when 'AlwaysOff' shadeControlSetpoint = 10000000000 end @@ -1129,7 +1135,7 @@ def runSimulation(t_space_names_to_calculate, t_sqlFile, t_simCores, t_options_s wgIllum = File.open("output/ts/m_#{windowGroup}.ill", 'w') wgShade = File.open("output/ts/#{windowGroup}.shd", 'w') header.each { |head| wgIllum.print head.to_s } - wgMerge.to_a.each { |array_ts| wgIllum.print " #{array_ts.join(' ')}\n" } # note leading space, for compatibility with default rfluxmtx output + wgMerge.to_a.each { |array_ts| wgIllum.print " #{array_ts.join(' ')}\n" } # NOTE: leading space, for compatibility with default rfluxmtx output wgShadeSchedule.each { |sh| wgShade.print sh.to_s } wgIllum.close wgShade.close @@ -1177,7 +1183,7 @@ def runSimulation(t_space_names_to_calculate, t_sqlFile, t_simCores, t_options_s print_statement("Starting final building illumimance file with #{mergeWindows[0]}...", runner) exec_statement("rmtxop -fa #{mergeWindows[0]} -t > output/final_merge.tmp", runner) # add remaining groups, one at a time - mergeWindows[1..-1].each do |merge| + mergeWindows[1..].each do |merge| print_statement("adding #{merge}...", runner) temp_fname = rand(36**15).to_s(36) while merge_count > 1 @@ -1416,7 +1422,7 @@ def writeTimeSeriesToSql(sqlfile, simDateTimes, illum, space_name, ts_name, ts_u illum.length.times do |n| data[n] = illum[n].to_f rescue Exception => e - print_statement('Error inserting data: ' + illum[n] + ' inserting 0 instead', runner) + print_statement("Error inserting data: #{illum[n]} inserting 0 instead", runner) data[n] = 0 end @@ -1438,7 +1444,7 @@ def annualSimulation(t_sqlFile, t_epwFile, t_space_names_to_calculate, t_radMaps # for each environment period (design days, annual, or arbitrary) you will create a directory for results t_sqlFile.availableEnvPeriods.each do |envPeriod| - print_statement("envPeriod = '" + envPeriod.to_s + "'", runner) + print_statement("envPeriod = '#{envPeriod}'", runner) diffHorizIllumAll, dirNormIllumAll, diffEfficacyAll, dirNormEfficacyAll, solarAltitudeAll, solarAzimuthAll, diffHorizUnits, dirNormUnits = getTimeSeries(t_sqlFile, envPeriod) @@ -1493,16 +1499,14 @@ def annualSimulation(t_sqlFile, t_epwFile, t_space_names_to_calculate, t_radMaps # Debug # File.open('glareSensorValues.out', 'w') { |f| f.write(glareSensorValues.to_s) } - timeSeriesIllum[i] = tsDateTime.to_s.tr(' ', ',') + ',' + "#{dirNormIllum[i]},#{diffHorizIllum[i]}," + illumSensorValues.join(',') + ',' + illumValues.join(',') + timeSeriesIllum[i] = "#{tsDateTime.to_s.tr(' ', ',')},#{dirNormIllum[i]},#{diffHorizIllum[i]},#{illumSensorValues.join(',')},#{illumValues.join(',')}" # add glare sensor values - if t_radGlareSensorViews[space_name] - if !glareSensorValues.nil? - timeSeriesGlare[i] = tsDateTime.to_s.tr(' ', ',') - glareSensorValues.each_key do |key| - glare_values = glareSensorValues[key].map { |_, v| v['dgp'] } - timeSeriesGlare[i] += ",#{key},#{glare_values.average.round(2)},#{glare_values.min.round(2)},#{glare_values.max.round(2)},raw,#{glare_values.join(',')}" - end + if t_radGlareSensorViews[space_name] && !glareSensorValues.nil? + timeSeriesGlare[i] = tsDateTime.to_s.tr(' ', ',') + glareSensorValues.each_key do |key| + glare_values = glareSensorValues[key].map { |_, v| v['dgp'] } + timeSeriesGlare[i] += ",#{key},#{glare_values.average.round(2)},#{glare_values.min.round(2)},#{glare_values.max.round(2)},raw,#{glare_values.join(',')}" end end @@ -1634,7 +1638,7 @@ def annualSimulation(t_sqlFile, t_epwFile, t_space_names_to_calculate, t_radMaps ys << ymin + (n * ySpacing) end - sqlOutFile.insertIlluminanceMap(space_name, space_name + ' DAYLIGHT MAP', t_epwFile.wmoNumber, + sqlOutFile.insertIlluminanceMap(space_name, "#{space_name} DAYLIGHT MAP", t_epwFile.wmoNumber, simDateTimes, xs, ys, map.originZCoordinate, illuminanceMatrixMaps) @@ -1755,8 +1759,8 @@ def makeSchedules(model, sqlFile, runner) daylightSetpoint = secondaryDaylightingControl.get.illuminanceSetpoint else print_statement("Ignoring secondary daylighting control in ThermalZone '#{thermalZone.name}'", runner) + end end - end if daylightSetpoint == 0.0 space.daylightingControls.each do |i| @@ -1809,7 +1813,7 @@ def makeSchedules(model, sqlFile, runner) schedule = schedule.get - schedule.setName(thermalZone.name.get + ' Lights Schedule') + schedule.setName("#{thermalZone.name.get} Lights Schedule") # remove all lights in this zone spaces.each do |space| @@ -1872,6 +1876,7 @@ def daylightMetrics(model, sqlFile, runner) thermalZone = space.thermalZone next if thermalZone.empty? + thermalZone = thermalZone.get map_name = "#{space_name} DAYLIGHT MAP" @@ -1949,7 +1954,8 @@ def daylightMetrics(model, sqlFile, runner) da = 0 - if $METHOD == 0 + case $METHOD + when 0 # get map values map_values = radoutFile.illuminanceMap(hourly_report_index) @@ -1968,9 +1974,9 @@ def daylightMetrics(model, sqlFile, runner) end end - da = num_da.to_f / num.to_f + da = num_da.to_f / num - elsif $METHOD == 1 + when 1 x = OpenStudio::DoubleVector.new y = OpenStudio::DoubleVector.new @@ -2000,10 +2006,10 @@ def daylightMetrics(model, sqlFile, runner) end end - da = num_da.to_f / num.to_f - cda = num_cda.to_f / num.to_f - udi = num_udi.to_f / num.to_f - sda = num_sda.to_f / num.to_f + da = num_da.to_f / num + cda = num_cda.to_f / num + udi = num_udi.to_f / num + sda = num_sda.to_f / num end @@ -2042,7 +2048,7 @@ def daylightMetrics(model, sqlFile, runner) da_daylit_num += 1 end end - annual_da_daylit = da_daylit_sum.to_f / da_daylit_num.to_f + annual_da_daylit = da_daylit_sum.to_f / da_daylit_num summary_report += "#{space_name},DA(#{daylightSetpoint.round(0)}),Daylit Hours,#{annual_da_daylit.round(2)},#{da_daylit_sum.round(0)},#{da_daylit_num}\n" if !peopleTimeseries.empty? da_occupied_sum = 0 @@ -2054,7 +2060,7 @@ def daylightMetrics(model, sqlFile, runner) end end # annual_da_occupied = (da_occupied_num == 0.0 || da_occupied_sum == 0.0) ? 0.0 : da_occupied_sum.to_f / da_occupied_num.to_f - annual_da_occupied = da_occupied_sum.to_f / da_occupied_num.to_f + annual_da_occupied = da_occupied_sum.to_f / da_occupied_num summary_report += "#{space_name},DA(#{daylightSetpoint.round(0)}),Occupied Hours,#{annual_da_occupied.round(2)},#{da_occupied_sum.round(0)},#{da_occupied_num}\n" da_daylit_occupied_sum = 0 @@ -2066,7 +2072,7 @@ def daylightMetrics(model, sqlFile, runner) end end # annual_da_daylit_occupied = (da_daylit_occupied_num == 0.0 || da_daylit_occupied_sum == 0.0) ? 0.0 : da_daylit_occupied_sum.to_f / da_daylit_occupied_num.to_f - annual_da_daylit_occupied = da_daylit_occupied_sum.to_f / da_daylit_occupied_num.to_f + annual_da_daylit_occupied = da_daylit_occupied_sum.to_f / da_daylit_occupied_num summary_report += "#{space_name},DA(#{daylightSetpoint.round(0)}),Daylit and Occupied Hours,#{annual_da_daylit_occupied.round(2)},#{da_daylit_occupied_sum.round(0)},#{da_daylit_occupied_num}\n" end @@ -2079,7 +2085,7 @@ def daylightMetrics(model, sqlFile, runner) cda_daylit_num += 1 end end - annual_cda_daylit = cda_daylit_sum.to_f / cda_daylit_num.to_f + annual_cda_daylit = cda_daylit_sum.to_f / cda_daylit_num summary_report += "#{space_name},conDA(#{daylightSetpoint.round(0)}),Daylit Hours,#{annual_cda_daylit.round(2)},#{cda_daylit_sum.round(0)},#{cda_daylit_num}\n" if !peopleTimeseries.empty? @@ -2091,7 +2097,7 @@ def daylightMetrics(model, sqlFile, runner) cda_occupied_num += 1 end end - annual_cda_occupied = cda_occupied_sum.to_f / cda_occupied_num.to_f + annual_cda_occupied = cda_occupied_sum.to_f / cda_occupied_num summary_report += "#{space_name},conDA(#{daylightSetpoint.round(0)}),Occupied Hours,#{annual_cda_occupied.round(2)},#{cda_occupied_sum.round(0)},#{cda_occupied_num}\n" cda_daylit_occupied_sum = 0 @@ -2102,7 +2108,7 @@ def daylightMetrics(model, sqlFile, runner) cda_daylit_occupied_num += 1 end end - annual_cda_daylit_occupied = cda_daylit_occupied_sum.to_f / cda_daylit_occupied_num.to_f + annual_cda_daylit_occupied = cda_daylit_occupied_sum.to_f / cda_daylit_occupied_num summary_report += "#{space_name},conDA(#{daylightSetpoint.round(0)}),Daylit and Occupied Hours,#{annual_cda_daylit_occupied.round(2)},#{cda_daylit_occupied_sum.round(0)},#{cda_daylit_occupied_num}\n" end @@ -2115,7 +2121,7 @@ def daylightMetrics(model, sqlFile, runner) udi_daylit_num += 1 end end - annual_udi_daylit = udi_daylit_sum.to_f / udi_daylit_num.to_f + annual_udi_daylit = udi_daylit_sum.to_f / udi_daylit_num summary_report += "#{space_name},UDI(100-3000),Daylit Hours,#{annual_udi_daylit.round(2)},#{udi_daylit_sum.round(0)},#{udi_daylit_num}\n" if !peopleTimeseries.empty? udi_occupied_sum = 0 @@ -2126,7 +2132,7 @@ def daylightMetrics(model, sqlFile, runner) udi_occupied_num += 1 end end - annual_udi_occupied = udi_occupied_sum.to_f / udi_occupied_num.to_f + annual_udi_occupied = udi_occupied_sum.to_f / udi_occupied_num summary_report += "#{space_name},UDI(100-3000),Occupied Hours,#{annual_udi_occupied.round(2)},#{udi_occupied_sum.round(0)},#{udi_occupied_num}\n" udi_daylit_occupied_sum = 0 @@ -2137,7 +2143,7 @@ def daylightMetrics(model, sqlFile, runner) udi_daylit_occupied_num += 1 end end - annual_udi_daylit_occupied = udi_daylit_occupied_sum.to_f / udi_daylit_occupied_num.to_f + annual_udi_daylit_occupied = udi_daylit_occupied_sum.to_f / udi_daylit_occupied_num summary_report += "#{space_name},UDI(100-3000),Daylit and Occupied Hours,#{annual_udi_daylit_occupied.round(2)},#{cda_daylit_occupied_sum.round(0)},#{cda_daylit_occupied_num}\n" end @@ -2150,7 +2156,7 @@ def daylightMetrics(model, sqlFile, runner) sda_num += 1 end end - annual_sda = sda_sum.to_f / sda_num.to_f + annual_sda = sda_sum.to_f / sda_num summary_report += "#{space_name},sDA(300),8AM-5PM (10 hours/day per IESNA LM-83-12),#{annual_sda.round(2)},#{sda_sum.round(0)},#{sda_num}\n" # Make building average metrics diff --git a/lib/measures/radiance_measure/measure.xml b/lib/measures/radiance_measure/measure.xml index aef08e0b..6f148364 100644 --- a/lib/measures/radiance_measure/measure.xml +++ b/lib/measures/radiance_measure/measure.xml @@ -3,8 +3,8 @@ 3.0 radiance_measure 1e3cfef8-b051-4e60-8bb0-ed2d29d4f45f - 8f5a752a-5020-460d-b6b8-5cb7fe90e688 - 20210423T142538Z + 9b2fd6b5-9767-4a55-9b61-eb663567509b + 20220505T182929Z 381B7733 RadianceMeasure Radiance Daylighting Measure @@ -193,13 +193,13 @@ measure.rb rb script - 6EB721A1 + FD74EFB9 radiance_measure_test.rb rb test - 7CDD7A50 + AAD3F5F1 diff --git a/lib/measures/radiance_measure/tests/radiance_measure_test.rb b/lib/measures/radiance_measure/tests/radiance_measure_test.rb index 4dd1266b..a1b51359 100644 --- a/lib/measures/radiance_measure/tests/radiance_measure_test.rb +++ b/lib/measures/radiance_measure/tests/radiance_measure_test.rb @@ -37,7 +37,7 @@ require 'openstudio/measure/ShowRunnerOutput' require 'fileutils' -require_relative '../measure.rb' +require_relative '../measure' require 'minitest/autorun' class RadianceMeasureTest < Minitest::Test @@ -49,25 +49,26 @@ class RadianceMeasureTest < Minitest::Test def get_test_model(shade_type) translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/measure_test_model.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/measure_test_model.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get new_shade_control = nil - if shade_type == 'Default' + case shade_type + when 'Default' # do nothing, use model as is - elsif shade_type == 'None' + when 'None' # remove shading controls model.getShadingControls.each(&:remove) - elsif shade_type == 'Blind' + when 'Blind' new_shade_control = OpenStudio::Model::ShadingControl.new(OpenStudio::Model::Blind.new(model)) - elsif shade_type == 'DaylightRedirectionDevice' + when 'DaylightRedirectionDevice' new_shade_control = OpenStudio::Model::ShadingControl.new(OpenStudio::Model::DaylightRedirectionDevice.new(model)) - elsif shade_type == 'Screen' + when 'Screen' new_shade_control = OpenStudio::Model::ShadingControl.new(OpenStudio::Model::Screen.new(model)) - elsif shade_type == 'Shade' + when 'Shade' new_shade_control = OpenStudio::Model::ShadingControl.new(OpenStudio::Model::Shade.new(model)) end @@ -95,7 +96,7 @@ def run_with_test_model(shade_type, user_args = {}) # set up runner, this will happen automatically when measure is run in PAT - runner.setLastEpwFilePath(File.dirname(__FILE__) + '/USA_CO_Golden-NREL.724666_TMY3.epw') + runner.setLastEpwFilePath("#{File.dirname(__FILE__)}/USA_CO_Golden-NREL.724666_TMY3.epw") # load the test model model = get_test_model(shade_type) diff --git a/lib/measures/radiant_slab_with_doas/measure.rb b/lib/measures/radiant_slab_with_doas/measure.rb index 7e9515a1..a5e05978 100644 --- a/lib/measures/radiant_slab_with_doas/measure.rb +++ b/lib/measures/radiant_slab_with_doas/measure.rb @@ -221,7 +221,7 @@ def run(model, runner, user_arguments) if remove_existing_hvac runner.registerInfo('Removing existing HVAC systems from the model') if std.respond_to?('remove_HVAC') - std.remove_HVAC(model) #OpenStuido 3.2.1 and earlierop use this, future versions will use snake_case method + std.remove_HVAC(model) # OpenStuido 3.2.1 and earlierop use this, future versions will use snake_case method else std.remove_hvac(model) end @@ -232,6 +232,7 @@ def run(model, runner, user_arguments) model.getThermalZones.each do |zone| next if std.thermal_zone_plenum?(zone) next if !std.thermal_zone_heated?(zone) && !std.thermal_zone_cooled?(zone) + conditioned_zones << zone end @@ -386,8 +387,10 @@ def run(model, runner, user_arguments) next if radiant_type == 'floor' && surface.surfaceType != 'Floor' next if radiant_type == 'ceiling' && surface.surfaceType != 'RoofCeiling' next unless surface.space.is_initialized + surface_space_name = surface.space.get.name.to_s next unless conditioned_space_names.include? surface_space_name + var = OpenStudio::Model::OutputVariable.new('Surface Inside Face Temperature', model) var.setKeyValue(surface.name.to_s) vars << var diff --git a/lib/measures/radiant_slab_with_doas/measure.xml b/lib/measures/radiant_slab_with_doas/measure.xml index 0cea6988..4fbc3110 100644 --- a/lib/measures/radiant_slab_with_doas/measure.xml +++ b/lib/measures/radiant_slab_with_doas/measure.xml @@ -3,8 +3,8 @@ 3.0 radiant_slab_with_doas 8091a0c3-7760-4da6-adf4-133d55872816 - 04a7b943-a909-4dc9-a06a-d6f28b819be0 - 20210723T213422Z + 764afd7f-f6e7-4e73-bc92-1230e49b2145 + 20220505T182927Z C49A7DAB RadiantSlabWithDoas Radiant Slab with DOAS @@ -329,7 +329,7 @@ To reduce unmet hours, use an expanded comfort range as mentioned above, remove radiant_slab_with_doas_test.rb rb test - 7C1AC4AE + 2317B466 @@ -340,7 +340,7 @@ To reduce unmet hours, use an expanded comfort range as mentioned above, remove measure.rb rb script - 41F3702A + 12177EE8 diff --git a/lib/measures/radiant_slab_with_doas/tests/radiant_slab_with_doas_test.rb b/lib/measures/radiant_slab_with_doas/tests/radiant_slab_with_doas_test.rb index 5d6ba3c1..9817e760 100644 --- a/lib/measures/radiant_slab_with_doas/tests/radiant_slab_with_doas_test.rb +++ b/lib/measures/radiant_slab_with_doas/tests/radiant_slab_with_doas_test.rb @@ -36,7 +36,7 @@ require 'openstudio' require 'openstudio/measure/ShowRunnerOutput' require 'minitest/autorun' -require_relative '../measure.rb' +require_relative '../measure' require 'fileutils' class RadiantSlabWithDoasTest < Minitest::Test @@ -189,8 +189,8 @@ def test_single_zone_office_5A_floor # this tests adding a fancoils with doas system to the model test_name = 'test_single_zone_office_5A_floor' puts "\n######\nTEST: #{test_name}\n######\n" - osm_path = File.dirname(__FILE__) + '/single_zone_office_5A.osm' - epw_path = File.dirname(__FILE__) + '/USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw' + osm_path = "#{File.dirname(__FILE__)}/single_zone_office_5A.osm" + epw_path = "#{File.dirname(__FILE__)}/USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw" # create an instance of the measure measure = RadiantSlabWithDoas.new @@ -213,8 +213,8 @@ def test_single_zone_office_5A_ceiling # this tests adding a fancoils with doas system to the model test_name = 'test_single_zone_office_5A_ceiling' puts "\n######\nTEST: #{test_name}\n######\n" - osm_path = File.dirname(__FILE__) + '/single_zone_office_5A.osm' - epw_path = File.dirname(__FILE__) + '/USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw' + osm_path = "#{File.dirname(__FILE__)}/single_zone_office_5A.osm" + epw_path = "#{File.dirname(__FILE__)}/USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw" # create an instance of the measure measure = RadiantSlabWithDoas.new @@ -242,8 +242,8 @@ def test_multi_zone_office_3C_floor # this tests adding a fancoils with doas system to the model test_name = 'test_multi_zone_office_3C_floor' puts "\n######\nTEST: #{test_name}\n######\n" - osm_path = File.dirname(__FILE__) + '/multi_zone_office_3C.osm' - epw_path = File.dirname(__FILE__) + '/USA_CA_San.Francisco.Intl.AP.724940_TMY3.epw' + osm_path = "#{File.dirname(__FILE__)}/multi_zone_office_3C.osm" + epw_path = "#{File.dirname(__FILE__)}/USA_CA_San.Francisco.Intl.AP.724940_TMY3.epw" # create an instance of the measure measure = RadiantSlabWithDoas.new @@ -266,8 +266,8 @@ def test_multi_zone_office_3C_ceiling # this tests adding a fancoils with doas system to the model test_name = 'test_multi_zone_office_3C_ceiling' puts "\n######\nTEST: #{test_name}\n######\n" - osm_path = File.dirname(__FILE__) + '/multi_zone_office_3C.osm' - epw_path = File.dirname(__FILE__) + '/USA_CA_San.Francisco.Intl.AP.724940_TMY3.epw' + osm_path = "#{File.dirname(__FILE__)}/multi_zone_office_3C.osm" + epw_path = "#{File.dirname(__FILE__)}/USA_CA_San.Francisco.Intl.AP.724940_TMY3.epw" # create an instance of the measure measure = RadiantSlabWithDoas.new diff --git a/lib/measures/replace_geometry_by_story/measure.rb b/lib/measures/replace_geometry_by_story/measure.rb index 30433e96..3cc3c71a 100644 --- a/lib/measures/replace_geometry_by_story/measure.rb +++ b/lib/measures/replace_geometry_by_story/measure.rb @@ -83,6 +83,7 @@ def run(model, runner, user_arguments) story_hash = {} model.getBuildingStorys.each do |story| next if !story.spaces.first.spaceType.is_initialized + story_hash[story] = {} story_hash[story][:space_type] = story.spaces.first.spaceType.get @@ -198,6 +199,7 @@ def run(model, runner, user_arguments) if hash[:basement] space.surfaces.each do |surface| next if surface.surfaceType != 'Wall' + surface.setOutsideBoundaryCondition('Ground') end end @@ -214,6 +216,7 @@ def run(model, runner, user_arguments) space.surfaces.each do |surface| next if surface.outsideBoundaryCondition != 'Outdoors' next if surface.surfaceType != 'Wall' + surface.setWindowToWallRatio(target_wwr) end end @@ -222,6 +225,7 @@ def run(model, runner, user_arguments) zone_hash = {} # key is zone value is floor area. It excludes zones with non 1 multiplier model.getThermalZones.each do |thermal_zone| next if thermal_zone.multiplier > 1 + zone_hash[thermal_zone] = thermal_zone.floorArea end target_zone = zone_hash.key(zone_hash.values.max) diff --git a/lib/measures/replace_geometry_by_story/measure.xml b/lib/measures/replace_geometry_by_story/measure.xml index a8b7e88d..311c39d4 100644 --- a/lib/measures/replace_geometry_by_story/measure.xml +++ b/lib/measures/replace_geometry_by_story/measure.xml @@ -3,8 +3,8 @@ 3.0 replace_geometry_by_story 03b18912-0ceb-47e9-8f8b-417a3008e189 - 00a0fde1-875a-470c-9754-7dac5123f162 - 20210423T142539Z + 0c043052-fbe4-4cb6-809b-4659f265a0dd + 20220505T182928Z 2AF3A68E ReplaceGeometryByStory Replace Geometry By Story @@ -72,13 +72,13 @@ measure.rb rb script - 41CF21B6 + 7478785A replace_geometry_by_story_test.rb rb test - 5724D925 + DC2F0000 diff --git a/lib/measures/replace_geometry_by_story/tests/replace_geometry_by_story_test.rb b/lib/measures/replace_geometry_by_story/tests/replace_geometry_by_story_test.rb index 56341847..6dd39abf 100644 --- a/lib/measures/replace_geometry_by_story/tests/replace_geometry_by_story_test.rb +++ b/lib/measures/replace_geometry_by_story/tests/replace_geometry_by_story_test.rb @@ -36,7 +36,7 @@ require 'openstudio' require 'openstudio/measure/ShowRunnerOutput' require 'minitest/autorun' -require_relative '../measure.rb' +require_relative '../measure' require 'fileutils' class ReplaceGeometryByStory_Test < MiniTest::Test @@ -49,7 +49,7 @@ def test_good_argument_values # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/mixed_hotel_rest_by_story_test_output.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/mixed_hotel_rest_by_story_test_output.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get @@ -86,7 +86,7 @@ def test_good_argument_values # assert(result.warnings.size == 0) # save the model to test output directory - output_file_path = OpenStudio::Path.new(File.dirname(__FILE__) + '/output/test_output.osm') + output_file_path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/output/test_output.osm") model.save(output_file_path, true) end end diff --git a/lib/measures/scale_geometry/measure.xml b/lib/measures/scale_geometry/measure.xml index 1e82c5ba..1a6f75a0 100644 --- a/lib/measures/scale_geometry/measure.xml +++ b/lib/measures/scale_geometry/measure.xml @@ -3,8 +3,8 @@ 3.0 scale_geometry f9cc2ffc-2838-4a18-8330-97e7cc94cdf8 - 1d87e96f-e6a1-4f0d-a214-43af7f49ed48 - 20210423T142539Z + ea83673c-44b7-4fa4-90f4-f26a9ebf52bb + 20220505T182930Z 7AD75066 ScaleGeometry scale_geometry @@ -116,7 +116,7 @@ scale_geometry_test.rb rb test - 4689D94C + 5A612286 diff --git a/lib/measures/scale_geometry/tests/scale_geometry_test.rb b/lib/measures/scale_geometry/tests/scale_geometry_test.rb index 416c8a1e..2c741c7a 100644 --- a/lib/measures/scale_geometry/tests/scale_geometry_test.rb +++ b/lib/measures/scale_geometry/tests/scale_geometry_test.rb @@ -36,7 +36,7 @@ require 'openstudio' require 'openstudio/measure/ShowRunnerOutput' require 'minitest/autorun' -require_relative '../measure.rb' +require_relative '../measure' require 'fileutils' class ScaleGeometryTest < MiniTest::Test @@ -70,7 +70,7 @@ def test_unit_scale # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/example_model.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/example_model.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get @@ -127,7 +127,7 @@ def test_unit_scale assert_equal((1.0 * 1.0 * 1.0 * original_volume).round(4), volume.round(4)) # save the model to test output directory - output_file_path = OpenStudio::Path.new(File.dirname(__FILE__) + '/output/test_unit_scale.osm') + output_file_path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/output/test_unit_scale.osm") model.save(output_file_path, true) end @@ -140,7 +140,7 @@ def test_1_1_scale # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/example_model.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/example_model.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get @@ -197,7 +197,7 @@ def test_1_1_scale assert_equal((1.1 * 1.1 * 1.1 * original_volume).round(4), volume.round(4)) # save the model to test output directory - output_file_path = OpenStudio::Path.new(File.dirname(__FILE__) + '/output/test_1_1_scale.osm') + output_file_path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/output/test_1_1_scale.osm") model.save(output_file_path, true) end @@ -210,7 +210,7 @@ def test_0_9_scale # load the test model translator = OpenStudio::OSVersion::VersionTranslator.new - path = OpenStudio::Path.new(File.dirname(__FILE__) + '/example_model.osm') + path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/example_model.osm") model = translator.loadModel(path) assert(!model.empty?) model = model.get @@ -267,7 +267,7 @@ def test_0_9_scale assert_equal((0.9 * 0.9 * 0.9 * original_volume).round(4), volume.round(4)) # save the model to test output directory - output_file_path = OpenStudio::Path.new(File.dirname(__FILE__) + '/output/test_0_9_scale.osm') + output_file_path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/output/test_0_9_scale.osm") model.save(output_file_path, true) end end