urbanopt-reporting 0.4.2 → 0.6.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.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +21 -1
  3. data/LICENSE.md +17 -17
  4. data/doc_templates/LICENSE.md +17 -17
  5. data/doc_templates/copyright_erb.txt +2 -2
  6. data/doc_templates/copyright_js.txt +2 -2
  7. data/doc_templates/copyright_ruby.txt +1 -1
  8. data/docs/package-lock.json +15717 -1407
  9. data/lib/measures/.rubocop.yml +4 -2
  10. data/lib/measures/default_feature_reports/measure.rb +101 -36
  11. data/lib/measures/export_modelica_loads/measure.rb +2 -1
  12. data/lib/measures/export_time_series_modelica/measure.rb +58 -59
  13. data/lib/measures/export_time_series_modelica/resources/os_lib_helper_methods.rb +3 -5
  14. data/lib/urbanopt/reporting/default_reports/construction_cost.rb +2 -1
  15. data/lib/urbanopt/reporting/default_reports/date.rb +2 -1
  16. data/lib/urbanopt/reporting/default_reports/distributed_generation.rb +25 -7
  17. data/lib/urbanopt/reporting/default_reports/end_use.rb +1 -1
  18. data/lib/urbanopt/reporting/default_reports/end_uses.rb +2 -1
  19. data/lib/urbanopt/reporting/default_reports/extension.rb +1 -1
  20. data/lib/urbanopt/reporting/default_reports/feature_report.rb +9 -8
  21. data/lib/urbanopt/reporting/default_reports/generator.rb +1 -2
  22. data/lib/urbanopt/reporting/default_reports/location.rb +2 -1
  23. data/lib/urbanopt/reporting/default_reports/logger.rb +2 -2
  24. data/lib/urbanopt/reporting/default_reports/power_distribution.rb +22 -6
  25. data/lib/urbanopt/reporting/default_reports/program.rb +2 -1
  26. data/lib/urbanopt/reporting/default_reports/reporting_period.rb +30 -7
  27. data/lib/urbanopt/reporting/default_reports/scenario_power_distribution.rb +148 -0
  28. data/lib/urbanopt/reporting/default_reports/scenario_report.rb +20 -14
  29. data/lib/urbanopt/reporting/default_reports/schema/scenario_csv_columns.txt +18 -0
  30. data/lib/urbanopt/reporting/default_reports/schema/scenario_schema.json +240 -6
  31. data/lib/urbanopt/reporting/default_reports/solar_pv.rb +42 -3
  32. data/lib/urbanopt/reporting/default_reports/storage.rb +1 -1
  33. data/lib/urbanopt/reporting/default_reports/thermal_storage.rb +1 -1
  34. data/lib/urbanopt/reporting/default_reports/timeseries_csv.rb +2 -1
  35. data/lib/urbanopt/reporting/default_reports/validator.rb +1 -1
  36. data/lib/urbanopt/reporting/default_reports/wind.rb +11 -2
  37. data/lib/urbanopt/reporting/default_reports.rb +1 -1
  38. data/lib/urbanopt/reporting/derived_extension.rb +1 -1
  39. data/lib/urbanopt/reporting/version.rb +2 -2
  40. data/lib/urbanopt/reporting.rb +1 -1
  41. data/urbanopt-reporting-gem.gemspec +3 -4
  42. metadata +16 -15
@@ -1,5 +1,5 @@
1
1
  # *********************************************************************************
2
- # URBANopt™, Copyright (c) 2019-2021, Alliance for Sustainable Energy, LLC, and other
2
+ # URBANopt™, Copyright (c) 2019-2022, Alliance for Sustainable Energy, LLC, and other
3
3
  # contributors. All rights reserved.
4
4
 
5
5
  # Redistribution and use in source and binary forms, with or without modification,
@@ -46,6 +46,7 @@ require_relative 'reporting_period'
46
46
  require_relative 'timeseries_csv'
47
47
  require_relative 'distributed_generation'
48
48
  require_relative 'validator'
49
+ require_relative 'scenario_power_distribution'
49
50
 
50
51
  require 'json'
51
52
  require 'json-schema'
@@ -62,7 +63,9 @@ module URBANopt
62
63
  class ScenarioReport
63
64
  attr_accessor :id, :name, :directory_name, :timesteps_per_hour, :number_of_not_started_simulations,
64
65
  :number_of_started_simulations, :number_of_complete_simulations, :number_of_failed_simulations,
65
- :timeseries_csv, :location, :program, :construction_costs, :reporting_periods, :feature_reports, :distributed_generation # :nodoc:
66
+ :timeseries_csv, :location, :program, :construction_costs, :reporting_periods, :feature_reports, :distributed_generation,
67
+ :scenario_power_distribution # :nodoc:
68
+
66
69
  # ScenarioReport class intializes the scenario report attributes:
67
70
  # +:id+ , +:name+ , +:directory_name+, +:timesteps_per_hour+ , +:number_of_not_started_simulations+ ,
68
71
  # +:number_of_started_simulations+ , +:number_of_complete_simulations+ , +:number_of_failed_simulations+ ,
@@ -89,10 +92,11 @@ module URBANopt
89
92
  @location = Location.new(hash[:location])
90
93
  @program = Program.new(hash[:program])
91
94
  @distributed_generation = DistributedGeneration.new(hash[:distributed_generation] || {})
95
+ @scenario_power_distribution = ScenarioPowerDistribution.new(hash[:scenario_power_distribution] || {})
92
96
 
93
97
  @construction_costs = []
94
98
  hash[:construction_costs].each do |cc|
95
- @constructiion_costs << ConstructionCost.new(cc)
99
+ @construction_costs << ConstructionCost.new(cc)
96
100
  end
97
101
 
98
102
  @reporting_periods = []
@@ -142,14 +146,14 @@ module URBANopt
142
146
  # Gets the saved JSON file path.
143
147
  ##
144
148
  def json_path
145
- File.join(@directory_name, @file_name + '.json')
149
+ File.join(@directory_name, "#{@file_name}.json")
146
150
  end
147
151
 
148
152
  ##
149
153
  # Gets the saved CSV file path.
150
154
  ##
151
155
  def csv_path
152
- File.join(@directory_name, @file_name + '.csv')
156
+ File.join(@directory_name, "#{@file_name}.csv")
153
157
  end
154
158
 
155
159
  ##
@@ -167,7 +171,7 @@ module URBANopt
167
171
  old_timeseries_path = @timeseries_csv.path
168
172
  end
169
173
 
170
- @timeseries_csv.path = File.join(@directory_name, file_name + '.csv')
174
+ @timeseries_csv.path = File.join(@directory_name, "#{file_name}.csv")
171
175
  @timeseries_csv.save_data
172
176
 
173
177
  hash = {}
@@ -177,7 +181,7 @@ module URBANopt
177
181
  hash[:feature_reports] << feature_report.to_hash
178
182
  end
179
183
 
180
- json_name_path = File.join(@directory_name, file_name + '.json')
184
+ json_name_path = File.join(@directory_name, "#{file_name}.json")
181
185
 
182
186
  File.open(json_name_path, 'w') do |f|
183
187
  f.puts JSON.pretty_generate(hash)
@@ -192,16 +196,16 @@ module URBANopt
192
196
  if !old_timeseries_path.nil?
193
197
  @timeseries_csv.path = old_timeseries_path
194
198
  else
195
- @timeseries_csv.path = File.join(@directory_name, file_name + '.csv')
199
+ @timeseries_csv.path = File.join(@directory_name, "#{file_name}.csv")
196
200
  end
197
201
 
198
202
  if save_feature_reports
199
203
  if file_name == 'default_scenario_report'
200
204
  file_name = 'default_feature_report'
201
205
  end
202
- #save the feature reports csv and json data
206
+ # save the feature reports csv and json data
203
207
  @feature_reports.each do |feature_report|
204
- feature_report.save file_name
208
+ feature_report.save file_name
205
209
  end
206
210
  end
207
211
 
@@ -228,6 +232,7 @@ module URBANopt
228
232
  result[:location] = @location.to_hash if @location
229
233
  result[:program] = @program.to_hash if @program
230
234
  result[:distributed_generation] = @distributed_generation.to_hash if @distributed_generation
235
+ result[:scenario_power_distribution] = @scenario_power_distribution.to_hash if @scenario_power_distribution
231
236
 
232
237
  result[:construction_costs] = []
233
238
  @construction_costs&.each { |cc| result[:construction_costs] << cc.to_hash }
@@ -292,13 +297,14 @@ module URBANopt
292
297
  end
293
298
 
294
299
  # check feature simulation status
295
- if feature_report.simulation_status == 'Not Started'
300
+ case feature_report.simulation_status
301
+ when 'Not Started'
296
302
  @number_of_not_started_simulations += 1
297
- elsif feature_report.simulation_status == 'Started'
303
+ when 'Started'
298
304
  @number_of_started_simulations += 1
299
- elsif feature_report.simulation_status == 'Complete'
305
+ when 'Complete'
300
306
  @number_of_complete_simulations += 1
301
- elsif feature_report.simulation_status == 'Failed'
307
+ when 'Failed'
302
308
  @number_of_failed_simulations += 1
303
309
  else
304
310
  raise "Unknown feature_report simulation_status = '#{feature_report.simulation_status}'"
@@ -50,3 +50,21 @@ Net Power
50
50
  Net Apparent Power
51
51
  Ice Thermal Storage End Fraction
52
52
  Cooling Coil Ice Thermal Storage End Fraction
53
+ Future_Annual_Emissions_Var
54
+ Future_Hourly_Emissions_Var
55
+ Historical_Annual_Emissions_Var
56
+ Historical_Hourly_Emissions_Var
57
+ Future_Annual_Emissions_Intensity_Var
58
+ Future_Hourly_Emissions_Intensity_Var
59
+ Historical_Annual_Emissions_Intensity_Var
60
+ Historical_Hourly_Emissions_Intensity_Var
61
+ Curtailed EV Power
62
+ Daily EV Charge Energy Capacity
63
+ EV Charge Ratio
64
+ Total Charged EV Energy
65
+ Total Curtailed EV Energy
66
+ Total Scheduled EV Energy
67
+ Emission Intensity Schedule Output
68
+ EV Charging Effective Schedule
69
+ EV Charging Original Schedule
70
+ EV Charging Original Load
@@ -66,6 +66,12 @@
66
66
  },
67
67
  "thermal_storage": {
68
68
  "$ref": "#/definitions/ThermalStorage"
69
+ },
70
+ "rnm_results": {
71
+ "$ref": "#definitions/RnmResults"
72
+ },
73
+ "scenario_power_distribution": {
74
+ "$ref": "#definitions/ScenarioPowerDistribution"
69
75
  }
70
76
  },
71
77
  "required": [
@@ -81,9 +87,59 @@
81
87
  ],
82
88
  "additionalProperties": false
83
89
  },
90
+ "ScenarioPowerDistribution": {
91
+ "type": "object",
92
+ "properties": {
93
+ "substations": {
94
+ "description": "Array of electrical substations",
95
+ "type": "array",
96
+ "items": {
97
+ "type": "object",
98
+ "properties": {
99
+ "nominal_voltage": {
100
+ "description": "Nominal Voltage (V)",
101
+ "type": "number"
102
+ }
103
+ }
104
+ }
105
+ },
106
+ "distribution_lines": {
107
+ "description": "Array of distribution lines",
108
+ "type": "array",
109
+ "items": {
110
+ "type": "object",
111
+ "properties": {
112
+ "length": {
113
+ "description": "Length of the line (m)",
114
+ "type": "number"
115
+ },
116
+ "ampacity": {
117
+ "description": "Maximum ampacity of the line (A)",
118
+ "type": "number"
119
+ },
120
+ "commercial_line_type": {
121
+ "description": "Array of the wire types that make up the line",
122
+ "type": "array",
123
+ "items": {
124
+ "type": "string"
125
+ }
126
+ }
127
+ }
128
+ }
129
+ }
130
+ }
131
+ },
84
132
  "DistributedGeneration": {
85
133
  "type": "object",
86
134
  "properties": {
135
+ "reopt_assumptions_file_path": {
136
+ "description": "File path of REopt assumptions file used to generate results, if known",
137
+ "type": "string"
138
+ },
139
+ "annual_renewable_electricity_pct": {
140
+ "description": "Percentage of annual renewable electricity generation",
141
+ "type": "number"
142
+ },
87
143
  "lcc_us_dollars": {
88
144
  "description": "Optimal lifecycle cost",
89
145
  "type": "number"
@@ -127,7 +183,7 @@
127
183
  "properties": {
128
184
  "size_kw": {
129
185
  "description": "rated power in kW",
130
- "type": "string"
186
+ "type": "number"
131
187
  },
132
188
  "location": {
133
189
  "description": "Location of PV. Available options are roof, ground or both.",
@@ -137,6 +193,14 @@
137
193
  "ground",
138
194
  "both"
139
195
  ]
196
+ },
197
+ "tilt": {
198
+ "description": "PV system tilt",
199
+ "type": "number"
200
+ },
201
+ "azimuth": {
202
+ "description": "PV azimuth angle",
203
+ "type": "number"
140
204
  }
141
205
  }
142
206
  },
@@ -145,6 +209,14 @@
145
209
  "properties": {
146
210
  "size_kw": {
147
211
  "description": "rated power in kW",
212
+ "type": "number"
213
+ },
214
+ "average_yearly_energy_produced_kwh": {
215
+ "description": "average yearly energy produced in kWh",
216
+ "type": "number"
217
+ },
218
+ "size_class": {
219
+ "description": "Turbine size-class. One of [residential, commercial, medium, large]",
148
220
  "type": "string"
149
221
  }
150
222
  }
@@ -154,7 +226,7 @@
154
226
  "properties": {
155
227
  "size_kw": {
156
228
  "description": "rated power in kW",
157
- "type": "string"
229
+ "type": "number"
158
230
  }
159
231
  }
160
232
  },
@@ -163,14 +235,139 @@
163
235
  "properties": {
164
236
  "size_kw": {
165
237
  "description": "rated power in kW",
166
- "type": "string"
238
+ "type": "number"
167
239
  },
168
- "size_kw": {
240
+ "size_kwh": {
169
241
  "description": "rated capacity in kWh",
170
- "type": "string"
242
+ "type": "number"
243
+ }
244
+ }
245
+ },
246
+ "RnmResults": {
247
+ "type": "object",
248
+ "properties": {
249
+ "demand_generation_planning": {
250
+ "description": "Demand generation planning",
251
+ "type": "array",
252
+ "items": {
253
+ "$ref": "#/definitions/DemandGenPlanning"
254
+ }
255
+ },
256
+ "electrical_lines_length": {
257
+ "description": "Electrical lines length",
258
+ "type": "object",
259
+ "properties": {
260
+ "low_voltage": {
261
+ "description": "Low voltage electrical lines length",
262
+ "type": "object",
263
+ "properties": {
264
+ "$ref": "#/definitions/LineLength"
265
+ }
266
+ },
267
+ "medium_voltage": {
268
+ "description": "Medium voltage electrical lines length",
269
+ "type": "object",
270
+ "properties": {
271
+ "$ref": "#/definitions/LineLength"
272
+ }
273
+ }
274
+ }
275
+ },
276
+ "distribution_transformers_capacity_kva": {
277
+ "description": "Distribution transformers capacity in kVA",
278
+ "type": "number"
279
+ },
280
+ "costs": {
281
+ "description": "Costs",
282
+ "type": "object",
283
+ "properties": {
284
+ "investment": {
285
+ "description": "Investment cost",
286
+ "type": "object",
287
+ "properties": {
288
+ "$ref": "#/definitions/RnmCost"
289
+ }
290
+ },
291
+ "yearly_maintenance": {
292
+ "description": "Yearly maintenance cost",
293
+ "type": "object",
294
+ "properties": {
295
+ "$ref": "#/definitions/RnmCost"
296
+ }
297
+ }
298
+ }
299
+ },
300
+ "reliability_indexes": {
301
+ "description": "Reliability Indexes",
302
+ "type": "object",
303
+ "properties": {
304
+ "SAIDI": {
305
+ "description": "System Average Interruption Duration Index",
306
+ "type": "number"
307
+ },
308
+ "SAIFI": {
309
+ "description": "System Average Interruption Frequency Index",
310
+ "type": "number"
311
+ }
312
+ }
313
+ }
314
+ }
315
+ },
316
+ "DemandGenPlanning": {
317
+ "type": "object",
318
+ "properties": {
319
+ "type": {
320
+ "description": "Type of demand generation planning",
321
+ "type": "string",
322
+ "enum": [
323
+ "Low Voltage (LV) Consumers",
324
+ "Medium Voltage (MV) Consumers",
325
+ "Low Voltage (LV) Distributed generators",
326
+ "Medium Voltage (MV) Distributed generators"
327
+ ]
328
+ },
329
+ "peak_demand_kw": {
330
+ "description": "Peak demand in kw for this type",
331
+ "type": "number"
332
+ },
333
+ "number_of_nodes_in_network": {
334
+ "description": "Number of nodes of this type in the network",
335
+ "type": "number"
171
336
  }
172
337
  }
173
338
  },
339
+ "LineLength": {
340
+ "overhead_mi": {
341
+ "description": "Length of overhead lines (miles)",
342
+ "type": "number"
343
+ },
344
+ "underground_mi": {
345
+ "description": "Length of underground lines (miles)",
346
+ "type": "number"
347
+ }
348
+ },
349
+ "RnmCost": {
350
+ "low_voltage_network": {
351
+ "description": "Low Voltage Network Cost ($)",
352
+ "type": "number"
353
+ },
354
+ "distribution_transformers": {
355
+ "description": "Distribution Transformers Cost ($)",
356
+ "type": "number"
357
+ },
358
+ "medium_voltage_network": {
359
+ "description": "Medium Voltage Network Cost ($)",
360
+ "type": "number"
361
+ },
362
+ "primary_substations": {
363
+ "description": "Primary Substations Cost ($)",
364
+ "type": "number"
365
+ },
366
+ "total": {
367
+ "description": "Total Cost ($)",
368
+ "type": "number"
369
+ }
370
+ },
174
371
  "FeatureReport": {
175
372
  "type": "object",
176
373
  "properties": {
@@ -371,6 +568,43 @@
371
568
  },
372
569
  "comfort_result": {
373
570
  "$ref": "#/definitions/ComfortResult"
571
+ },
572
+ "emissions": {
573
+ "type": "object",
574
+ "properties": {
575
+ "future_annual_emissions_mt": {
576
+ "description": "Future emissions in metric ton (mt) calculated based on an annual emission factor value for the selected future year",
577
+ "type": "number"
578
+ },
579
+ "future_hourly_emissions_mt": {
580
+ "description": "Future emissions in metric ton (mt) calculated based on hourly emission factor values for the selected future year",
581
+ "type": "number"
582
+ },
583
+ "historical_annual_emissions_mt": {
584
+ "description": "Historical emissions in metric ton (mt) calculated based on an annual emission factor value for the selected historical year",
585
+ "type": "number"
586
+ },
587
+ "historical_hourly_emissions_mt": {
588
+ "description": "Historical emissions in metric ton (mt) calculated based on hourly emission factor values for the selected historical year",
589
+ "type": "number"
590
+ },
591
+ "future_annual_emissions_intensity_kg_per_ft2": {
592
+ "description": "Future emissions intensity in kg/ft2 calculated based on an annual emission factor value for the selected future year",
593
+ "type": "number"
594
+ },
595
+ "future_hourly_emissions_intensity_kg_per_ft2": {
596
+ "description": "Future emissions intensity in kg/ft2 calculated based on hourly emission factor values for the selected future year",
597
+ "type": "number"
598
+ },
599
+ "historical_annual_emissions_intensity_kg_per_ft2": {
600
+ "description": "Historical emissions intensity in kg/ft2 calculated based on an annual emission factor value for the selected historical year",
601
+ "type": "number"
602
+ },
603
+ "historical_hourly_emissions_intensity_kg_per_ft2": {
604
+ "description": "Historical emissions intensity in kg.ft2 calculated based on hourly emission factor values for the selected historical year",
605
+ "type": "number"
606
+ }
607
+ }
374
608
  }
375
609
  },
376
610
  "additionalProperties": false
@@ -913,4 +1147,4 @@
913
1147
  }
914
1148
  }
915
1149
  }
916
- }
1150
+ }
@@ -1,5 +1,5 @@
1
1
  # *********************************************************************************
2
- # URBANopt™, Copyright (c) 2019-2021, Alliance for Sustainable Energy, LLC, and other
2
+ # URBANopt™, Copyright (c) 2019-2022, Alliance for Sustainable Energy, LLC, and other
3
3
  # contributors. All rights reserved.
4
4
 
5
5
  # Redistribution and use in source and binary forms, with or without modification,
@@ -52,7 +52,7 @@ module URBANopt
52
52
  # _Float_ - power capacity in kilowatts
53
53
  #
54
54
  attr_accessor :size_kw
55
- attr_accessor :location
55
+ attr_accessor :location, :tilt, :azimuth, :module_type
56
56
 
57
57
  ##
58
58
  # Initialize SolarPV attributes from a hash. Solar PV attributes currently are limited to power capacity.
@@ -67,6 +67,39 @@ module URBANopt
67
67
  @size_kw = hash[:size_kw]
68
68
  @id = hash[:id]
69
69
  @location = hash[:location]
70
+ @approx_area_m2 = 0
71
+
72
+ if hash[:azimuth]
73
+ @azimuth = hash[:azimuth]
74
+ end
75
+ if hash[:tilt]
76
+ @tilt = hash[:tilt]
77
+ end
78
+ if hash[:module_type]
79
+ @module_type = hash[:module_type]
80
+
81
+ # calculate area with PVWatts formulas
82
+ # Size (kW) = Array Area (m²) × 1 kW/m² × Module Efficiency (%)
83
+ # also grab module efficiency: 0 (standard) = 15%, 1 (premium) = 19%, 2 (thin film) = 10%
84
+ eff = 0
85
+ case @module_type
86
+ when 0
87
+ eff = 0.15
88
+ when 1
89
+ eff = 0.19
90
+ when 2
91
+ eff = 0.10
92
+ end
93
+ if @size_kw != 0
94
+ @approx_area_m2 = (@size_kw / eff).round(3)
95
+ end
96
+ end
97
+ if hash[:gcr]
98
+ @gcr = hash[:gcr]
99
+ end
100
+ if hash[:average_yearly_energy_produced_kwh]
101
+ @annual_energy_produced = hash[:average_yearly_energy_produced_kwh]
102
+ end
70
103
 
71
104
  # initialize class variables @@validator and @@schema
72
105
  @@validator ||= Validator.new
@@ -84,6 +117,12 @@ module URBANopt
84
117
 
85
118
  result[:size_kw] = @size_kw if @size_kw
86
119
  result[:location] = @location if @location
120
+ result[:azimuth] = @azimuth if @azimuth
121
+ result[:tilt] = @tilt if @tilt
122
+ result[:module_type] = @module_type if @module_type
123
+ result[:approximate_area_m2] = @approx_area_m2 if @approx_area_m2
124
+ result[:gcr] = @gcr if @gcr
125
+ result[:average_yearly_energy_produced_kwh] = @annual_energy_produced if @annual_energy_produced
87
126
 
