From cc79f28d99e9b349ab372f7d14b618fd56b8b191 Mon Sep 17 00:00:00 2001
From: Matthew Dahlhausen <matthew.dahlhausen@gmail.com>
Date: Tue, 14 May 2024 11:41:20 -0600
Subject: [PATCH] fix deer lookup for simple glazing

add a valid lookup for deer simple glazing constructions
include properties in name for name parsing
---
 .../deer/data/deer.constructions.json         |  8 +++----
 .../create_typical/test_create_typical.rb     | 22 +++++++++++++++++++
 2 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/lib/openstudio-standards/standards/deer/data/deer.constructions.json b/lib/openstudio-standards/standards/deer/data/deer.constructions.json
index 7ca227541b..a276bffec7 100644
--- a/lib/openstudio-standards/standards/deer/data/deer.constructions.json
+++ b/lib/openstudio-standards/standards/deer/data/deer.constructions.json
@@ -344,20 +344,20 @@
       "name": "DEER Metal Framed Window",
       "intended_surface_type": "ExteriorWindow",
       "standards_construction_type": "Nonmetal framing (all)",
-      "insulation_layer": "Simple Glazing",
+      "insulation_layer": null,
       "skylight_framing": null,
       "materials": [
-        "Simple Glazing"
+        "Simple Glazing U 1.23 SHGC 0.61 VT 0.25"
       ]
     },
     {
       "name": "DEER Skylight",
       "intended_surface_type": "ExteriorWindow",
       "standards_construction_type": "Nonmetal framing (all)",
-      "insulation_layer": "Simple Glazing",
+      "insulation_layer": null,
       "skylight_framing": null,
       "materials": [
-        "Simple Glazing"
+        "Simple Glazing U 1.23 SHGC 0.61 VT 0.25"
       ]
     },
     {
diff --git a/test/modules/create_typical/test_create_typical.rb b/test/modules/create_typical/test_create_typical.rb
index 77762bb0c9..c95ae46c71 100644
--- a/test/modules/create_typical/test_create_typical.rb
+++ b/test/modules/create_typical/test_create_typical.rb
@@ -27,6 +27,28 @@ def test_create_typical_building_from_model
     assert(starting_size < ending_size)
   end
 
+  def test_create_typical_deer_building_from_model
+    # load model and set up weather file
+    template = 'DEER Pre-1975'
+    climate_zone = 'CEC T24-CEC3'
+    std = Standard.build(template)
+    model = std.safe_load_model("#{File.dirname(__FILE__)}/../../../data/geometry/DEER_ESe.osm")
+    OpenstudioStandards::Weather.model_set_building_location(model, climate_zone: climate_zone)
+
+    # set output directory
+    output_dir = "#{__dir__}/output"
+    FileUtils.mkdir output_dir unless Dir.exist? output_dir
+
+    # apply create typical
+    starting_size = model.getModelObjects.size
+    result = @create.create_typical_building_from_model(model, template,
+                                                        climate_zone: climate_zone,
+                                                        sizing_run_directory: output_dir)
+    ending_size = model.getModelObjects.size
+    assert(result)
+    assert(starting_size < ending_size)
+  end
+
   def test_create_space_types_and_constructions
     model = OpenStudio::Model::Model.new
     building_type = 'PrimarySchool'