urbanopt-reporting 0.3.4 → 0.3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/lib/measures/default_feature_reports/measure.rb +14 -1
- data/lib/measures/export_modelica_loads/measure.rb +2 -0
- data/lib/measures/export_time_series_modelica/measure.rb +1 -0
- data/lib/urbanopt/reporting/default_reports/end_use.rb +39 -17
- data/lib/urbanopt/reporting/default_reports/scenario_report.rb +9 -7
- data/lib/urbanopt/reporting/default_reports/schema/scenario_csv_columns.txt +1 -0
- data/lib/urbanopt/reporting/default_reports/schema/scenario_schema.json +4 -1
- data/lib/urbanopt/reporting/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f3bd0a381b1713f28796ac103c6b193c00a87c0ab75084bb49db62654a6f2906
|
4
|
+
data.tar.gz: 8672b851b4a5c906c2954bcb42fad185044f4b89c536e545aba185dffb0afa6b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57bf6dadcd3d1908de6e406bd0bcdf6fd3cf0141cb6858818dc440a4b3cdf1b22d740f06353112181f8d5b3db53a7bdaeb0d890dc0b4b71c6f3103c251584a74
|
7
|
+
data.tar.gz: c3602e94784b2d91499cd7dd439f7ae24131da774241b5a0e685cb60e7a3eb00fe2d9d237431fb4430ce084ba5b678cb2032a79f5734b35c2a4600d3f82f9668
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
# URBANopt Reporting Gem
|
2
2
|
|
3
|
+
## Version 0.3.5
|
4
|
+
|
5
|
+
Date Range: 01/16/21 - 02/04/21
|
6
|
+
|
7
|
+
- Fixed [#58]( https://github.com/urbanopt/urbanopt-reporting-gem/issues/58 ), Feature report saving bug fix.
|
8
|
+
- Fixed [#60]( https://github.com/urbanopt/urbanopt-reporting-gem/issues/60 ), Added EV/ ExteriorEquipment results to csv and json reports
|
9
|
+
- Fixed [#61]( https://github.com/urbanopt/urbanopt-reporting-gem/issues/61 ), Enhance the aggregation of enduses.
|
10
|
+
|
11
|
+
|
3
12
|
## Version 0.3.4
|
4
13
|
|
5
14
|
Date Range: 01/14/21 - 01/15/21
|
@@ -201,6 +201,8 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
|
201
201
|
result << OpenStudio::IdfObject.load("Output:Meter:MeterFileOnly,Gas:Facility,#{reporting_frequency};").get
|
202
202
|
result << OpenStudio::IdfObject.load("Output:Meter:MeterFileOnly,DistrictCooling:Facility,#{reporting_frequency};").get
|
203
203
|
result << OpenStudio::IdfObject.load("Output:Meter:MeterFileOnly,DistrictHeating:Facility,#{reporting_frequency};").get
|
204
|
+
|
205
|
+
|
204
206
|
# result << OpenStudio::IdfObject.load("Output:Meter:MeterFileOnly,Cooling:Electricity,#{reporting_frequency};").get
|
205
207
|
# result << OpenStudio::IdfObject.load("Output:Meter:MeterFileOnly,Heating:Electricity,#{reporting_frequency};").get
|
206
208
|
# result << OpenStudio::IdfObject.load("Output:Meter:MeterFileOnly,InteriorLights:Electricity,#{reporting_frequency};").get
|
@@ -213,14 +215,19 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
|
213
215
|
# result << OpenStudio::IdfObject.load("Output:Meter:MeterFileOnly,WaterSystems:Gas,#{reporting_frequency};").get
|
214
216
|
# result << OpenStudio::IdfObject.load("Output:Meter:MeterFileOnly,InteriorEquipment:Gas,#{reporting_frequency};").get
|
215
217
|
result << OpenStudio::IdfObject.load('Output:Variable,*,Heating Coil Heating Rate,hourly; !- HVAC Average [W];').get
|
218
|
+
#result << OpenStudio::IdfObject.load("Output:Variable,*,Exterior Equipment:Electric Vehicles,#{reporting_frequency};").get
|
216
219
|
|
217
220
|
timeseries_data = ['District Cooling Chilled Water Rate', 'District Cooling Mass Flow Rate',
|
218
221
|
'District Cooling Inlet Temperature', 'District Cooling Outlet Temperature',
|
219
222
|
'District Heating Hot Water Rate', 'District Heating Mass Flow Rate',
|
220
223
|
'District Heating Inlet Temperature', 'District Heating Outlet Temperature', 'Cooling Coil Total Cooling Rate',
|
221
|
-
'Heating Coil Heating Rate']
|
224
|
+
'Heating Coil Heating Rate', 'ExteriorEquipment:Electricity']
|
225
|
+
|
222
226
|
|
223
227
|
tes_timeseries_data = ['Ice Thermal Storage End Fraction', 'Cooling coil Ice Thermal Storage End Fraction']
|
228
|
+
|
229
|
+
ev_timeseries_data = ['Exterior Equipment:Electric Vehicles']
|
230
|
+
|
224
231
|
timeseries_data += tes_timeseries_data
|
225
232
|
|
226
233
|
timeseries_data.each do |ts|
|
@@ -740,6 +747,11 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
|
740
747
|
end
|
741
748
|
end
|
742
749
|
|
750
|
+
# add enduses subcategories
|
751
|
+
electric_vehicles = sql_query(runner, sql_file, 'AnnualBuildingUtilityPerformanceSummary', "TableName='End Uses By Subcategory' AND RowName='Exterior Equipment:Electric Vehicles' AND ColumnName='Electricity'")
|
752
|
+
puts "electric_vehicle = #{electric_vehicles}"
|
753
|
+
feature_report.reporting_periods[0].end_uses.electricity_kwh.electric_vehicles = convert_units(electric_vehicles, 'GJ', 'kWh')
|
754
|
+
|
743
755
|
### energy_production
|
744
756
|
## electricity_produced
|
745
757
|
# photovoltaic
|
@@ -803,6 +815,7 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
|
803
815
|
'InteriorLights:Electricity',
|
804
816
|
'ExteriorLights:Electricity',
|
805
817
|
'InteriorEquipment:Electricity',
|
818
|
+
'ExteriorEquipment:Electricity',
|
806
819
|
'Fans:Electricity',
|
807
820
|
'Pumps:Electricity',
|
808
821
|
'WaterSystems:Electricity',
|
@@ -36,6 +36,7 @@
|
|
36
36
|
require 'erb'
|
37
37
|
|
38
38
|
|
39
|
+
# This measure is originally from https://github.com/urbanopt/DES_HVAC
|
39
40
|
# start the measure
|
40
41
|
class ExportTimeSeriesLoadsCSV < OpenStudio::Measure::ReportingMeasure
|
41
42
|
Dir[File.dirname(__FILE__) + '/resources/*.rb'].each { |file| require file }
|
@@ -38,7 +38,7 @@ module URBANopt
|
|
38
38
|
# Enduse class all enduse energy consumption results.
|
39
39
|
##
|
40
40
|
class EndUse
|
41
|
-
attr_accessor :heating, :cooling, :interior_lighting, :exterior_lighting, :interior_equipment, :exterior_equipment,
|
41
|
+
attr_accessor :heating, :cooling, :interior_lighting, :exterior_lighting, :interior_equipment, :exterior_equipment, :electric_vehicles,
|
42
42
|
:fans, :pumps, :heat_rejection, :humidification, :heat_recovery, :water_systems, :refrigeration, :generators # :nodoc:
|
43
43
|
|
44
44
|
##
|
@@ -59,6 +59,7 @@ module URBANopt
|
|
59
59
|
@exterior_lighting = hash[:exterior_lighting]
|
60
60
|
@interior_equipment = hash[:interior_equipment]
|
61
61
|
@exterior_equipment = hash[:exterior_equipment]
|
62
|
+
@electric_vehicles = hash[:electric_vehicles]
|
62
63
|
@fans = hash[:fans]
|
63
64
|
@pumps = hash[:pumps]
|
64
65
|
@heat_rejection = hash[:heat_rejection]
|
@@ -85,6 +86,7 @@ module URBANopt
|
|
85
86
|
hash[:exterior_lighting] = nil
|
86
87
|
hash[:interior_equipment] = nil
|
87
88
|
hash[:exterior_equipment] = nil
|
89
|
+
hash[:electric_vehicles] = nil
|
88
90
|
hash[:fans] = nil
|
89
91
|
hash[:pumps] = nil
|
90
92
|
hash[:heat_rejection] = nil
|
@@ -112,6 +114,7 @@ module URBANopt
|
|
112
114
|
result[:exterior_lighting] = @exterior_lighting
|
113
115
|
result[:interior_equipment] = @interior_equipment
|
114
116
|
result[:exterior_equipment] = @exterior_equipment
|
117
|
+
result[:electric_vehicles] = @electric_vehicles
|
115
118
|
result[:fans] = @fans
|
116
119
|
result[:pumps] = @pumps
|
117
120
|
result[:heat_rejection] = @heat_rejection
|
@@ -129,27 +132,46 @@ module URBANopt
|
|
129
132
|
return result
|
130
133
|
end
|
131
134
|
|
135
|
+
##
|
136
|
+
# Adds up +existing_value+ and +new_values+ if not nill.
|
137
|
+
##
|
138
|
+
# [parameter:]
|
139
|
+
# +existing_value+ - _Float_ - A value corresponding to a EndUse attribute.
|
140
|
+
##
|
141
|
+
# +new_value+ - _Float_ - A value corresponding to a EndUse attribute.
|
142
|
+
##
|
143
|
+
def add_values(existing_value, new_value)
|
144
|
+
if existing_value && new_value
|
145
|
+
existing_value += new_value
|
146
|
+
elsif new_value
|
147
|
+
existing_value = new_value
|
148
|
+
end
|
149
|
+
return existing_value
|
150
|
+
end
|
151
|
+
|
132
152
|
##
|
133
153
|
# Aggregate values of each EndUse attribute.
|
134
154
|
##
|
135
155
|
# [Parameters:]
|
136
|
-
# +
|
156
|
+
# +other+ - _EndUse_ - An object of EndUse class.
|
137
157
|
##
|
138
|
-
def merge_end_use!(
|
139
|
-
|
140
|
-
@
|
141
|
-
@
|
142
|
-
@
|
143
|
-
@
|
144
|
-
@
|
145
|
-
@
|
146
|
-
@
|
147
|
-
@
|
148
|
-
@
|
149
|
-
@
|
150
|
-
@
|
151
|
-
@
|
152
|
-
@
|
158
|
+
def merge_end_use!(other)
|
159
|
+
|
160
|
+
@heating = add_values(@heating, other.heating)
|
161
|
+
@cooling = add_values(@cooling, other.cooling)
|
162
|
+
@interior_lighting = add_values(@interior_lighting, other.interior_lighting)
|
163
|
+
@exterior_lighting = add_values(@exterior_lighting, other.exterior_lighting)
|
164
|
+
@interior_equipment = add_values(@interior_equipment, other.interior_equipment)
|
165
|
+
@exterior_equipment = add_values(@exterior_equipment, other.exterior_equipment)
|
166
|
+
@electric_vehicles = add_values(@electric_vehicles, other.electric_vehicles)
|
167
|
+
@fans = add_values(@fans, other.fans)
|
168
|
+
@pumps = add_values(@pumps, other.pumps)
|
169
|
+
@heat_rejection = add_values(@heat_rejection, other.heat_rejection)
|
170
|
+
@humidification = add_values(@humidification, other.humidification)
|
171
|
+
@heat_recovery = add_values(@heat_recovery, other.heat_recovery)
|
172
|
+
@water_systems = add_values(@water_systems, other.water_systems)
|
173
|
+
@refrigeration = add_values(@refrigeration, other.refrigeration)
|
174
|
+
@generators = add_values(@generators, other.generators)
|
153
175
|
|
154
176
|
return self
|
155
177
|
end
|
@@ -147,7 +147,7 @@ module URBANopt
|
|
147
147
|
##
|
148
148
|
# [parameters]:
|
149
149
|
# +file_name+ - _String_ - Assign a name to the saved scenario results file without an extension
|
150
|
-
def save(file_name = 'default_scenario_report')
|
150
|
+
def save(file_name = 'default_scenario_report', save_feature_reports = true)
|
151
151
|
# reassign the initialize local variable @file_name to the file name input.
|
152
152
|
@file_name = file_name
|
153
153
|
|
@@ -185,12 +185,14 @@ module URBANopt
|
|
185
185
|
@timeseries_csv.path = File.join(@directory_name, file_name + '.csv')
|
186
186
|
end
|
187
187
|
|
188
|
-
if
|
189
|
-
file_name
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
188
|
+
if save_feature_reports
|
189
|
+
if file_name == 'default_scenario_report'
|
190
|
+
file_name = 'default_feature_report'
|
191
|
+
end
|
192
|
+
#save the feature reports csv and json data
|
193
|
+
@feature_reports.each do |feature_report|
|
194
|
+
feature_report.save file_name
|
195
|
+
end
|
194
196
|
end
|
195
197
|
|
196
198
|
return true
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: urbanopt-reporting
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rawad El Kontar
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2021-
|
12
|
+
date: 2021-02-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|