88
127
  return result
89
128
  end
@@ -97,7 +136,7 @@ module URBANopt
97
136
  else
98
137
  existing_pv.size_kw = (existing_pv.size_kw || 0) + (new_pv.size_kw || 0)
99
138
  end
100
-
139
+ # KAF: todo, recalculate area?
101
140
  return existing_pv
102
141
  end
103
142
  end
@@ -1,5 +1,5 @@
1
1
  # *********************************************************************************
2
- # URBANopt™, Copyright (c) 2019-2021, Alliance for Sustainable Energy, LLC, and other
2
+ # URBANopt™, Copyright (c) 2019-2022, Alliance for Sustainable Energy, LLC, and other
3
3
  # contributors. All rights reserved.
4
4
 
5
5
  # Redistribution and use in source and binary forms, with or without modification,
@@ -1,5 +1,5 @@
1
1
  # *********************************************************************************
2
- # URBANopt™, Copyright (c) 2019-2021, Alliance for Sustainable Energy, LLC, and other
2
+ # URBANopt™, Copyright (c) 2019-2022, Alliance for Sustainable Energy, LLC, and other
3
3
  # contributors. All rights reserved.
4
4
 
5
5
  # Redistribution and use in source and binary forms, with or without modification,
@@ -1,5 +1,5 @@
1
1
  # *********************************************************************************
2
- # URBANopt™, Copyright (c) 2019-2021, Alliance for Sustainable Energy, LLC, and other
2
+ # URBANopt™, Copyright (c) 2019-2022, Alliance for Sustainable Energy, LLC, and other
3
3
  # contributors. All rights reserved.
4
4
 
5
5
  # Redistribution and use in source and binary forms, with or without modification,
@@ -291,6 +291,7 @@ module URBANopt
291
291
  if current_values.size != new_values.size
292
292
  raise 'Values of different sizes in add_timeseries_csv'
293
293
  end
294
+
294
295
  new_values.each_with_index do |value, i|
295
296
  # aggregate all columns except Datime column
296
297
  if column_name != 'Datetime'
@@ -1,5 +1,5 @@
1
1
  # *********************************************************************************
2
- # URBANopt™, Copyright (c) 2019-2021, Alliance for Sustainable Energy, LLC, and other
2
+ # URBANopt™, Copyright (c) 2019-2022, Alliance for Sustainable Energy, LLC, and other
3
3
  # contributors. All rights reserved.
4
4
 
5
5
  # Redistribution and use in source and binary forms, with or without modification,
@@ -1,5 +1,5 @@
1
1
  # *********************************************************************************
2
- # URBANopt™, Copyright (c) 2019-2021, Alliance for Sustainable Energy, LLC, and other
2
+ # URBANopt™, Copyright (c) 2019-2022, Alliance for Sustainable Energy, LLC, and other
3
3
  # contributors. All rights reserved.
4
4
 
5
5
  # Redistribution and use in source and binary forms, with or without modification,
@@ -51,7 +51,7 @@ module URBANopt
51
51
  ##
52
52
  # _Float_ - power capacity in kilowatts
53
53
  #
54
- attr_accessor :size_kw
54
+ attr_accessor :size_kw, :average_yearly_energy_produced_kwh, :size_class
55
55
 
56
56
  ##
57
57
  # Initialize Wind attributes from a hash. Wind attributes currently are limited to power capacity.
@@ -64,6 +64,8 @@ module URBANopt
64
64
  hash.delete_if { |k, v| v.nil? }
65
65
 
66
66
  @size_kw = hash[:size_kw]
67
+ @avg_energy_kwh = hash[:average_yearly_energy_produced_kwh]
68
+ @size_class = hash[:size_class]
67
69
 
68
70
  # initialize class variables @@validator and @@schema
69
71
  @@validator ||= Validator.new
@@ -80,6 +82,8 @@ module URBANopt
80
82
  result = {}
81
83
 
82
84
  result[:size_kw] = @size_kw if @size_kw
85
+ result[:average_yearly_energy_produced_kwh] = @avg_energy_kwh if @avg_energy_kwh
86
+ result[:size_class] = @size_class if @size_class
83
87
 
84
88
  return result
85
89
  end
@@ -93,6 +97,11 @@ module URBANopt
93
97
  else
94
98
  existing_wind.size_kw = (existing_wind.size_kw || 0) + (new_wind.size_kw || 0)
95
99
  end
100
+ if existing_wind.average_yearly_energy_produced_kwh.nil? && new_wind.average_yearly_energy_produced_kwh.nil?
101
+ existing_wind.average_yearly_energy_produced_kwh = nil
102
+ else
103
+ existing_wind.average_yearly_energy_produced_kwh = (existing_wind.average_yearly_energy_produced_kwh || 0) + (new_wind.average_yearly_energy_produced_kwh || 0)
104
+ end
96
105
 
97
106
  return existing_wind
98
107
  end
@@ -1,5 +1,5 @@
1
1
  # *********************************************************************************
2
- # URBANopt™, Copyright (c) 2019-2021, Alliance for Sustainable Energy, LLC, and other
2
+ # URBANopt™, Copyright (c) 2019-2022, Alliance for Sustainable Energy, LLC, and other
3
3
  # contributors. All rights reserved.
4
4
 
5
5
  # Redistribution and use in source and binary forms, with or without modification,
@@ -1,5 +1,5 @@
1
1
  # *********************************************************************************
2
- # URBANopt™, Copyright (c) 2019-2021, Alliance for Sustainable Energy, LLC, and other
2
+ # URBANopt™, Copyright (c) 2019-2022, Alliance for Sustainable Energy, LLC, and other
3
3
  # contributors. All rights reserved.
4
4
 
5
5
  # Redistribution and use in source and binary forms, with or without modification,
@@ -1,5 +1,5 @@
1
1
  # *********************************************************************************
2
- # URBANopt™, Copyright (c) 2019-2021, Alliance for Sustainable Energy, LLC, and other
2
+ # URBANopt™, Copyright (c) 2019-2022, Alliance for Sustainable Energy, LLC, and other
3
3
  # contributors. All rights reserved.
4
4
 
5
5
  # Redistribution and use in source and binary forms, with or without modification,
@@ -40,6 +40,6 @@
40
40
 
41
41
  module URBANopt
42
42
  module Reporting
43
- VERSION = '0.4.2'.freeze
43
+ VERSION = '0.6.0'.freeze
44
44
  end
45
45
  end
@@ -1,5 +1,5 @@
1
1
  # *********************************************************************************
2
- # URBANopt™, Copyright (c) 2019-2021, Alliance for Sustainable Energy, LLC, and other
2
+ # URBANopt™, Copyright (c) 2019-2022, Alliance for Sustainable Energy, LLC, and other
3
3
  # contributors. All rights reserved.
4
4
 
5
5
  # Redistribution and use in source and binary forms, with or without modification,
@@ -1,4 +1,3 @@
1
-
2
1
  lib = File.expand_path('lib', __dir__)
3
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
3
  require 'urbanopt/reporting/version'
@@ -26,8 +25,8 @@ Gem::Specification.new do |spec|
26
25
 
27
26
  spec.add_development_dependency 'bundler', '>= 2.1.0'
28
27
  spec.add_development_dependency 'rake', '~> 13.0'
29
- spec.add_development_dependency 'rspec', '~> 3.7'
30
- spec.add_runtime_dependency 'json-schema', '~> 2.8'
28
+ spec.add_development_dependency 'rspec', '~> 3.9'
31
29
  spec.add_runtime_dependency 'json_pure', '~> 2.3'
32
- spec.add_runtime_dependency 'openstudio-extension', '~> 0.4.3'
30
+ spec.add_runtime_dependency 'json-schema', '~> 2.8'
31
+ spec.add_runtime_dependency 'openstudio-extension', '~> 0.5.1'
33
32
  end