urbanopt-reporting 0.9.1 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/nightly_ci_build.yml +1 -0
- data/CHANGELOG.md +9 -0
- data/lib/measures/export_modelica_loads/measure.xml +1 -1
- data/lib/urbanopt/reporting/default_reports/distributed_generation.rb +65 -65
- data/lib/urbanopt/reporting/default_reports/feature_report.rb +1 -2
- data/lib/urbanopt/reporting/default_reports/qaqc_flags.rb +4 -11
- data/lib/urbanopt/reporting/default_reports/reporting_period.rb +7 -7
- data/lib/urbanopt/reporting/default_reports/scenario_power_distribution_cost.rb +162 -166
- data/lib/urbanopt/reporting/default_reports/schema/scenario_schema.json +55 -14
- 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: '09a91049832525b175fdf4dacdd43861183d07284a773e3edc942daf46c2e69f'
|
4
|
+
data.tar.gz: a3ad57f274c24e9105240ce4c70e038e562d65dc5f58cae3c5ab40fa800a9733
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cef7169b7257bc0b59a8bafad086e3c55bde3f0f9ed8f353d2f3d6abf7af8a95cb36e167316f85a8aee58aeafd66abcfa54636370165e0e17908ac3d8e854fb6
|
7
|
+
data.tar.gz: 56694ad3398c8198f37dac1ceee0ccfd03d15960645cbaa527f73b5c2a000d771790448db78f547f84f83bc41e38e032473f8466ff1fd1972764785e67fcf9ec
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
# URBANopt Reporting Gem
|
2
2
|
|
3
|
+
## Version 0.10.0
|
4
|
+
## What's Changed
|
5
|
+
* Additional reporting tests by @vtnate in https://github.com/urbanopt/urbanopt-reporting-gem/pull/147
|
6
|
+
* Update formatting and version in export_modelica_loads by @nllong in https://github.com/urbanopt/urbanopt-reporting-gem/pull/149
|
7
|
+
* Update feature reports for Reopt v3 by @vtnate in https://github.com/urbanopt/urbanopt-reporting-gem/pull/148
|
8
|
+
|
9
|
+
|
10
|
+
**Full Changelog**: https://github.com/urbanopt/urbanopt-reporting-gem/compare/v0.9.1...0.10.0
|
11
|
+
|
3
12
|
## Version 0.9.1
|
4
13
|
* downgrade json-schema to 2.7 by @vtnate in https://github.com/urbanopt/urbanopt-reporting-gem/pull/145
|
5
14
|
|
@@ -20,67 +20,67 @@ module URBANopt
|
|
20
20
|
##
|
21
21
|
# _Float_ - Lifecycle costs for the complete distributed generation system in US Dollars
|
22
22
|
#
|
23
|
-
attr_accessor :
|
23
|
+
attr_accessor :lcc
|
24
24
|
|
25
25
|
##
|
26
26
|
# _Float_ - Lifecycle costs for the complete distributed generation system in US Dollars
|
27
27
|
#
|
28
|
-
attr_accessor :
|
28
|
+
attr_accessor :lcc_bau
|
29
29
|
|
30
30
|
##
|
31
31
|
# _Float_ - Net present value of the complete distributed generation system in US Dollars
|
32
32
|
#
|
33
|
-
attr_accessor :
|
33
|
+
attr_accessor :npv
|
34
34
|
|
35
35
|
##
|
36
36
|
# _Float_ - Total amount paid for utility energy in US Dollars in the first year of operation
|
37
37
|
#
|
38
|
-
attr_accessor :
|
38
|
+
attr_accessor :year_one_energy_cost_before_tax
|
39
39
|
|
40
40
|
##
|
41
41
|
# _Float_ - Total amount paid in utility demand charges in US Dollars in the first year of operation
|
42
42
|
#
|
43
|
-
attr_accessor :
|
43
|
+
attr_accessor :year_one_demand_cost_before_tax
|
44
44
|
|
45
45
|
##
|
46
46
|
# _Float_ - Total amount paid to the utility in US Dollars in the first year of operation
|
47
47
|
#
|
48
|
-
attr_accessor :
|
48
|
+
attr_accessor :year_one_bill_before_tax
|
49
49
|
|
50
50
|
##
|
51
51
|
# _Float_ - Total energy costs in US Dollars over the life of the system after tax
|
52
52
|
#
|
53
|
-
attr_accessor :
|
53
|
+
attr_accessor :lifecycle_energy_cost_after_tax
|
54
54
|
|
55
55
|
##
|
56
56
|
# _Float_ - Total demand costs in US Dollars over the life of the system after tax
|
57
57
|
#
|
58
|
-
attr_accessor :
|
58
|
+
attr_accessor :lifecycle_demand_cost_after_tax
|
59
59
|
|
60
60
|
##
|
61
|
-
# _Float_ - Year one energy cost in the business as usual scenario (i.e no new system)
|
61
|
+
# _Float_ - Year one energy cost in the business as usual scenario (i.e no new system) before tax, us dollars
|
62
62
|
#
|
63
|
-
attr_accessor :
|
63
|
+
attr_accessor :year_one_energy_cost_before_tax_bau
|
64
64
|
|
65
65
|
##
|
66
66
|
# _Float_ - Year one demand cost in the business as usual scenario (i.e no new system), us dollars
|
67
67
|
#
|
68
|
-
attr_accessor :
|
68
|
+
attr_accessor :year_one_demand_cost_before_tax_bau
|
69
69
|
|
70
70
|
##
|
71
71
|
# _Float_ - Year one demand energy bill in the business as usual scenario (i.e no new system), us dollars
|
72
72
|
#
|
73
|
-
attr_accessor :
|
73
|
+
attr_accessor :year_one_bill_before_tax_bau
|
74
74
|
|
75
75
|
##
|
76
76
|
# _Float_ - Total lifetime demand costs in the business as usual scenario (i.e no new system) after tax, us dollars
|
77
77
|
#
|
78
|
-
attr_accessor :
|
78
|
+
attr_accessor :lifecycle_demand_cost_after_tax_bau
|
79
79
|
|
80
80
|
##
|
81
81
|
# _Float_ - Total lifetime energy costs in the business as usual scenario (i.e no new system) after tax, us dollars
|
82
82
|
#
|
83
|
-
attr_accessor :
|
83
|
+
attr_accessor :lifecycle_energy_cost_after_tax_bau
|
84
84
|
|
85
85
|
##
|
86
86
|
# _Array_ - List of _SolarPV_ systems
|
@@ -162,16 +162,16 @@ module URBANopt
|
|
162
162
|
attr_accessor :reopt_assumptions_file_path
|
163
163
|
|
164
164
|
##
|
165
|
-
# _Float_ - Annual
|
165
|
+
# _Float_ - Annual fraction of electricity supplied by renewable sources
|
166
166
|
#
|
167
|
-
attr_accessor :
|
167
|
+
attr_accessor :renewable_electricity_fraction
|
168
168
|
|
169
169
|
##
|
170
170
|
# Initialize distributed generation system design and financial metrics.
|
171
171
|
#
|
172
172
|
# * Technologies include +:solar_pv+, +:wind+, +:generator+, and +:storage+.
|
173
|
-
# * Financial metrics include +:
|
174
|
-
# +:
|
173
|
+
# * Financial metrics include +:lcc+, +:npv+, +:year_one_energy_cost_before_tax+, +:year_one_demand_cost_before_tax+,
|
174
|
+
# +:year_one_bill_before_tax+, and +:lifecycle_energy_cost_after_tax+
|
175
175
|
##
|
176
176
|
# [parameters:]
|
177
177
|
#
|
@@ -180,20 +180,20 @@ module URBANopt
|
|
180
180
|
def initialize(hash = {})
|
181
181
|
hash.delete_if { |k, v| v.nil? }
|
182
182
|
|
183
|
-
@
|
184
|
-
@
|
185
|
-
@
|
186
|
-
@
|
187
|
-
@
|
188
|
-
@
|
189
|
-
@
|
190
|
-
@
|
191
|
-
@
|
192
|
-
@
|
193
|
-
@
|
194
|
-
@
|
195
|
-
@
|
196
|
-
@
|
183
|
+
@renewable_electricity_fraction = hash[:renewable_electricity_fraction]
|
184
|
+
@lcc = hash[:lcc]
|
185
|
+
@lcc_bau = hash[:lcc_bau]
|
186
|
+
@npv = hash[:npv]
|
187
|
+
@year_one_energy_cost_before_tax = hash[:year_one_energy_cost_before_tax]
|
188
|
+
@year_one_energy_cost_before_tax_bau = hash[:year_one_energy_cost_before_tax_bau]
|
189
|
+
@year_one_demand_cost_before_tax = hash[:year_one_demand_cost_before_tax]
|
190
|
+
@year_one_demand_cost_before_tax_bau = hash[:year_one_demand_cost_before_tax_bau]
|
191
|
+
@year_one_bill_before_tax = hash[:year_one_bill_before_tax]
|
192
|
+
@year_one_bill_before_tax_bau = hash[:year_one_bill_before_tax_bau]
|
193
|
+
@lifecycle_energy_cost_after_tax = hash[:lifecycle_energy_cost_after_tax]
|
194
|
+
@lifecycle_energy_cost_after_tax_bau = hash[:lifecycle_energy_cost_after_tax_bau]
|
195
|
+
@lifecycle_demand_cost_after_tax = hash[:lifecycle_demand_cost_after_tax]
|
196
|
+
@lifecycle_demand_cost_after_tax_bau = hash[:lifecycle_demand_cost_after_tax_bau]
|
197
197
|
|
198
198
|
@resilience_hours_min = hash[:resilience_hours_min]
|
199
199
|
@resilience_hours_max = hash[:resilience_hours_max]
|
@@ -345,22 +345,22 @@ module URBANopt
|
|
345
345
|
def to_hash
|
346
346
|
result = {}
|
347
347
|
result[:reopt_assumptions_file_path] = @reopt_assumptions_file_path if @reopt_assumptions_file_path
|
348
|
-
result[:
|
349
|
-
result[:
|
350
|
-
result[:
|
351
|
-
result[:
|
352
|
-
|
353
|
-
result[:
|
354
|
-
result[:
|
355
|
-
result[:
|
356
|
-
result[:
|
357
|
-
result[:
|
358
|
-
|
359
|
-
result[:
|
360
|
-
result[:
|
361
|
-
result[:
|
362
|
-
result[:
|
363
|
-
result[:
|
348
|
+
result[:renewable_electricity_fraction] = @renewable_electricity_fraction if @renewable_electricity_fraction
|
349
|
+
result[:lcc] = @lcc if @lcc
|
350
|
+
result[:lcc_bau] = @lcc_bau if @lcc_bau
|
351
|
+
result[:npv] = @npv if @npv
|
352
|
+
|
353
|
+
result[:year_one_energy_cost_before_tax] = @year_one_energy_cost_before_tax if @year_one_energy_cost_before_tax
|
354
|
+
result[:year_one_demand_cost_before_tax] = @year_one_demand_cost_before_tax if @year_one_demand_cost_before_tax
|
355
|
+
result[:year_one_bill_before_tax] = @year_one_bill_before_tax if @year_one_bill_before_tax
|
356
|
+
result[:lifecycle_demand_cost_after_tax] = @lifecycle_demand_cost_after_tax if @lifecycle_demand_cost_after_tax
|
357
|
+
result[:lifecycle_energy_cost_after_tax] = @lifecycle_energy_cost_after_tax if @lifecycle_energy_cost_after_tax
|
358
|
+
|
359
|
+
result[:year_one_energy_cost_before_tax_bau] = @year_one_energy_cost_before_tax_bau if @year_one_energy_cost_before_tax_bau
|
360
|
+
result[:year_one_demand_cost_before_tax_bau] = @year_one_demand_cost_before_tax_bau if @year_one_demand_cost_before_tax_bau
|
361
|
+
result[:year_one_bill_before_tax_bau] = @year_one_bill_before_tax_bau if @year_one_bill_before_tax_bau
|
362
|
+
result[:lifecycle_energy_cost_after_tax_bau] = @lifecycle_energy_cost_after_tax_bau if @lifecycle_energy_cost_after_tax_bau
|
363
|
+
result[:lifecycle_demand_cost_after_tax_bau] = @lifecycle_demand_cost_after_tax_bau if @lifecycle_demand_cost_after_tax_bau
|
364
364
|
|
365
365
|
result[:total_solar_pv_kw] = @total_solar_pv_kw if @total_solar_pv_kw
|
366
366
|
result[:total_wind_kw] = @total_wind_kw if @total_wind_kw
|
@@ -415,22 +415,22 @@ module URBANopt
|
|
415
415
|
# Merge a distributed generation system with a new system
|
416
416
|
##
|
417
417
|
def self.merge_distributed_generation(existing_dgen, new_dgen)
|
418
|
-
existing_dgen.
|
419
|
-
existing_dgen.
|
420
|
-
existing_dgen.
|
421
|
-
existing_dgen.
|
422
|
-
|
423
|
-
existing_dgen.
|
424
|
-
existing_dgen.
|
425
|
-
existing_dgen.
|
426
|
-
existing_dgen.
|
427
|
-
existing_dgen.
|
428
|
-
|
429
|
-
existing_dgen.
|
430
|
-
existing_dgen.
|
431
|
-
existing_dgen.
|
432
|
-
existing_dgen.
|
433
|
-
existing_dgen.
|
418
|
+
existing_dgen.renewable_electricity_fraction = add_values(existing_dgen.renewable_electricity_fraction, new_dgen.renewable_electricity_fraction)
|
419
|
+
existing_dgen.lcc = add_values(existing_dgen.lcc, new_dgen.lcc)
|
420
|
+
existing_dgen.lcc_bau = add_values(existing_dgen.lcc_bau, new_dgen.lcc_bau)
|
421
|
+
existing_dgen.npv = add_values(existing_dgen.npv, new_dgen.npv)
|
422
|
+
|
423
|
+
existing_dgen.year_one_energy_cost_before_tax = add_values(existing_dgen.year_one_energy_cost_before_tax, new_dgen.year_one_energy_cost_before_tax)
|
424
|
+
existing_dgen.year_one_demand_cost_before_tax = add_values(existing_dgen.year_one_demand_cost_before_tax, new_dgen.year_one_demand_cost_before_tax)
|
425
|
+
existing_dgen.year_one_bill_before_tax = add_values(existing_dgen.year_one_bill_before_tax, new_dgen.year_one_bill_before_tax)
|
426
|
+
existing_dgen.lifecycle_energy_cost_after_tax = add_values(existing_dgen.lifecycle_energy_cost_after_tax, new_dgen.lifecycle_energy_cost_after_tax)
|
427
|
+
existing_dgen.lifecycle_demand_cost_after_tax = add_values(existing_dgen.lifecycle_demand_cost_after_tax, new_dgen.lifecycle_demand_cost_after_tax)
|
428
|
+
|
429
|
+
existing_dgen.year_one_energy_cost_before_tax_bau = add_values(existing_dgen.year_one_energy_cost_before_tax_bau, new_dgen.year_one_energy_cost_before_tax_bau)
|
430
|
+
existing_dgen.year_one_demand_cost_before_tax_bau = add_values(existing_dgen.year_one_demand_cost_before_tax_bau, new_dgen.year_one_demand_cost_before_tax_bau)
|
431
|
+
existing_dgen.year_one_bill_before_tax_bau = add_values(existing_dgen.year_one_bill_before_tax_bau, new_dgen.year_one_bill_before_tax_bau)
|
432
|
+
existing_dgen.lifecycle_energy_cost_after_tax_bau = add_values(existing_dgen.lifecycle_energy_cost_after_tax_bau, new_dgen.lifecycle_energy_cost_after_tax_bau)
|
433
|
+
existing_dgen.lifecycle_demand_cost_after_tax_bau = add_values(existing_dgen.lifecycle_demand_cost_after_tax_bau, new_dgen.lifecycle_demand_cost_after_tax_bau)
|
434
434
|
|
435
435
|
existing_dgen.resilience_hours_min = add_values(existing_dgen.resilience_hours_min, new_dgen.resilience_hours_min)
|
436
436
|
existing_dgen.resilience_hours_max = add_values(existing_dgen.resilience_hours_max, new_dgen.resilience_hours_max)
|
@@ -470,7 +470,7 @@ module URBANopt
|
|
470
470
|
|
471
471
|
new_dgen.generator.each do |generator|
|
472
472
|
existing_dgen.generator.push generator
|
473
|
-
if existing_dgen.
|
473
|
+
if existing_dgen.total_generator_kw.nil?
|
474
474
|
existing_dgen.total_generator_kw = generator.size_kw
|
475
475
|
else
|
476
476
|
existing_dgen.total_generator_kw += generator.size_kw
|
@@ -55,7 +55,7 @@ module URBANopt
|
|
55
55
|
# design_parameters to add later
|
56
56
|
@construction_costs = []
|
57
57
|
hash[:construction_costs].each do |cc|
|
58
|
-
@
|
58
|
+
@construction_costs << ConstructionCost.new(cc)
|
59
59
|
end
|
60
60
|
|
61
61
|
@reporting_periods = []
|
@@ -212,7 +212,6 @@ module URBANopt
|
|
212
212
|
def save(file_name = 'default_feature_report')
|
213
213
|
# reassign the initialize local variable @file_name to the file name input.
|
214
214
|
@file_name = file_name
|
215
|
-
|
216
215
|
# save the feature reports csv and json data
|
217
216
|
old_timeseries_path = nil
|
218
217
|
if !@timeseries_csv.path.nil?
|
@@ -16,9 +16,9 @@ module URBANopt
|
|
16
16
|
##
|
17
17
|
# _Hash_ - Hash of flags raised by QAQC measure for this feature during this reporting period
|
18
18
|
#
|
19
|
-
attr_accessor :eui_reasonableness
|
20
|
-
:simultaneous_heating_and_cooling
|
21
|
-
:domestic_hot_water
|
19
|
+
attr_accessor :eui_reasonableness, :end_use_by_category, :mechanical_system_part_load_efficiency,
|
20
|
+
:simultaneous_heating_and_cooling, :internal_loads, :schedules, :envelope_r_value,
|
21
|
+
:domestic_hot_water, :mechanical_system_efficiency, :supply_and_zone_air_temperature,
|
22
22
|
:total_qaqc_flags
|
23
23
|
|
24
24
|
##
|
@@ -46,14 +46,11 @@ module URBANopt
|
|
46
46
|
@mechanical_system_efficiency = hash[:mechanical_system_efficiency]
|
47
47
|
@total_qaqc_flags = hash[:total_qaqc_flags]
|
48
48
|
|
49
|
-
|
50
49
|
# initialize class variables @@validator and @@schema
|
51
50
|
@@validator ||= Validator.new
|
52
51
|
@@schema ||= @@validator.schema
|
53
|
-
|
54
52
|
end
|
55
53
|
|
56
|
-
|
57
54
|
##
|
58
55
|
# Assigns default values if values do not exist.
|
59
56
|
##
|
@@ -72,9 +69,9 @@ module URBANopt
|
|
72
69
|
hash[:mechanical_system_efficiency] = nil
|
73
70
|
hash[:total_qaqc_flags] = nil
|
74
71
|
|
75
|
-
|
76
72
|
return hash
|
77
73
|
end
|
74
|
+
|
78
75
|
##
|
79
76
|
# Convert to a Hash equivalent for JSON serialization
|
80
77
|
##
|
@@ -99,7 +96,6 @@ module URBANopt
|
|
99
96
|
end
|
100
97
|
|
101
98
|
return result
|
102
|
-
|
103
99
|
end
|
104
100
|
|
105
101
|
##
|
@@ -126,7 +122,6 @@ module URBANopt
|
|
126
122
|
# +other+ - _QAQC_ - An object of Program class.
|
127
123
|
##
|
128
124
|
def add_qaqc_flags(other)
|
129
|
-
|
130
125
|
@eui_reasonableness = add_values(@eui_reasonableness, other.eui_reasonableness)
|
131
126
|
@end_use_by_category = add_values(@end_use_by_category, other.end_use_by_category)
|
132
127
|
@mechanical_system_part_load_efficiency = add_values(@mechanical_system_part_load_efficiency, other.mechanical_system_part_load_efficiency)
|
@@ -138,9 +133,7 @@ module URBANopt
|
|
138
133
|
@domestic_hot_water = add_values(@domestic_hot_water, other.domestic_hot_water)
|
139
134
|
@mechanical_system_efficiency = add_values(@mechanical_system_efficiency, other.mechanical_system_efficiency)
|
140
135
|
@total_qaqc_flags = add_values(@total_qaqc_flags, other.total_qaqc_flags)
|
141
|
-
|
142
136
|
end
|
143
|
-
|
144
137
|
end
|
145
138
|
end
|
146
139
|
end
|
@@ -24,9 +24,9 @@ module URBANopt
|
|
24
24
|
:fuel_type, :total_cost_dollar, :usage_cost_dollar, :demand_cost_dollar, :comfort_result, :time_setpoint_not_met_during_occupied_cooling,
|
25
25
|
:time_setpoint_not_met_during_occupied_heating, :time_setpoint_not_met_during_occupied_hours, :hours_out_of_comfort_bounds_PMV, :hours_out_of_comfort_bounds_PPD,
|
26
26
|
:emissions, :future_annual_electricity_emissions_mt, :future_hourly_electricity_emissions_mt, :historical_annual_electricity_emissions_mt, :historical_hourly_electricity_emissions_mt,
|
27
|
-
:future_annual_electricity_emissions_intensity_kg_per_ft2, :future_hourly_electricity_emissions_intensity_kg_per_ft2, :historical_annual_electricity_emissions_intensity_kg_per_ft2, :historical_hourly_electricity_emissions_intensity_kg_per_ft2
|
27
|
+
:future_annual_electricity_emissions_intensity_kg_per_ft2, :future_hourly_electricity_emissions_intensity_kg_per_ft2, :historical_annual_electricity_emissions_intensity_kg_per_ft2, :historical_hourly_electricity_emissions_intensity_kg_per_ft2,
|
28
28
|
:natural_gas_emissions_mt, :natural_gas_emissions_intensity_kg_per_ft2, :propane_emissions_mt, :propane_emissions_intensity_kg_per_ft2,
|
29
|
-
:fueloil_no2_emissions_mt, :fueloil_no2_emissions_intensity_kg_per_ft2
|
29
|
+
:fueloil_no2_emissions_mt, :fueloil_no2_emissions_intensity_kg_per_ft2 #:nodoc:
|
30
30
|
|
31
31
|
# ReportingPeriod class initializes the reporting period attributes:
|
32
32
|
# +:id+ , +:name+ , +:multiplier+ , +:start_date+ , +:end_date+ , +:month+ , +:day_of_month+ , +:year+ , +:total_site_energy_kwh+ , +:total_source_energy_kwh+ , +:site_EUI_kwh_per_m2+, +:site_EUI_kbtu_per_ft2+, +:source_EUI_kwh_per_m2+, +:source_EUI_kbtu_per_ft2+,
|
@@ -123,11 +123,11 @@ module URBANopt
|
|
123
123
|
hash[:comfort_result] = { time_setpoint_not_met_during_occupied_cooling: nil, time_setpoint_not_met_during_occupied_heating: nil,
|
124
124
|
time_setpoint_not_met_during_occupied_hours: nil, hours_out_of_comfort_bounds_PMV: nil, hours_out_of_comfort_bounds_PPD: nil }
|
125
125
|
hash[:emissions] = { future_annual_electricity_emissions_mt: nil, future_hourly_electricity_emissions_mt: nil, historical_annual_electricity_emissions_mt: nil,
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
126
|
+
historical_hourly_electricity_emissions_mt: nil, future_annual_electricity_emissions_intensity_kg_per_ft2: nil,
|
127
|
+
future_hourly_electricity_emissions_intensity_kg_per_ft2: nil, historical_annual_electricity_emissions_intensity_kg_per_ft2: nil,
|
128
|
+
historical_hourly_electricity_emissions_intensity_kg_per_ft2: nil, natural_gas_emissions_mt: nil,
|
129
|
+
natural_gas_emissions_intensity_kg_per_ft2: nil, propane_emissions_mt: nil, propane_emissions_intensity_kg_per_ft2: nil,
|
130
|
+
fueloil_no2_emissions_mt: nil, fueloil_no2_emissions_intensity_kg_per_ft2: nil }
|
131
131
|
|
132
132
|
return hash
|
133
133
|
end
|
@@ -9,169 +9,165 @@ require 'json'
|
|
9
9
|
require 'json-schema'
|
10
10
|
|
11
11
|
module URBANopt
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
end # DefaultReports
|
176
|
-
end # Reporting
|
177
|
-
end # URBANopt
|
12
|
+
module Reporting
|
13
|
+
module DefaultReports
|
14
|
+
##
|
15
|
+
# scenario_power_distribution_cost include eletrical power distribution system violation and
|
16
|
+
# upgrade cost information.
|
17
|
+
##
|
18
|
+
class ScenarioPowerDistributionCost
|
19
|
+
attr_accessor :results, :outputs, :violation_summary, :costs_per_equipment, :equipment
|
20
|
+
|
21
|
+
##
|
22
|
+
# ScenarioPowerDistributionCost class initializes all
|
23
|
+
# scenario_power_distribution_cost attributes:
|
24
|
+
# +:results+, +:outputs+, +:violation_summary+, +:costs_per_equipment+, +:equipment+
|
25
|
+
##
|
26
|
+
def initialize(hash = {})
|
27
|
+
hash.delete_if { |k, v| v.nil? }
|
28
|
+
hash = defaults.merge(hash)
|
29
|
+
|
30
|
+
@results = hash[:results]
|
31
|
+
@outputs = hash[:outputs]
|
32
|
+
@violation_summary = hash[:violation_summary]
|
33
|
+
@costs_per_equipment = hash[:costs_per_equipment]
|
34
|
+
@equipment = hash[:equipment]
|
35
|
+
|
36
|
+
# initialize class variables @@validator and @@schema
|
37
|
+
@@validator ||= Validator.new
|
38
|
+
@@schema ||= @@validator.schema
|
39
|
+
end
|
40
|
+
|
41
|
+
##
|
42
|
+
# Assigns default values if attribute values do not exist.##
|
43
|
+
def defaults
|
44
|
+
hash = {}
|
45
|
+
hash[:results] = []
|
46
|
+
hash[:outputs] = {}
|
47
|
+
hash[:violation_summary] = []
|
48
|
+
hash[:costs_per_equipment] = []
|
49
|
+
hash[:equipment] = []
|
50
|
+
|
51
|
+
return hash
|
52
|
+
end
|
53
|
+
|
54
|
+
##
|
55
|
+
# Converts to a Hash equivalent for JSON serialization.
|
56
|
+
##
|
57
|
+
# - Exclude attributes with nil values.
|
58
|
+
# - Validate power_distribution_cost hash properties against schema.
|
59
|
+
##
|
60
|
+
def to_hash
|
61
|
+
result = {}
|
62
|
+
result[:results] = @results if @results
|
63
|
+
result[:outputs] = @outputs if !@outputs.empty?
|
64
|
+
result[:violation_summary] = @violation_summary if @violation_summary
|
65
|
+
result[:costs_per_equipment] = @costs_per_equipment if @costs_per_equipment
|
66
|
+
result[:equipment] = @equipment if @equipment
|
67
|
+
|
68
|
+
# validate power_distribution_cost properties against schema
|
69
|
+
if @@validator.validate(@@schema[:definitions][:ScenarioPowerDistributionCost][:properties], result).any?
|
70
|
+
raise "scenario_power_distribution_cost properties does not match schema: #{@@validator.validate(@@schema[:definitions][:ScenarioPowerDistributionCost][:properties], result)}"
|
71
|
+
end
|
72
|
+
|
73
|
+
return result
|
74
|
+
end
|
75
|
+
|
76
|
+
##
|
77
|
+
# Add a result
|
78
|
+
##
|
79
|
+
def add_result(hash = {})
|
80
|
+
hash.delete_if { |k, v| v.nil? }
|
81
|
+
hash = defaults.merge(hash)
|
82
|
+
result = {}
|
83
|
+
result['num_violations'] = hash[:num_violations]
|
84
|
+
@results << result
|
85
|
+
end
|
86
|
+
|
87
|
+
##
|
88
|
+
## Add outputs
|
89
|
+
##
|
90
|
+
def add_outputs(hash = {})
|
91
|
+
hash.delete_if { |k, v| v.nil? }
|
92
|
+
hash = defaults.merge(hash)
|
93
|
+
output = {}
|
94
|
+
output['log_file'] = hash[:log_file]
|
95
|
+
output['jobs'] = []
|
96
|
+
hash[:jobs].each do |job|
|
97
|
+
output['jobs'] << job
|
98
|
+
end
|
99
|
+
@outputs = output
|
100
|
+
end
|
101
|
+
|
102
|
+
##
|
103
|
+
## Add a violation summary
|
104
|
+
##
|
105
|
+
def add_violation_summary(hash = {})
|
106
|
+
hash.delete_if { |k, v| v.nil? }
|
107
|
+
hash = defaults.merge(hash)
|
108
|
+
violation_summary = {}
|
109
|
+
violation_summary['scenario'] = hash[:scenario]
|
110
|
+
violation_summary['stage'] = hash[:stage]
|
111
|
+
violation_summary['upgrade_type'] = hash[:upgrade_type]
|
112
|
+
violation_summary['simulation_time_s'] = hash[:simulation_time_s]
|
113
|
+
violation_summary['thermal_violations_present'] = hash[:thermal_violations_present]
|
114
|
+
violation_summary['voltage_violations_present'] = hash[:voltage_violations_present]
|
115
|
+
violation_summary['max_bus_voltage'] = hash[:max_bus_voltage]
|
116
|
+
violation_summary['min_bus_voltage'] = hash[:min_bus_voltage]
|
117
|
+
violation_summary['num_voltage_violation_buses'] = hash[:num_voltage_violation_buses]
|
118
|
+
violation_summary['num_overvoltage_violation_buses'] = hash[:num_overvoltage_violation_buses]
|
119
|
+
violation_summary['voltage_upper_limit'] = hash[:voltage_upper_limit]
|
120
|
+
violation_summary['num_undervoltage_violation_buses'] = hash[:num_undervoltage_violation_buses]
|
121
|
+
violation_summary['voltage_lower_limit'] = hash[:voltage_lower_limit]
|
122
|
+
violation_summary['max_line_loading'] = hash[:max_line_loading]
|
123
|
+
violation_summary['max_transformer_loading'] = hash[:max_transformer_loading]
|
124
|
+
violation_summary['num_line_violations'] = hash[:num_line_violations]
|
125
|
+
violation_summary['line_upper_limit'] = hash[:line_upper_limit]
|
126
|
+
violation_summary['num_transformer_violations'] = hash[:num_transformer_violations]
|
127
|
+
violation_summary['transformer_upper_limit'] = hash[:transformer_upper_limit]
|
128
|
+
|
129
|
+
@violation_summary << violation_summary
|
130
|
+
end
|
131
|
+
|
132
|
+
##
|
133
|
+
# Add costs per equipment
|
134
|
+
##
|
135
|
+
def add_costs_per_equipment
|
136
|
+
hash.delete_if { |k, v| v.nil? }
|
137
|
+
hash = defaults.merge(hash)
|
138
|
+
costs_per_equipment = {}
|
139
|
+
costs_per_equipment['name'] = hash[:name]
|
140
|
+
costs_per_equipment['type'] = hash[:type]
|
141
|
+
costs_per_equipment['count'] = hash[:count]
|
142
|
+
costs_per_equipment['total_cost_usd'] = hash[:costs_per_equipment]
|
143
|
+
|
144
|
+
@costs_per_equipment << costs_per_equipment
|
145
|
+
end
|
146
|
+
|
147
|
+
##
|
148
|
+
# Add equipment
|
149
|
+
##
|
150
|
+
def add_equipment
|
151
|
+
hash.delete_if { |k, v| v.nil? }
|
152
|
+
hash = defaults.merge(hash)
|
153
|
+
equipment = {}
|
154
|
+
equipment['equipment_type'] = hash[:equipment_type]
|
155
|
+
equipment['equipment_name'] = hash[:equipment_name]
|
156
|
+
equipment['status'] = hash[:status]
|
157
|
+
equipment['parameter1_name'] = hash[:parameter1_name]
|
158
|
+
equipment['parameter1_original'] = hash[:parameter1_original]
|
159
|
+
equipment['parameter1_upgraded'] = hash[:parameter1_upgraded]
|
160
|
+
equipment['parameter2_name'] = hash[:parameter2_name]
|
161
|
+
equipment['parameter2_original'] = hash[:parameter2_original]
|
162
|
+
equipment['parameter2_upgraded'] = hash[:parameter2_upgraded]
|
163
|
+
equipment['parameter3_name'] = hash[:parameter3_name]
|
164
|
+
equipment['parameter3_original'] = hash[:parameter3_original]
|
165
|
+
equipment['parameter3_upgraded'] = hash[:parameter3_upgraded]
|
166
|
+
equipment['name'] = hash[:name]
|
167
|
+
|
168
|
+
@equipment << equipment
|
169
|
+
end
|
170
|
+
end
|
171
|
+
end
|
172
|
+
end
|
173
|
+
end
|
@@ -412,32 +412,73 @@
|
|
412
412
|
"description": "File path of REopt assumptions file used to generate results, if known",
|
413
413
|
"type": "string"
|
414
414
|
},
|
415
|
-
"
|
416
|
-
"description": "
|
415
|
+
"renewable_electricity_fraction": {
|
416
|
+
"description": "Fraction of annual renewable electricity generation",
|
417
417
|
"type": "number"
|
418
418
|
},
|
419
|
-
"
|
420
|
-
"description": "
|
419
|
+
"lcc": {
|
420
|
+
"description": "Lifecycle costs for the complete distributed generation system",
|
421
|
+
"units": "dollars",
|
421
422
|
"type": "number"
|
422
423
|
},
|
423
|
-
"
|
424
|
-
"description": "
|
424
|
+
"lcc_bau": {
|
425
|
+
"description": "Lifecycle cost in the business as usual scenario (i.e no new system)",
|
426
|
+
"units": "dollars",
|
425
427
|
"type": "number"
|
426
428
|
},
|
427
|
-
"
|
428
|
-
"description": "
|
429
|
+
"npv": {
|
430
|
+
"description": "Net present value of the complete distributed generation system",
|
431
|
+
"units": "dollars",
|
429
432
|
"type": "number"
|
430
433
|
},
|
431
|
-
"
|
432
|
-
"description": "
|
434
|
+
"lifecycle_demand_cost_after_tax": {
|
435
|
+
"description": "Total demand costs in US Dollars over the life of the system after tax",
|
436
|
+
"units": "dollars",
|
433
437
|
"type": "number"
|
434
438
|
},
|
435
|
-
"
|
436
|
-
"description": "
|
439
|
+
"year_one_energy_cost_before_tax": {
|
440
|
+
"description": "Total amount paid for utility energy in US Dollars in the first year of operation",
|
441
|
+
"units": "dollars",
|
437
442
|
"type": "number"
|
438
443
|
},
|
439
|
-
"
|
440
|
-
"description": "
|
444
|
+
"year_one_energy_cost_before_tax_bau": {
|
445
|
+
"description": "Year one energy cost in the business as usual scenario (i.e no new system) before tax",
|
446
|
+
"units": "dollars",
|
447
|
+
"type": "number"
|
448
|
+
},
|
449
|
+
"year_one_demand_cost_before_tax": {
|
450
|
+
"description": "Total amount paid in utility demand charges in US Dollars in the first year of operation",
|
451
|
+
"units": "dollars",
|
452
|
+
"type": "number"
|
453
|
+
},
|
454
|
+
"year_one_demand_cost_before_tax_bau": {
|
455
|
+
"description": "Year one demand cost in the business as usual scenario (i.e no new system) before tax",
|
456
|
+
"units": "dollars",
|
457
|
+
"type": "number"
|
458
|
+
},
|
459
|
+
"year_one_bill_before_tax": {
|
460
|
+
"description": "Total amount paid to the utility in US Dollars in the first year of operation",
|
461
|
+
"units": "dollars",
|
462
|
+
"type": "number"
|
463
|
+
},
|
464
|
+
"year_one_bill_before_tax_bau": {
|
465
|
+
"description": "Year one bill in the business as usual scenario (i.e no new system) before tax",
|
466
|
+
"units": "dollars",
|
467
|
+
"type": "number"
|
468
|
+
},
|
469
|
+
"lifecycle_energy_cost_after_tax": {
|
470
|
+
"description": "Total energy costs in US Dollars over the life of the system after tax",
|
471
|
+
"units": "dollars",
|
472
|
+
"type": "number"
|
473
|
+
},
|
474
|
+
"lifecycle_demand_cost_after_tax_bau": {
|
475
|
+
"description": "Total demand costs in US Dollars over the life of the system in the business as usual scenario (i.e no new system) after tax",
|
476
|
+
"units": "dollars",
|
477
|
+
"type": "number"
|
478
|
+
},
|
479
|
+
"lifecycle_energy_cost_after_tax_bau": {
|
480
|
+
"description": "Total energy costs in US Dollars over the life of the system in the business as usual scenario (i.e no new system) after tax",
|
481
|
+
"units": "dollars",
|
441
482
|
"type": "number"
|
442
483
|
},
|
443
484
|
"SolarPV": {
|
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.
|
4
|
+
version: 0.10.0
|
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: 2024-
|
12
|
+
date: 2024-05-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|