urbanopt-reporting 0.6.2 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/nightly_ci_build.yml +54 -0
- data/CHANGELOG.md +16 -0
- data/Gemfile +10 -5
- data/LICENSE.md +16 -11
- data/README.md +1 -0
- data/Rakefile +2 -37
- data/building_loads.csv +52561 -0
- data/doc_templates/LICENSE.md +16 -11
- data/doc_templates/copyright_erb.txt +22 -16
- data/doc_templates/copyright_js.txt +2 -2
- data/doc_templates/copyright_ruby.txt +2 -37
- data/lib/measures/.rubocop.yml +1 -2
- data/lib/measures/default_feature_reports/LICENSE.md +23 -18
- data/lib/measures/default_feature_reports/measure.rb +110 -61
- data/lib/measures/default_feature_reports/measure.xml +40 -45
- data/lib/measures/export_modelica_loads/LICENSE.md +23 -18
- data/lib/measures/export_modelica_loads/measure.rb +19 -54
- data/lib/measures/export_modelica_loads/measure.xml +31 -31
- data/lib/measures/export_time_series_modelica/LICENSE.md +23 -18
- data/lib/measures/export_time_series_modelica/measure.rb +2 -37
- data/lib/measures/export_time_series_modelica/measure.xml +48 -42
- data/lib/measures/export_time_series_modelica/resources/os_lib_helper_methods.rb +2 -37
- data/lib/urbanopt/reporting/default_reports/construction_cost.rb +2 -37
- data/lib/urbanopt/reporting/default_reports/date.rb +2 -37
- data/lib/urbanopt/reporting/default_reports/distributed_generation.rb +3 -38
- data/lib/urbanopt/reporting/default_reports/end_use.rb +2 -37
- data/lib/urbanopt/reporting/default_reports/end_uses.rb +2 -37
- data/lib/urbanopt/reporting/default_reports/extension.rb +2 -37
- data/lib/urbanopt/reporting/default_reports/feature_report.rb +7 -38
- data/lib/urbanopt/reporting/default_reports/generator.rb +2 -37
- data/lib/urbanopt/reporting/default_reports/location.rb +2 -37
- data/lib/urbanopt/reporting/default_reports/logger.rb +4 -37
- data/lib/urbanopt/reporting/default_reports/power_distribution.rb +2 -37
- data/lib/urbanopt/reporting/default_reports/program.rb +2 -37
- data/lib/urbanopt/reporting/default_reports/qaqc_flags.rb +147 -0
- data/lib/urbanopt/reporting/default_reports/reporting_period.rb +6 -41
- data/lib/urbanopt/reporting/default_reports/scenario_power_distribution.rb +2 -37
- data/lib/urbanopt/reporting/default_reports/scenario_power_distribution_cost.rb +177 -0
- data/lib/urbanopt/reporting/default_reports/scenario_report.rb +36 -52
- data/lib/urbanopt/reporting/default_reports/schema/scenario_schema.json +372 -31
- data/lib/urbanopt/reporting/default_reports/solar_pv.rb +2 -37
- data/lib/urbanopt/reporting/default_reports/storage.rb +2 -37
- data/lib/urbanopt/reporting/default_reports/thermal_storage.rb +2 -37
- data/lib/urbanopt/reporting/default_reports/timeseries_csv.rb +2 -37
- data/lib/urbanopt/reporting/default_reports/validator.rb +2 -37
- data/lib/urbanopt/reporting/default_reports/wind.rb +2 -37
- data/lib/urbanopt/reporting/default_reports.rb +2 -37
- data/lib/urbanopt/reporting/derived_extension.rb +2 -37
- data/lib/urbanopt/reporting/version.rb +3 -38
- data/lib/urbanopt/reporting.rb +2 -37
- data/urbanopt-reporting-gem.gemspec +3 -3
- metadata +14 -11
- data/.github/workflows/nightly_build.yml +0 -41
data/doc_templates/LICENSE.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
URBANopt (tm), Copyright (c) 2019-
|
1
|
+
URBANopt (tm), Copyright (c) 2019-2023, Alliance for Sustainable Energy, LLC, and other
|
2
2
|
contributors. All rights reserved.
|
3
3
|
|
4
4
|
Redistribution and use in source and binary forms, with or without modification,
|
@@ -15,13 +15,18 @@ Neither the name of the copyright holder nor the names of its contributors may b
|
|
15
15
|
used to endorse or promote products derived from this software without specific
|
16
16
|
prior written permission.
|
17
17
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
OF
|
18
|
+
The name of the copyright holder(s), any contributors, the United States Government,
|
19
|
+
the United States Department of Energy, or any of their employees may not be used to
|
20
|
+
endorse or promote products derived from this software without specific prior written
|
21
|
+
permission from the respective party.
|
22
|
+
|
23
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) AND ANY CONTRIBUTORS "AS IS" AND
|
24
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
25
|
+
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
26
|
+
THE COPYRIGHT HOLDER(S), ANY CONTRIBUTORS, THE UNITED STATES GOVERNMENT, OR THE UNITED
|
27
|
+
STATES DEPARTMENT OF ENERGY, NOR ANY OF THEIR EMPLOYEES, BE LIABLE FOR ANY DIRECT,
|
28
|
+
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
29
|
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
30
|
+
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
31
|
+
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
|
32
|
+
WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
@@ -1,31 +1,37 @@
|
|
1
1
|
<%
|
2
2
|
# *********************************************************************************
|
3
|
-
# URBANopt (tm), Copyright (c) 2019-
|
3
|
+
# URBANopt (tm), Copyright (c) 2019-2023, Alliance for Sustainable Energy, LLC, and other
|
4
4
|
# contributors. All rights reserved.
|
5
|
-
|
5
|
+
|
6
6
|
# Redistribution and use in source and binary forms, with or without modification,
|
7
7
|
# are permitted provided that the following conditions are met:
|
8
|
-
|
8
|
+
|
9
9
|
# Redistributions of source code must retain the above copyright notice, this list
|
10
10
|
# of conditions and the following disclaimer.
|
11
|
-
|
11
|
+
|
12
12
|
# Redistributions in binary form must reproduce the above copyright notice, this
|
13
13
|
# list of conditions and the following disclaimer in the documentation and/or other
|
14
14
|
# materials provided with the distribution.
|
15
|
-
|
15
|
+
|
16
16
|
# Neither the name of the copyright holder nor the names of its contributors may be
|
17
17
|
# used to endorse or promote products derived from this software without specific
|
18
18
|
# prior written permission.
|
19
|
-
|
20
|
-
#
|
21
|
-
#
|
22
|
-
#
|
23
|
-
#
|
24
|
-
|
25
|
-
#
|
26
|
-
#
|
27
|
-
#
|
28
|
-
#
|
29
|
-
# OF
|
19
|
+
|
20
|
+
# The name of the copyright holder(s), any contributors, the United States Government,
|
21
|
+
# the United States Department of Energy, or any of their employees may not be used to
|
22
|
+
# endorse or promote products derived from this software without specific prior written
|
23
|
+
# permission from the respective party.
|
24
|
+
|
25
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) AND ANY CONTRIBUTORS "AS IS" AND
|
26
|
+
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
27
|
+
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
28
|
+
# THE COPYRIGHT HOLDER(S), ANY CONTRIBUTORS, THE UNITED STATES GOVERNMENT, OR THE UNITED
|
29
|
+
# STATES DEPARTMENT OF ENERGY, NOR ANY OF THEIR EMPLOYEES, BE LIABLE FOR ANY DIRECT,
|
30
|
+
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
31
|
+
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
32
|
+
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
33
|
+
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
|
34
|
+
# WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
35
|
+
|
30
36
|
# *********************************************************************************
|
31
37
|
%>
|
@@ -1,4 +1,4 @@
|
|
1
1
|
/* @preserve
|
2
|
-
* URBANopt (tm), Copyright (c)
|
3
|
-
*
|
2
|
+
* URBANopt (tm), Copyright (c) Alliance for Sustainable Energy, LLC.
|
3
|
+
* See also https://github.com/urbanopt/urbanopt-reporting-gem/blob/develop/LICENSE.md
|
4
4
|
*/
|
@@ -1,39 +1,4 @@
|
|
1
1
|
# *********************************************************************************
|
2
|
-
# URBANopt
|
3
|
-
#
|
4
|
-
|
5
|
-
# Redistribution and use in source and binary forms, with or without modification,
|
6
|
-
# are permitted provided that the following conditions are met:
|
7
|
-
|
8
|
-
# Redistributions of source code must retain the above copyright notice, this list
|
9
|
-
# of conditions and the following disclaimer.
|
10
|
-
|
11
|
-
# Redistributions in binary form must reproduce the above copyright notice, this
|
12
|
-
# list of conditions and the following disclaimer in the documentation and/or other
|
13
|
-
# materials provided with the distribution.
|
14
|
-
|
15
|
-
# Neither the name of the copyright holder nor the names of its contributors may be
|
16
|
-
# used to endorse or promote products derived from this software without specific
|
17
|
-
# prior written permission.
|
18
|
-
|
19
|
-
# Redistribution of this software, without modification, must refer to the software
|
20
|
-
# by the same designation. Redistribution of a modified version of this software
|
21
|
-
# (i) may not refer to the modified version by the same designation, or by any
|
22
|
-
# confusingly similar designation, and (ii) must refer to the underlying software
|
23
|
-
# originally provided by Alliance as “URBANopt”. Except to comply with the foregoing,
|
24
|
-
# the term “URBANopt”, or any confusingly similar designation may not be used to
|
25
|
-
# refer to any modified version of this software or any modified version of the
|
26
|
-
# underlying software originally provided by Alliance without the prior written
|
27
|
-
# consent of Alliance.
|
28
|
-
|
29
|
-
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
30
|
-
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
31
|
-
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
32
|
-
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
33
|
-
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
34
|
-
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
35
|
-
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
36
|
-
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
37
|
-
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
38
|
-
# OF THE POSSIBILITY OF SUCH DAMAGE.
|
2
|
+
# URBANopt (tm), Copyright (c) Alliance for Sustainable Energy, LLC.
|
3
|
+
# See also https://github.com/urbanopt/urbanopt-reporting-gem/blob/develop/LICENSE.md
|
39
4
|
# *********************************************************************************
|
data/lib/measures/.rubocop.yml
CHANGED
@@ -1,27 +1,32 @@
|
|
1
|
-
URBANopt (tm), Copyright (c) 2019-
|
1
|
+
URBANopt (tm), Copyright (c) 2019-2023, Alliance for Sustainable Energy, LLC, and other
|
2
2
|
contributors. All rights reserved.
|
3
3
|
|
4
|
-
Redistribution and use in source and binary forms, with or without modification,
|
4
|
+
Redistribution and use in source and binary forms, with or without modification,
|
5
5
|
are permitted provided that the following conditions are met:
|
6
6
|
|
7
|
-
Redistributions of source code must retain the above copyright notice, this list
|
7
|
+
Redistributions of source code must retain the above copyright notice, this list
|
8
8
|
of conditions and the following disclaimer.
|
9
9
|
|
10
|
-
Redistributions in binary form must reproduce the above copyright notice, this
|
11
|
-
list of conditions and the following disclaimer in the documentation and/or other
|
10
|
+
Redistributions in binary form must reproduce the above copyright notice, this
|
11
|
+
list of conditions and the following disclaimer in the documentation and/or other
|
12
12
|
materials provided with the distribution.
|
13
|
-
|
14
|
-
Neither the name of the copyright holder nor the names of its contributors may be
|
15
|
-
used to endorse or promote products derived from this software without specific
|
13
|
+
|
14
|
+
Neither the name of the copyright holder nor the names of its contributors may be
|
15
|
+
used to endorse or promote products derived from this software without specific
|
16
16
|
prior written permission.
|
17
17
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
OF
|
18
|
+
The name of the copyright holder(s), any contributors, the United States Government,
|
19
|
+
the United States Department of Energy, or any of their employees may not be used to
|
20
|
+
endorse or promote products derived from this software without specific prior written
|
21
|
+
permission from the respective party.
|
22
|
+
|
23
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) AND ANY CONTRIBUTORS "AS IS" AND
|
24
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
25
|
+
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
26
|
+
THE COPYRIGHT HOLDER(S), ANY CONTRIBUTORS, THE UNITED STATES GOVERNMENT, OR THE UNITED
|
27
|
+
STATES DEPARTMENT OF ENERGY, NOR ANY OF THEIR EMPLOYEES, BE LIABLE FOR ANY DIRECT,
|
28
|
+
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
29
|
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
30
|
+
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
31
|
+
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
|
32
|
+
WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
@@ -1,52 +1,17 @@
|
|
1
1
|
# *********************************************************************************
|
2
|
-
# URBANopt
|
3
|
-
#
|
4
|
-
|
5
|
-
# Redistribution and use in source and binary forms, with or without modification,
|
6
|
-
# are permitted provided that the following conditions are met:
|
7
|
-
|
8
|
-
# Redistributions of source code must retain the above copyright notice, this list
|
9
|
-
# of conditions and the following disclaimer.
|
10
|
-
|
11
|
-
# Redistributions in binary form must reproduce the above copyright notice, this
|
12
|
-
# list of conditions and the following disclaimer in the documentation and/or other
|
13
|
-
# materials provided with the distribution.
|
14
|
-
|
15
|
-
# Neither the name of the copyright holder nor the names of its contributors may be
|
16
|
-
# used to endorse or promote products derived from this software without specific
|
17
|
-
# prior written permission.
|
18
|
-
|
19
|
-
# Redistribution of this software, without modification, must refer to the software
|
20
|
-
# by the same designation. Redistribution of a modified version of this software
|
21
|
-
# (i) may not refer to the modified version by the same designation, or by any
|
22
|
-
# confusingly similar designation, and (ii) must refer to the underlying software
|
23
|
-
# originally provided by Alliance as “URBANopt”. Except to comply with the foregoing,
|
24
|
-
# the term “URBANopt”, or any confusingly similar designation may not be used to
|
25
|
-
# refer to any modified version of this software or any modified version of the
|
26
|
-
# underlying software originally provided by Alliance without the prior written
|
27
|
-
# consent of Alliance.
|
28
|
-
|
29
|
-
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
30
|
-
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
31
|
-
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
32
|
-
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
33
|
-
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
34
|
-
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
35
|
-
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
36
|
-
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
37
|
-
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
38
|
-
# OF THE POSSIBILITY OF SUCH DAMAGE.
|
2
|
+
# URBANopt (tm), Copyright (c) Alliance for Sustainable Energy, LLC.
|
3
|
+
# See also https://github.com/urbanopt/urbanopt-reporting-gem/blob/develop/LICENSE.md
|
39
4
|
# *********************************************************************************
|
40
5
|
|
41
6
|
require 'urbanopt/reporting/default_reports'
|
42
7
|
require 'csv'
|
43
8
|
require 'benchmark'
|
9
|
+
require 'json'
|
44
10
|
require 'logger'
|
45
11
|
|
46
|
-
@@logger = Logger.new($stdout)
|
47
|
-
|
48
12
|
# start the measure
|
49
13
|
class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
14
|
+
@@logger = Logger.new($stdout)
|
50
15
|
# human readable name
|
51
16
|
def name
|
52
17
|
return 'DefaultFeatureReports'
|
@@ -233,7 +198,7 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
|
233
198
|
# result << OpenStudio::IdfObject.load("Output:Variable,*,Exterior Equipment:Electric Vehicles,#{reporting_frequency};").get
|
234
199
|
|
235
200
|
## add environmental factor outputs
|
236
|
-
#result << OpenStudio::IdfObject.load("Output:Meter:MeterFileOnly,Output:EnvironmentalImpactFactors,#{reporting_frequency};").get
|
201
|
+
# result << OpenStudio::IdfObject.load("Output:Meter:MeterFileOnly,Output:EnvironmentalImpactFactors,#{reporting_frequency};").get
|
237
202
|
# result << OpenStudio::IdfObject.load("Output:Variable,*,Environmental Impact Total N2O Emissions Carbon Equivalent Mass,#{reporting_frequency}; !- HVAC Sum [kg];").get
|
238
203
|
# result << OpenStudio::IdfObject.load("Output:Variable,*,Environmental Impact Total CH4 Emissions Carbon Equivalent Mass,#{reporting_frequency}; !- HVAC Sum [kg];").get
|
239
204
|
# result << OpenStudio::IdfObject.load("Output:Variable,*,Environmental Impact Total CO2 Emissions Carbon Equivalent Mass,#{reporting_frequency}; !- HVAC Sum [kg];").get
|
@@ -252,11 +217,9 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
|
252
217
|
ev_timeseries_data = ['Exterior Equipment:Electric Vehicles']
|
253
218
|
|
254
219
|
emissions_timeseries_data = ['Future_Annual_Electricity_Emissions', 'Future_Hourly_Electricity_Emissions',
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
220
|
+
'Historical_Annual_Electricity_Emissions', 'Historical_Hourly_Electricity_Emissions',
|
221
|
+
'Future_Annual_Electricity_Emissions_Intensity', 'Future_Hourly_Electricity_Emissions_Intensity',
|
222
|
+
'Historical_Annual_Electricity_Emissions_Intensity', 'Historical_Hourly_Electricity_Emissions_Intensity']
|
260
223
|
|
261
224
|
timeseries_data += tes_timeseries_data
|
262
225
|
timeseries_data += emissions_timeseries_data
|
@@ -291,6 +254,83 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
|
291
254
|
return val
|
292
255
|
end
|
293
256
|
|
257
|
+
def feature_qaqc_flags(runner)
|
258
|
+
# QAQC flags by category
|
259
|
+
qaqc_flags_hash = {} # Make a hash for count of flags of each category
|
260
|
+
|
261
|
+
runner.workflow.workflowSteps.each do |step| # Go through all the steps
|
262
|
+
if step.to_MeasureStep.is_initialized
|
263
|
+
measure_step = step.to_MeasureStep.get
|
264
|
+
|
265
|
+
measure_name = measure_step.measureDirName
|
266
|
+
|
267
|
+
if measure_step.name.is_initialized
|
268
|
+
measure_name = measure_step.name.get
|
269
|
+
end
|
270
|
+
|
271
|
+
if measure_name.include? 'qaqc'
|
272
|
+
puts "measure_name = #{measure_name}"
|
273
|
+
if measure_step.result.is_initialized
|
274
|
+
result = measure_step.result.get
|
275
|
+
puts " result = #{result}"
|
276
|
+
|
277
|
+
## Adding quaqc_flags_list to check the step value name since units key is missing from the result
|
278
|
+
## It does show in the out.osw but not in the runner.workflow.workflowSteps object
|
279
|
+
# use this list to define the flags you want to report
|
280
|
+
qaqc_flags_list = [
|
281
|
+
'eui_reasonableness', 'end_use_by_category', 'mechanical_system_part_load_efficiency',
|
282
|
+
'simultaneous_heating_and_cooling', 'internal_loads', 'schedules', 'envelope_r_value',
|
283
|
+
'domestic_hot_water', 'mechanical_system_efficiency', 'supply_and_zone_air_temperature', 'total_qaqc_flags'
|
284
|
+
]
|
285
|
+
|
286
|
+
result.stepValues.each do |step_value|
|
287
|
+
# get name
|
288
|
+
name = step_value.name
|
289
|
+
|
290
|
+
if qaqc_flags_list.include? name
|
291
|
+
|
292
|
+
# get value
|
293
|
+
# check if value, double, int, or bool
|
294
|
+
value_type = step_value.variantType.valueDescription
|
295
|
+
case value_type
|
296
|
+
when 'Double'
|
297
|
+
value = step_value.valueAsDouble
|
298
|
+
when 'Integer'
|
299
|
+
value = step_value.valueAsInteger
|
300
|
+
when 'Boolean'
|
301
|
+
value = step_value.valueAsBoolean
|
302
|
+
when 'String'
|
303
|
+
value = step_value.valueAsString
|
304
|
+
else
|
305
|
+
# catchall for unexpected value types
|
306
|
+
value = step_value.valueAsVariant.to_s
|
307
|
+
end
|
308
|
+
|
309
|
+
if qaqc_flags_hash[name]
|
310
|
+
qaqc_flags_hash[name] += value
|
311
|
+
else
|
312
|
+
qaqc_flags_hash[name] = value
|
313
|
+
end
|
314
|
+
|
315
|
+
end
|
316
|
+
end
|
317
|
+
|
318
|
+
puts "qaqc_flags_hash = #{qaqc_flags_hash}"
|
319
|
+
|
320
|
+
# Hack to put 'total_qaqc_flags' at the end of the hash
|
321
|
+
temp_hash_for_ordering = { 'total_qaqc_flags' => qaqc_flags_hash['total_qaqc_flags'] }
|
322
|
+
qaqc_flags_hash.delete('total_qaqc_flags')
|
323
|
+
qaqc_flags_hash['total_qaqc_flags'] = temp_hash_for_ordering['total_qaqc_flags']
|
324
|
+
|
325
|
+
end
|
326
|
+
|
327
|
+
end
|
328
|
+
|
329
|
+
end
|
330
|
+
end
|
331
|
+
return qaqc_flags_hash
|
332
|
+
end
|
333
|
+
|
294
334
|
# unit conversion method
|
295
335
|
def convert_units(value, from_units, to_units)
|
296
336
|
if value.nil?
|
@@ -836,7 +876,6 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
|
836
876
|
|
837
877
|
# electricity emissions
|
838
878
|
begin
|
839
|
-
|
840
879
|
# future_annual_emissions
|
841
880
|
future_annual_emissions_ts = sql_file.timeSeries(ann_env_pd.to_s, reporting_frequency.to_s, 'Future_Annual_Electricity_Emissions', 'EMS')
|
842
881
|
feature_report.reporting_periods[0].emissions[:future_annual_electricity_emissions_mt] = future_annual_emissions_ts.get.values.sum
|
@@ -868,11 +907,24 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
|
868
907
|
# historical_hourly_emissions_intensity
|
869
908
|
historical_hourly_emissions_intensity_ts = sql_file.timeSeries(ann_env_pd.to_s, reporting_frequency.to_s, 'Historical_Hourly_Electricity_Emissions_Intensity', 'EMS')
|
870
909
|
feature_report.reporting_periods[0].emissions[:historical_hourly_electricity_emissions_intensity_kg_per_ft2] = historical_hourly_emissions_intensity_ts.get.values.sum
|
871
|
-
|
872
910
|
rescue StandardError
|
873
911
|
@@logger.info('Emissions are not reported for this feature')
|
874
912
|
end
|
875
913
|
|
914
|
+
# add qaqc results to feature report
|
915
|
+
qaqc_flags_hash = feature_qaqc_flags(runner)
|
916
|
+
feature_report.qaqc_flags.eui_reasonableness = qaqc_flags_hash['eui_reasonableness']
|
917
|
+
feature_report.qaqc_flags.end_use_by_category = qaqc_flags_hash['end_use_by_category']
|
918
|
+
feature_report.qaqc_flags.mechanical_system_part_load_efficiency = qaqc_flags_hash['mechanical_system_part_load_efficiency']
|
919
|
+
feature_report.qaqc_flags.simultaneous_heating_and_cooling = qaqc_flags_hash['simultaneous_heating_and_cooling']
|
920
|
+
feature_report.qaqc_flags.internal_loads = qaqc_flags_hash['internal_loads']
|
921
|
+
feature_report.qaqc_flags.schedules = qaqc_flags_hash['schedules']
|
922
|
+
feature_report.qaqc_flags.envelope_r_value = qaqc_flags_hash['envelope_r_value']
|
923
|
+
feature_report.qaqc_flags.domestic_hot_water = qaqc_flags_hash['domestic_hot_water']
|
924
|
+
feature_report.qaqc_flags.mechanical_system_efficiency = qaqc_flags_hash['mechanical_system_efficiency']
|
925
|
+
feature_report.qaqc_flags.supply_and_zone_air_temperature = qaqc_flags_hash['supply_and_zone_air_temperature']
|
926
|
+
feature_report.qaqc_flags.total_qaqc_flags = qaqc_flags_hash['total_qaqc_flags']
|
927
|
+
|
876
928
|
##########################################################################################################################
|
877
929
|
# set conversion variables
|
878
930
|
conv_J_mwh = 1000000 * 60 * 60 # J to MWh (1000000J/MJ * 60hr/min * 60 min/sec)
|
@@ -888,7 +940,6 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
|
888
940
|
fo1_val = 294.962046
|
889
941
|
fo2_val = 294.962046
|
890
942
|
|
891
|
-
|
892
943
|
##########################################################################################################################
|
893
944
|
######################################## Reporting TImeseries Results FOR CSV File #######################################
|
894
945
|
|
@@ -948,7 +999,7 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
|
948
999
|
'Historical_Hourly_Electricity_Emissions_Intensity',
|
949
1000
|
'Natural_Gas_Emissions',
|
950
1001
|
'Natural_Gas_Emissions_Intensity',
|
951
|
-
'Propane_Emissions',
|
1002
|
+
'Propane_Emissions',
|
952
1003
|
'Propane_Emissions_Intensity',
|
953
1004
|
'FuelOilNo2_Emissions',
|
954
1005
|
'FuelOilNo2_Emissions_Intensity',
|
@@ -980,7 +1031,7 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
|
980
1031
|
runner.registerInfo("All timeseries: #{requested_timeseries_names}")
|
981
1032
|
|
982
1033
|
# timeseries variables to keep to calculate power
|
983
|
-
tsToKeep = ['Electricity:Facility', 'ElectricityProduced:Facility','Propane:Facility', 'NaturalGas:Facility', 'FuelOilNo2:Facility', 'FuelOilNo1:Facility']
|
1034
|
+
tsToKeep = ['Electricity:Facility', 'ElectricityProduced:Facility', 'Propane:Facility', 'NaturalGas:Facility', 'FuelOilNo2:Facility', 'FuelOilNo1:Facility']
|
984
1035
|
tsToKeepIndexes = {}
|
985
1036
|
|
986
1037
|
### powerFactor ###
|
@@ -1145,7 +1196,7 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
|
1145
1196
|
if timeseries_name == 'Natural_Gas_Emissions'
|
1146
1197
|
newVals = Array.new(n, 0)
|
1147
1198
|
(0..n - 1).each do |j|
|
1148
|
-
newVals[j] = (nat_gas_val * (values[tsToKeepIndexes['NaturalGas:Facility']][j].to_f * conv_kbtu_J.to_f) / conv_J_mwh.to_f
|
1199
|
+
newVals[j] = (nat_gas_val * (values[tsToKeepIndexes['NaturalGas:Facility']][j].to_f * conv_kbtu_J.to_f) / conv_J_mwh.to_f) * conv_kg_mt.to_f
|
1149
1200
|
j += 1
|
1150
1201
|
end
|
1151
1202
|
new_unit = 'MT'
|
@@ -1158,7 +1209,7 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
|
1158
1209
|
if timeseries_name == 'Propane_Emissions'
|
1159
1210
|
newVals = Array.new(n, 0)
|
1160
1211
|
(0..n - 1).each do |j|
|
1161
|
-
newVals[j] = (lpg_val * (values[tsToKeepIndexes['Propane:Facility']][j].to_f * conv_kbtu_J.to_f) / conv_J_mwh.to_f
|
1212
|
+
newVals[j] = (lpg_val * (values[tsToKeepIndexes['Propane:Facility']][j].to_f * conv_kbtu_J.to_f) / conv_J_mwh.to_f) * conv_kg_mt.to_f
|
1162
1213
|
j += 1
|
1163
1214
|
end
|
1164
1215
|
new_unit = 'MT'
|
@@ -1171,7 +1222,7 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
|
1171
1222
|
if timeseries_name == 'FuelOilNo2_Emissions'
|
1172
1223
|
newVals = Array.new(n, 0)
|
1173
1224
|
(0..n - 1).each do |j|
|
1174
|
-
newVals[j] = (fo2_val * (values[tsToKeepIndexes['FuelOilNo2:Facility']][j].to_f * conv_kbtu_J.to_f) / conv_J_mwh.to_f
|
1225
|
+
newVals[j] = (fo2_val * (values[tsToKeepIndexes['FuelOilNo2:Facility']][j].to_f * conv_kbtu_J.to_f) / conv_J_mwh.to_f) * conv_kg_mt.to_f
|
1175
1226
|
j += 1
|
1176
1227
|
end
|
1177
1228
|
new_unit = 'MT'
|
@@ -1183,12 +1234,12 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
|
1183
1234
|
|
1184
1235
|
### calculate emissions intensity metric
|
1185
1236
|
# get flr_area
|
1186
|
-
flr_area = building.floorArea * 10.764 #change from m2 to ft2
|
1237
|
+
flr_area = building.floorArea * 10.764 # change from m2 to ft2
|
1187
1238
|
|
1188
1239
|
if timeseries_name == 'Natural_Gas_Emissions_Intensity'
|
1189
1240
|
newVals = Array.new(n, 0)
|
1190
1241
|
(0..n - 1).each do |j|
|
1191
|
-
newVals[j] = (((nat_gas_val * (values[tsToKeepIndexes['NaturalGas:Facility']][j].to_f * conv_kbtu_J.to_f) / conv_J_mwh.to_f
|
1242
|
+
newVals[j] = (((nat_gas_val * (values[tsToKeepIndexes['NaturalGas:Facility']][j].to_f * conv_kbtu_J.to_f) / conv_J_mwh.to_f) * conv_kg_mt.to_f) * 1000 / flr_area) # unit: kg/ft2 - changed mt to kg
|
1192
1243
|
j += 1
|
1193
1244
|
end
|
1194
1245
|
new_unit = 'KG/FT2'
|
@@ -1201,7 +1252,7 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
|
1201
1252
|
if timeseries_name == 'Propane_Emissions_Intensity'
|
1202
1253
|
newVals = Array.new(n, 0)
|
1203
1254
|
(0..n - 1).each do |j|
|
1204
|
-
newVals[j] = (((lpg_val * (values[tsToKeepIndexes['Propane:Facility']][j].to_f * conv_kbtu_J.to_f) / conv_J_mwh.to_f
|
1255
|
+
newVals[j] = (((lpg_val * (values[tsToKeepIndexes['Propane:Facility']][j].to_f * conv_kbtu_J.to_f) / conv_J_mwh.to_f) * conv_kg_mt.to_f) * 1000 / flr_area) # unit: kg/ft2 - changed mt to kg
|
1205
1256
|
j += 1
|
1206
1257
|
end
|
1207
1258
|
new_unit = 'KG/FT2'
|
@@ -1214,7 +1265,7 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
|
1214
1265
|
if timeseries_name == 'FuelOilNo2_Emissions_Intensity'
|
1215
1266
|
newVals = Array.new(n, 0)
|
1216
1267
|
(0..n - 1).each do |j|
|
1217
|
-
newVals[j] = (((fo2_val * (values[tsToKeepIndexes['FuelOilNo2:Facility']][j].to_f * conv_kbtu_J.to_f) / conv_J_mwh.to_f
|
1268
|
+
newVals[j] = (((fo2_val * (values[tsToKeepIndexes['FuelOilNo2:Facility']][j].to_f * conv_kbtu_J.to_f) / conv_J_mwh.to_f) * conv_kg_mt.to_f) * 1000 / flr_area) # unit: kg/ft2 - changed mt to kg
|
1218
1269
|
j += 1
|
1219
1270
|
end
|
1220
1271
|
new_unit = 'KG/FT2'
|
@@ -1280,8 +1331,7 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
|
1280
1331
|
end
|
1281
1332
|
end
|
1282
1333
|
end
|
1283
|
-
end
|
1284
|
-
|
1334
|
+
end
|
1285
1335
|
|
1286
1336
|
# append units to headers
|
1287
1337
|
new_timeseries_name += "(#{new_unit})"
|
@@ -1414,7 +1464,7 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
|
1414
1464
|
end
|
1415
1465
|
end
|
1416
1466
|
|
1417
|
-
puts "values = #{values}"
|
1467
|
+
# puts "values = #{values}"
|
1418
1468
|
|
1419
1469
|
# closing the sql file
|
1420
1470
|
sql_file.close
|
@@ -1426,7 +1476,6 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
|
1426
1476
|
feature_report.timeseries_csv.column_names = final_timeseries_names
|
1427
1477
|
|
1428
1478
|
##### Save the 'default_feature_reports.json' file
|
1429
|
-
|
1430
1479
|
feature_report_hash = feature_report.to_hash
|
1431
1480
|
|
1432
1481
|
File.open('default_feature_reports.json', 'w') do |f|
|