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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 75187e938a1cbfabd1d74eba912af03fcd2aade54955a490d68ea1b97b229dd2
4
- data.tar.gz: 25b56a46e4569a71a7c01964bf64f2a14d8c30fdc9f6f5167fd61b40f272eb52
3
+ metadata.gz: f3bd0a381b1713f28796ac103c6b193c00a87c0ab75084bb49db62654a6f2906
4
+ data.tar.gz: 8672b851b4a5c906c2954bcb42fad185044f4b89c536e545aba185dffb0afa6b
5
5
  SHA512:
6
- metadata.gz: 5a5f20c29cc1eec6aafeece4479a52c4c5a6a0ecfb0374a0b8f243551f9a7d49ecfbcf25b233ce7e19441551adcd87c5eb668ad509d4c87b0681ea1a187da6b2
7
- data.tar.gz: bccc2ad11e97d3330f2706cb9a7d32c5c0209130af88738854e6d56fb6d34b5ccfcc8b51b42633d3f359bf4c03c34d4888108528bd38c558c96ec06569c92e9d
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',
@@ -35,6 +35,8 @@
35
35
 
36
36
  require 'erb'
37
37
 
38
+
39
+ # This measure is originally from https://github.com/urbanopt/DES_HVAC
38
40
  # start the measure
39
41
  class ExportModelicaLoads < OpenStudio::Measure::ReportingMeasure
40
42
  # human readable name
@@ -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
- # +new_end_use+ - _EndUse_ - An object of EndUse class.
156
+ # +other+ - _EndUse_ - An object of EndUse class.
137
157
  ##
138
- def merge_end_use!(new_end_use)
139
- @heating += new_end_use.heating if new_end_use.heating
140
- @cooling += new_end_use.cooling if new_end_use.cooling
141
- @interior_lighting += new_end_use.interior_lighting if new_end_use.interior_lighting
142
- @exterior_lighting += new_end_use.exterior_lighting if new_end_use.exterior_lighting
143
- @interior_equipment += new_end_use.interior_equipment if new_end_use.interior_equipment
144
- @exterior_equipment += new_end_use.exterior_equipment if new_end_use.exterior_equipment
145
- @fans += new_end_use.fans if new_end_use.fans
146
- @pumps += new_end_use.pumps if new_end_use.pumps
147
- @heat_rejection += new_end_use.heat_rejection if new_end_use.heat_rejection
148
- @humidification += new_end_use.humidification if new_end_use.humidification
149
- @heat_recovery += new_end_use.heat_recovery if new_end_use.heat_recovery
150
- @water_systems += new_end_use.water_systems if new_end_use.water_systems
151
- @refrigeration += new_end_use.refrigeration if new_end_use.refrigeration
152
- @generators += new_end_use.generators if new_end_use.generators
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 file_name == 'default_scenario_report'
189
- file_name = 'default_feature_report'
190
- end
191
- #save the feature reports csv and json data
192
- @feature_reports.each do |feature_report|
193
- feature_report.save file_name
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
@@ -10,6 +10,7 @@ Heating:Electricity
10
10
  InteriorLights:Electricity
11
11
  ExteriorLights:Electricity
12
12
  InteriorEquipment:Electricity
13
+ ExteriorEquipment:Electricity
13
14
  Fans:Electricity
14
15
  Pumps:Electricity
15
16
  WaterSystems:Electricity
@@ -433,6 +433,9 @@
433
433
  "exterior_equipment": {
434
434
  "type": "number"
435
435
  },
436
+ "electric_vehicles": {
437
+ "type": "number"
438
+ },
436
439
  "fans": {
437
440
  "type": "number"
438
441
  },
@@ -901,4 +904,4 @@
901
904
  }
902
905
  }
903
906
  }
904
- }
907
+ }
@@ -30,6 +30,6 @@
30
30
 
31
31
  module URBANopt
32
32
  module Reporting
33
- VERSION = '0.3.4'.freeze
33
+ VERSION = '0.3.5'.freeze
34
34
  end
35
35
  end
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
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-01-15 00:00:00.000000000 Z
12
+ date: 2021-02-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler