bcl 0.5.7.pre → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
data/lib/bcl/core_ext.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  ######################################################################
2
- # Copyright (c) 2008-2014, Alliance for Sustainable Energy.
2
+ # Copyright (c) 2008-2021, Alliance for Sustainable Energy.
3
3
  # All rights reserved.
4
4
  #
5
5
  # This library is free software; you can redistribute it and/or
@@ -19,28 +19,29 @@
19
19
 
20
20
  class String
21
21
  def to_underscore
22
- gsub('OpenStudio','Openstudio')
23
- .gsub('EnergyPlus','Energyplus')
24
- .gsub(/::/, '/')
25
- .gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
26
- .gsub(/([a-z\d])([A-Z])/, '\1_\2')
27
- .tr('-', '_')
28
- .tr(' ', '_')
29
- .squeeze('_')
30
- .downcase
22
+ gsub('OpenStudio', 'Openstudio')
23
+ .gsub('EnergyPlus', 'Energyplus')
24
+ .gsub(/::/, '/')
25
+ .gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
26
+ .gsub(/([a-z\d])([A-Z])/, '\1_\2')
27
+ .tr('-', '_')
28
+ .tr(' ', '_')
29
+ .squeeze('_')
30
+ .downcase
31
31
  end
32
32
 
33
33
  def to_bool
34
- return true if self == true || self =~ (/(true|t|yes|y|1)$/i)
35
- return false if self == false || self =~ (/(false|f|no|n|0)$/i)
36
- fail "invalid value for Boolean: '#{self}'"
34
+ return true if self == true || self =~ /(true|t|yes|y|1)$/i
35
+ return false if self == false || self =~ /(false|f|no|n|0)$/i
36
+
37
+ raise "invalid value for Boolean: '#{self}'"
37
38
  end
38
39
 
39
40
  # simple method to create titles -- very custom to catch known inflections
40
41
  def titleize
41
- arr = %w(a an the by to)
42
- upcase_arr = %w(DX EDA AEDG LPD COP)
43
- r = gsub('_', ' ').gsub(/\w+/) do |match|
42
+ arr = ['a', 'an', 'the', 'by', 'to']
43
+ upcase_arr = ['DX', 'EDA', 'AEDG', 'LPD', 'COP']
44
+ r = tr('_', ' ').gsub(/\w+/) do |match|
44
45
  match_result = match
45
46
  if upcase_arr.include?(match.upcase)
46
47
  match_result = upcase_arr[upcase_arr.index(match.upcase)]
data/lib/bcl/tar_ball.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  ######################################################################
2
- # Copyright (c) 2008-2014, Alliance for Sustainable Energy.
2
+ # Copyright (c) 2008-2021, Alliance for Sustainable Energy.
3
3
  # All rights reserved.
4
4
  #
5
5
  # This library is free software; you can redistribute it and/or
data/lib/bcl/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  ######################################################################
2
- # Copyright (c) 2008-2014, Alliance for Sustainable Energy.
2
+ # Copyright (c) 2008-2021, Alliance for Sustainable Energy.
3
3
  # All rights reserved.
4
4
  #
5
5
  # This library is free software; you can redistribute it and/or
@@ -18,5 +18,5 @@
18
18
  ######################################################################
19
19
 
20
20
  module BCL
21
- VERSION = '0.5.7.pre'
21
+ VERSION = '0.7.0'.freeze
22
22
  end
Binary file
@@ -0,0 +1,291 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!-- edited with XMLSpy v2011 sp1 (x64) (http://www.altova.com) by Nicholas Long (National Renewable Energy Laboratory) -->
3
+ <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
4
+ <xs:annotation>
5
+ <xs:documentation>Component.xsd describes the components that are in the building component library or NREL analysis platform library.</xs:documentation>
6
+ </xs:annotation>
7
+ <xs:annotation>
8
+ <xs:documentation>Version - 0.9</xs:documentation>
9
+ </xs:annotation>
10
+ <xs:annotation>
11
+ <xs:documentation>Version - 0.91 - Updated the cost to be more generic</xs:documentation>
12
+ </xs:annotation>
13
+ <xs:annotation>
14
+ <xs:documentation>Version - 0.92 - Added MasterSpec to the elements</xs:documentation>
15
+ </xs:annotation>
16
+ <xs:annotation>
17
+ <xs:documentation>Version - 0.93 - Fixed indentifier typo. Added datatype element to attributes. Removed "level_" from fidelity level values. Removed component_update_id and replaced component_version_id with version_id.</xs:documentation>
18
+ </xs:annotation>
19
+ <xs:annotation>
20
+ <xs:documentation>Version - 0.94 - Made datatype required on attributes and limited the possible options to int, float, and string. (Solr will break if these are not specified or are specified incorrectly).</xs:documentation>
21
+ </xs:annotation>
22
+ <xs:annotation>
23
+ <xs:documentation>Version - 0.95 - Removed sourceType and versionType extensions because it was creating problems on the site.</xs:documentation>
24
+ </xs:annotation>
25
+ <xs:annotation>
26
+ <xs:documentation>Version - 0.96 - Added start and end times for component costs</xs:documentation>
27
+ </xs:annotation>
28
+ <xs:element name="component">
29
+ <xs:annotation>
30
+ <xs:documentation>root element defining a component</xs:documentation>
31
+ </xs:annotation>
32
+ <xs:complexType>
33
+ <xs:sequence>
34
+ <xs:element name="name">
35
+ <xs:annotation>
36
+ <xs:documentation>name of the component as to be displayed</xs:documentation>
37
+ </xs:annotation>
38
+ </xs:element>
39
+ <xs:element name="uid"/>
40
+ <xs:element name="version_id">
41
+ <xs:annotation>
42
+ <xs:documentation>this is used to signal that a new component is available and should replace previously downloaded components</xs:documentation>
43
+ </xs:annotation>
44
+ </xs:element>
45
+ <xs:element name="masterguide_csi_values" minOccurs="0">
46
+ <xs:annotation>
47
+ <xs:documentation>values from the MASTERSPEC</xs:documentation>
48
+ </xs:annotation>
49
+ <xs:complexType>
50
+ <xs:sequence>
51
+ <xs:element name="masterguide_csi_value" maxOccurs="unbounded"/>
52
+ </xs:sequence>
53
+ </xs:complexType>
54
+ </xs:element>
55
+ <xs:element name="description" minOccurs="0">
56
+ <xs:annotation>
57
+ <xs:documentation>free-form description of the component, will be used for search</xs:documentation>
58
+ </xs:annotation>
59
+ </xs:element>
60
+ <xs:element name="comment" minOccurs="0">
61
+ <xs:annotation>
62
+ <xs:documentation>place holder for any comment</xs:documentation>
63
+ </xs:annotation>
64
+ </xs:element>
65
+ <xs:element name="fidelity_level">
66
+ <xs:annotation>
67
+ <xs:documentation>component's level of data abstraction (example: 1-minute data vs. 1-hour data) </xs:documentation>
68
+ </xs:annotation>
69
+ <xs:simpleType>
70
+ <xs:restriction base="xs:string">
71
+ <xs:enumeration value="1"/>
72
+ <xs:enumeration value="2"/>
73
+ <xs:enumeration value="3"/>
74
+ <xs:enumeration value="4"/>
75
+ <xs:enumeration value="5"/>
76
+ </xs:restriction>
77
+ </xs:simpleType>
78
+ </xs:element>
79
+ <xs:element name="provenances">
80
+ <xs:complexType>
81
+ <xs:sequence>
82
+ <xs:element name="provenance" maxOccurs="unbounded">
83
+ <xs:annotation>
84
+ <xs:documentation>provenance is used to enter author information. The comment field can be used to enter information such as project name.</xs:documentation>
85
+ </xs:annotation>
86
+ <xs:complexType>
87
+ <xs:sequence>
88
+ <xs:element name="author" type="xs:string">
89
+ <xs:annotation>
90
+ <xs:documentation>author who uploaded the data, which will be equal to the user account on the bcl site</xs:documentation>
91
+ </xs:annotation>
92
+ </xs:element>
93
+ <xs:element name="datetime" type="xs:dateTime">
94
+ <xs:annotation>
95
+ <xs:documentation>date component was uploaded</xs:documentation>
96
+ </xs:annotation>
97
+ </xs:element>
98
+ <xs:element name="comment" minOccurs="0"/>
99
+ </xs:sequence>
100
+ </xs:complexType>
101
+ </xs:element>
102
+ </xs:sequence>
103
+ </xs:complexType>
104
+ </xs:element>
105
+ <xs:element name="tags">
106
+ <xs:complexType>
107
+ <xs:sequence>
108
+ <xs:element name="tag" maxOccurs="unbounded">
109
+ <xs:annotation>
110
+ <xs:documentation>tag is used to classify the component</xs:documentation>
111
+ </xs:annotation>
112
+ </xs:element>
113
+ </xs:sequence>
114
+ </xs:complexType>
115
+ </xs:element>
116
+ <xs:element name="attributes">
117
+ <xs:complexType>
118
+ <xs:sequence>
119
+ <xs:element name="attribute" minOccurs="0" maxOccurs="unbounded">
120
+ <xs:annotation>
121
+ <xs:documentation>attribute is a descriptor of the component (includes data quality)</xs:documentation>
122
+ </xs:annotation>
123
+ <xs:complexType>
124
+ <xs:sequence>
125
+ <xs:element name="name"/>
126
+ <xs:element name="value" type="xs:string"/>
127
+ <xs:element name="datatype">
128
+ <xs:simpleType>
129
+ <xs:restriction base="xs:string">
130
+ <xs:enumeration value="int"/>
131
+ <xs:enumeration value="float"/>
132
+ <xs:enumeration value="string"/>
133
+ </xs:restriction>
134
+ </xs:simpleType>
135
+ </xs:element>
136
+ <xs:element name="units" minOccurs="0"/>
137
+ </xs:sequence>
138
+ </xs:complexType>
139
+ </xs:element>
140
+ </xs:sequence>
141
+ </xs:complexType>
142
+ </xs:element>
143
+ <xs:element name="source">
144
+ <xs:annotation>
145
+ <xs:documentation>source of the data (the origin of the component information)</xs:documentation>
146
+ </xs:annotation>
147
+ <xs:complexType>
148
+ <xs:sequence minOccurs="0">
149
+ <xs:element name="manufacturer" minOccurs="0"/>
150
+ <xs:element name="model" minOccurs="0"/>
151
+ <xs:element name="serial_no" minOccurs="0"/>
152
+ <xs:element name="year" minOccurs="0"/>
153
+ <xs:element name="url" minOccurs="0"/>
154
+ </xs:sequence>
155
+ </xs:complexType>
156
+ </xs:element>
157
+ <xs:element name="files">
158
+ <xs:complexType>
159
+ <xs:sequence>
160
+ <xs:element name="file" minOccurs="0" maxOccurs="unbounded">
161
+ <xs:complexType>
162
+ <xs:sequence>
163
+ <xs:element name="version">
164
+ <xs:annotation>
165
+ <xs:documentation>version of files attached to component</xs:documentation>
166
+ </xs:annotation>
167
+ <xs:complexType>
168
+ <xs:sequence>
169
+ <xs:element name="software_program"/>
170
+ <xs:element name="identifier"/>
171
+ </xs:sequence>
172
+ </xs:complexType>
173
+ </xs:element>
174
+ <xs:element name="filename" type="xs:string"/>
175
+ <xs:element name="filetype" type="xs:string">
176
+ <xs:annotation>
177
+ <xs:documentation>ies, idf, </xs:documentation>
178
+ </xs:annotation>
179
+ </xs:element>
180
+ </xs:sequence>
181
+ </xs:complexType>
182
+ </xs:element>
183
+ </xs:sequence>
184
+ </xs:complexType>
185
+ </xs:element>
186
+ <xs:element name="costs">
187
+ <xs:complexType>
188
+ <xs:sequence>
189
+ <xs:element name="cost" minOccurs="0" maxOccurs="unbounded">
190
+ <xs:complexType>
191
+ <xs:sequence>
192
+ <xs:element name="instance_name" type="xs:string">
193
+ <xs:annotation>
194
+ <xs:documentation>name of cost for reference</xs:documentation>
195
+ </xs:annotation>
196
+ </xs:element>
197
+ <xs:element name="cost_type">
198
+ <xs:annotation>
199
+ <xs:documentation>type of cost, includes low, high, average, estimate, etc</xs:documentation>
200
+ </xs:annotation>
201
+ <xs:simpleType>
202
+ <xs:restriction base="xs:string">
203
+ <xs:enumeration value="low"/>
204
+ <xs:enumeration value="high"/>
205
+ <xs:enumeration value="average"/>
206
+ <xs:enumeration value="estimate"/>
207
+ </xs:restriction>
208
+ </xs:simpleType>
209
+ </xs:element>
210
+ <xs:element name="category">
211
+ <xs:annotation>
212
+ <xs:documentation>ex: operations and maintenance cost, salvage cost, materials cost, installation cost, upgrade cost, etc.</xs:documentation>
213
+ </xs:annotation>
214
+ </xs:element>
215
+ <xs:element name="value" type="xs:float">
216
+ <xs:annotation>
217
+ <xs:documentation>cost value based on the supplemntal fields</xs:documentation>
218
+ </xs:annotation>
219
+ </xs:element>
220
+ <xs:element name="units" minOccurs="0">
221
+ <xs:annotation>
222
+ <xs:documentation>cost unit. If blank, absolute cost is assumed. ex: $/ft2, $/person, etc.</xs:documentation>
223
+ </xs:annotation>
224
+ </xs:element>
225
+ <xs:element name="interval" minOccurs="0">
226
+ <xs:annotation>
227
+ <xs:documentation>number describing the interval on which this cost is incurred. ex: 1, 6, 12. Use 0 for onetime costs</xs:documentation>
228
+ </xs:annotation>
229
+ </xs:element>
230
+ <xs:element name="interval_units" minOccurs="0">
231
+ <xs:annotation>
232
+ <xs:documentation>interval units. ex: day, month, year, etc.</xs:documentation>
233
+ </xs:annotation>
234
+ <xs:simpleType>
235
+ <xs:restriction base="xs:string">
236
+ <xs:enumeration value="year(s)"/>
237
+ <xs:enumeration value="month(s)"/>
238
+ <xs:enumeration value="day(s)"/>
239
+ </xs:restriction>
240
+ </xs:simpleType>
241
+ </xs:element>
242
+ <xs:element name="year" type="xs:int" minOccurs="0">
243
+ <xs:annotation>
244
+ <xs:documentation>source year of the costs</xs:documentation>
245
+ </xs:annotation>
246
+ </xs:element>
247
+ <xs:element name="start_year" minOccurs="0">
248
+ <xs:annotation>
249
+ <xs:documentation>define when this cost will start to incur. Useful when you may not want maintenance costs to start until n years after construction</xs:documentation>
250
+ </xs:annotation>
251
+ </xs:element>
252
+ <xs:element name="end_year" minOccurs="0">
253
+ <xs:annotation>
254
+ <xs:documentation>define whne this cost will stop incurring.</xs:documentation>
255
+ </xs:annotation>
256
+ </xs:element>
257
+ <xs:element name="location" minOccurs="0">
258
+ <xs:annotation>
259
+ <xs:documentation>the geographic location where the component was costed (i.e. national, colorado, denver, etc). By default all values should be national averages.</xs:documentation>
260
+ </xs:annotation>
261
+ </xs:element>
262
+ <xs:element name="currency" minOccurs="0">
263
+ <xs:annotation>
264
+ <xs:documentation>the currency of the cost. If blank, USD is assumed.</xs:documentation>
265
+ </xs:annotation>
266
+ </xs:element>
267
+ <xs:element name="source" type="xs:string" minOccurs="0">
268
+ <xs:annotation>
269
+ <xs:documentation>origin from which the cost data came</xs:documentation>
270
+ </xs:annotation>
271
+ </xs:element>
272
+ <xs:element name="reference_component_name" minOccurs="0">
273
+ <xs:annotation>
274
+ <xs:documentation>display name of reference component prior to retrofit (for marginal costs)</xs:documentation>
275
+ </xs:annotation>
276
+ </xs:element>
277
+ <xs:element name="reference_component_id" minOccurs="0">
278
+ <xs:annotation>
279
+ <xs:documentation>ID of reference component prior to retrofit (for marginal costs)</xs:documentation>
280
+ </xs:annotation>
281
+ </xs:element>
282
+ </xs:sequence>
283
+ </xs:complexType>
284
+ </xs:element>
285
+ </xs:sequence>
286
+ </xs:complexType>
287
+ </xs:element>
288
+ </xs:sequence>
289
+ </xs:complexType>
290
+ </xs:element>
291
+ </xs:schema>
@@ -0,0 +1,153 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!-- edited with XMLSpy v2010 rel. 3 (http://www.altova.com) by Cynthia McDonald (NREL) -->
3
+ <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
4
+ <xs:annotation>
5
+ <xs:documentation>Measure.xsd describes the measures that are in the building component library or NREL analysis platform library.</xs:documentation>
6
+ </xs:annotation>
7
+ <xs:annotation>
8
+ <xs:documentation>Version - 0.1</xs:documentation>
9
+ </xs:annotation>
10
+ <xs:element name="measure">
11
+ <xs:annotation>
12
+ <xs:documentation>root element defining a measure</xs:documentation>
13
+ </xs:annotation>
14
+ <xs:complexType>
15
+ <xs:sequence>
16
+ <xs:element name="name">
17
+ <xs:annotation>
18
+ <xs:documentation>name of the measure</xs:documentation>
19
+ </xs:annotation>
20
+ </xs:element>
21
+ <xs:element name="uid"/>
22
+ <xs:element name="version_id">
23
+ <xs:annotation>
24
+ <xs:documentation>this is used to signal that a new measure is available and should replace previously downloaded measures</xs:documentation>
25
+ </xs:annotation>
26
+ </xs:element>
27
+ <xs:element name="description" minOccurs="0">
28
+ <xs:annotation>
29
+ <xs:documentation>free-form description of the measure, will be used for search</xs:documentation>
30
+ </xs:annotation>
31
+ </xs:element>
32
+ <xs:element name="modeler_description">
33
+ <xs:annotation>
34
+ <xs:documentation>description containing specific details about the script file</xs:documentation>
35
+ </xs:annotation>
36
+ </xs:element>
37
+ <xs:element name="provenances">
38
+ <xs:complexType>
39
+ <xs:sequence>
40
+ <xs:element name="provenance" minOccurs="0" maxOccurs="unbounded">
41
+ <xs:annotation>
42
+ <xs:documentation>provenance is used to enter author information. The comment field can be used to enter information such as project name.</xs:documentation>
43
+ </xs:annotation>
44
+ <xs:complexType>
45
+ <xs:sequence>
46
+ <xs:element name="author" type="xs:string">
47
+ <xs:annotation>
48
+ <xs:documentation>author who uploaded the data, which will be equal to the user account on the bcl site</xs:documentation>
49
+ </xs:annotation>
50
+ </xs:element>
51
+ <xs:element name="datetime" type="xs:dateTime">
52
+ <xs:annotation>
53
+ <xs:documentation>date measure was uploaded</xs:documentation>
54
+ </xs:annotation>
55
+ </xs:element>
56
+ <xs:element name="comment" minOccurs="0"/>
57
+ </xs:sequence>
58
+ </xs:complexType>
59
+ </xs:element>
60
+ <xs:element name="provenance_required">
61
+ <xs:simpleType>
62
+ <xs:restriction base="xs:string">
63
+ <xs:enumeration value="true"/>
64
+ <xs:enumeration value="false"/>
65
+ </xs:restriction>
66
+ </xs:simpleType>
67
+ </xs:element>
68
+ </xs:sequence>
69
+ </xs:complexType>
70
+ </xs:element>
71
+ <xs:element name="tags">
72
+ <xs:annotation>
73
+ <xs:documentation>tags are used to classify the measure (using the measures taxonomy)</xs:documentation>
74
+ </xs:annotation>
75
+ <xs:complexType>
76
+ <xs:sequence>
77
+ <xs:element name="tag" maxOccurs="unbounded"/>
78
+ </xs:sequence>
79
+ </xs:complexType>
80
+ </xs:element>
81
+ <xs:element name="attributes">
82
+ <xs:annotation>
83
+ <xs:documentation>attributes are descriptors of the measure. Measures will most likely have a measure type attribute (Replacement/Addition/ Removal)</xs:documentation>
84
+ </xs:annotation>
85
+ <xs:complexType>
86
+ <xs:sequence>
87
+ <xs:element name="os_version" minOccurs="0"/>
88
+ <xs:element name="attribute" minOccurs="0" maxOccurs="unbounded">
89
+ <xs:complexType>
90
+ <xs:sequence>
91
+ <xs:element name="name"/>
92
+ <xs:element name="value" type="xs:string"/>
93
+ <xs:element name="datatype"/>
94
+ <xs:element name="units" minOccurs="0"/>
95
+ </xs:sequence>
96
+ </xs:complexType>
97
+ </xs:element>
98
+ </xs:sequence>
99
+ </xs:complexType>
100
+ </xs:element>
101
+ <xs:element name="files">
102
+ <xs:annotation>
103
+ <xs:documentation>files lists details on all of the files associated with this measure, including arguments for script files.</xs:documentation>
104
+ </xs:annotation>
105
+ <xs:complexType>
106
+ <xs:sequence>
107
+ <xs:element name="file" minOccurs="0" maxOccurs="unbounded">
108
+ <xs:complexType>
109
+ <xs:sequence>
110
+ <xs:element name="version">
111
+ <xs:complexType>
112
+ <xs:sequence>
113
+ <xs:element name="software_program"/>
114
+ <xs:element name="identifier"/>
115
+ </xs:sequence>
116
+ </xs:complexType>
117
+ </xs:element>
118
+ <xs:element name="filename" type="xs:string"/>
119
+ <xs:element name="usage_type">
120
+ <xs:annotation>
121
+ <xs:documentation>What type of file? (scripts, resources, tests)</xs:documentation>
122
+ </xs:annotation>
123
+ <xs:simpleType>
124
+ <xs:restriction base="xs:string">
125
+ <xs:enumeration value="scripts"/>
126
+ <xs:enumeration value="tests"/>
127
+ <xs:enumeration value="resources"/>
128
+ </xs:restriction>
129
+ </xs:simpleType>
130
+ </xs:element>
131
+ <xs:element name="filetype">
132
+ <xs:annotation>
133
+ <xs:documentation>extension of the file (osm, rb, etc)</xs:documentation>
134
+ </xs:annotation>
135
+ <xs:simpleType>
136
+ <xs:restriction base="xs:string">
137
+ <xs:enumeration value="resource"/>
138
+ <xs:enumeration value="test"/>
139
+ <xs:enumeration value="script"/>
140
+ </xs:restriction>
141
+ </xs:simpleType>
142
+ </xs:element>
143
+ <xs:element name="checksum" type="xs:string"/>
144
+ </xs:sequence>
145
+ </xs:complexType>
146
+ </xs:element>
147
+ </xs:sequence>
148
+ </xs:complexType>
149
+ </xs:element>
150
+ </xs:sequence>
151
+ </xs:complexType>
152
+ </xs:element>
153
+ </xs:schema>