honeybee-openstudio 2.11.2 → 2.11.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: eec777c55c46672221db832c742d2a955ca1200c43e35c855e0289ac4bc6af27
4
- data.tar.gz: 6783b0d04418ec184d8674be1fb50d8a53317d0a3d7229a0877af660830d519c
3
+ metadata.gz: 66f698f2ff00e7c8a4461f4b8595e4d6939c0aadba9b03469a00db5647d15761
4
+ data.tar.gz: e52a3be101d446f90e0d9bcacd705c961a73d62951addbb7e1a9a1d9dea17005
5
5
  SHA512:
6
- metadata.gz: 78b9c9deaabcec5f6d05029fe99e316675b7adbe71047b97f6b2c4d683b2e85a9aaa840935cf693749043049f05b95c1279d26353dabe178ee2fa0d03cfe7fd2
7
- data.tar.gz: f182b669168d1bb24029e2781678f41187fe6a37eb1d95ef400ecd668e0c958ebbcd44db080910e7f043ea217d4beb99c69086fc18b83ab2195bf9dfdab0855a
6
+ metadata.gz: 246fee05105a6507b52468852dad7cccb8a0bf93a5ad866d382f67bf6f5e40ee3a7537cf8780509957e5c1b7a3da520e71160b467d497a3345f5624b901b3c87
7
+ data.tar.gz: 4719f21f7ed1b5e74ff1f213a656d0dff3a6ea3f4a816012eafd09c6e85fa164bd22cda5c971c63d38dcc755f9f592d3b887f246d362be5e1b38b7bae4a6b7c1
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = 'honeybee-openstudio'
7
- spec.version = '2.11.2'
7
+ spec.version = '2.11.3'
8
8
  spec.authors = ['Tanushree Charan', 'Dan Macumber', 'Chris Mackey', 'Mostapha Sadeghipour Roudsari']
9
9
  spec.email = ['tanushree.charan@nrel.gov', 'chris@ladybug.tools']
10
10
 
@@ -42,25 +42,34 @@ module URBANopt
42
42
  # class level variables
43
43
  @@instance_lock = Mutex.new
44
44
  @@osw = nil
45
+ @@mapper_measures = nil
45
46
  @@geometry = nil
46
47
 
47
48
  def initialize()
48
-
49
49
  # do initialization of class variables in thread safe way
50
50
  @@instance_lock.synchronize do
51
- if @@osw.nil?
51
+ # load the OSW for this class
52
+ if @@osw.nil?
53
+ osw_path = File.join(File.dirname(__FILE__), 'honeybee_workflow.osw')
54
+ File.open(osw_path, 'r') do |file|
55
+ @@osw = JSON.parse(file.read, symbolize_names: true)
56
+ end
57
+ # configure OSW with extension gem paths for measures and files
58
+ # all extension gems must be required before this line
59
+ @@osw = OpenStudio::Extension.configure_osw(@@osw)
60
+ end
52
61
 
53
- # load the OSW for this class
54
- osw_path = File.join(File.dirname(__FILE__), 'honeybee_workflow.osw')
55
- File.open(osw_path, 'r') do |file|
56
- @@osw = JSON.parse(file.read, symbolize_names: true)
62
+ # load the mapper measure variables if the file exists
63
+ if @@mapper_measures.nil?
64
+ map_meas_path = File.join(File.dirname(__FILE__), 'mapper_measures.json')
65
+ if File.file?(map_meas_path)
66
+ File.open(map_meas_path, 'r') do |file|
67
+ @@mapper_measures = JSON.parse(file.read)
57
68
  end
58
-
59
- # configure OSW with extension gem paths for measures and files
60
- # all extension gems must be required before this line
61
- @@osw = OpenStudio::Extension.configure_osw(@@osw)
62
69
  end
63
70
  end
71
+
72
+ end
64
73
  end
65
74
 
66
75
  def create_osw(scenario, features, feature_names)
@@ -76,7 +85,6 @@ module URBANopt
76
85
  # take the centroid of the vertices as the location of the building
77
86
  feature_vertices_coordinates = feature.feature_json[:geometry][:coordinates][0]
78
87
  feature_location = feature.find_feature_center(feature_vertices_coordinates).to_s
79
-
80
88
  if feature_names.size == 1
81
89
  feature_name = feature_names[0]
82
90
  end
@@ -93,12 +101,15 @@ module URBANopt
93
101
  OpenStudio::Extension.set_measure_argument(
94
102
  osw, 'from_honeybee_model', 'model_json', feature.detailed_model_filename)
95
103
 
96
- # check if there is a HVAC key in the feature JSON properties
97
- building_hash = feature.to_hash
98
- if building_hash.key?(:system_type)
99
- # assume the typical building measure is in the OSW and add the system type
100
- OpenStudio::Extension.set_measure_argument(
101
- osw, 'create_typical_building_from_model', 'system_type', system_type)
104
+ # add any of the mapper measure variables
105
+ if not @@mapper_measures.nil?
106
+ @@mapper_measures.each do |map_measure_param|
107
+ # get the attribute from the feature
108
+ feature_param = feature.send(map_measure_param[2])
109
+ # set the measure argument
110
+ OpenStudio::Extension.set_measure_argument(
111
+ osw, map_measure_param[0], map_measure_param[1], feature_param)
112
+ end
102
113
  end
103
114
 
104
115
  # add the feature id and name to the reporting measure
@@ -29,4 +29,4 @@ else
29
29
  end
30
30
 
31
31
  # include the honeybee-openstudio-gem
32
- gem 'honeybee-openstudio', '2.11.1'
32
+ gem 'honeybee-openstudio', '2.11.3'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: honeybee-openstudio
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.11.2
4
+ version: 2.11.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tanushree Charan
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: exe
13
13
  cert_chain: []
14
- date: 2021-01-27 00:00:00.000000000 Z
14
+ date: 2021-02-08 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler