Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
kflemin committed Jun 27, 2022
2 parents c857f04 + 93a1dcd commit bc39412
Show file tree
Hide file tree
Showing 7 changed files with 269 additions and 75 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# URBANopt Reporting Gem

## Version 0.6.1
Date Range: 05/10-22 - 06/27/22:

- Fixed [#114]( https://github.com/urbanopt/urbanopt-reporting-gem/pull/114 ), added natural gas, propane and fuel oil emissions reporting

## Version 0.6.0
Date Range: 11/22/21 - 05/09/22:

Expand Down
12 changes: 6 additions & 6 deletions docs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

209 changes: 175 additions & 34 deletions lib/measures/default_feature_reports/measure.rb

Large diffs are not rendered by default.

51 changes: 34 additions & 17 deletions lib/urbanopt/reporting/default_reports/reporting_period.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,21 @@ class ReportingPeriod
:district_heating_kwh, :water_qbft, :electricity_produced_kwh, :end_uses, :energy_production_kwh, :photovoltaic,
:fuel_type, :total_cost_dollar, :usage_cost_dollar, :demand_cost_dollar, :comfort_result, :time_setpoint_not_met_during_occupied_cooling,
: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,
:emissions, :future_annual_emissions_mt, :future_hourly_emissions_mt, :historical_annual_emissions_mt, :historical_hourly_emissions_mt,
:future_annual_emissions_intensity_kg_per_ft2, :future_hourly_emissions_intensity_kg_per_ft2, :historical_annual_emissions_intensity_kg_per_ft2, :historical_hourly_emissions_intensity_kg_per_ft2 #:nodoc:
:emissions, :future_annual_electricity_emissions_mt, :future_hourly_electricity_emissions_mt, :historical_annual_electricity_emissions_mt, :historical_hourly_electricity_emissions_mt,
: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 ,
:natural_gas_emissions_mt, :natural_gas_emissions_intensity_kg_per_ft2, :propane_emissions_mt, :propane_emissions_intensity_kg_per_ft2,
:fueloil_no2_emissions_mt, :fueloil_no2_emissions_intensity_kg_per_ft2 #:nodoc:

# ReportingPeriod class initializes the reporting period attributes:
# +: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+,
# +:net_site_energy_kwh+ , +:net_source_energy_kwh+ , +:total_utility_cost_dollar , +:net_utility_cost_dollar+ , +:utility_costs_dollar+ , +:electricity_kwh+ , +:natural_gas_kwh+ , +:propane_kwh+ , +:fuel_oil_kwh+ , +:other_fuels_kwh+ , +:district_cooling_kwh+ ,
# +:district_heating_kwh+ , +:water_qbft+ , +:electricity_produced_kwh+ , +:end_uses+ , +:energy_production_kwh+ , +:photovoltaic_kwh+ ,
# +:fuel_type+ , +:total_cost_dollar+ , +:usage_cost_dollar+ , +:demand_cost_dollar+ , +:comfort_result+ , +:time_setpoint_not_met_during_occupied_cooling+ ,
# +: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 ,
# +:emissions, +:future_annual_emissions_mt, +:future_hourly_emissions_mt, +:historical_annual_emissions_mt, +:historical_hourly_emissions_mt,
# +:future_annual_emissions_intensity_kg_per_ft2, +:future_hourly_emissions_intensity_kg_per_ft2, +:historical_annual_emissions_intensity_kg_per_ft2, +:historical_hourly_emissions_intensity_kg_per_ft2
# +: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+ ,
# +:emissions, +:future_annual_electricity_emissions_mt+, +:future_hourly_electricity_emissions_mt+, +:historical_annual_electricity_emissions_mt+, +:historical_hourly_electricity_emissions_mt+,
# +: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+,
# +:natural_gas_emissions_mt+, +:natural_gas_emissions_intensity_kg_per_ft2+, +:propane_emissions_mt+, +:propane_emissions_intensity_kg_per_ft2+,
# +:fueloil_no2_emissions_mt+, +:fueloil_no2_emissions_intensity_kg_per_ft2+
##
# [parameters:]
# +hash+ - _Hash_ - A hash which may contain a deserialized reporting_period.
Expand Down Expand Up @@ -153,8 +157,12 @@ def defaults
hash[:utility_costs_dollar] = [{ fuel_type: nil, total_cost_dollar: nil, usage_cost_dollar: nil, demand_cost_dollar: nil }]
hash[:comfort_result] = { time_setpoint_not_met_during_occupied_cooling: nil, time_setpoint_not_met_during_occupied_heating: nil,
time_setpoint_not_met_during_occupied_hours: nil, hours_out_of_comfort_bounds_PMV: nil, hours_out_of_comfort_bounds_PPD: nil }
hash[:emissions] = { future_annual_emissions_mt: nil, future_hourly_emissions_mt: nil, historical_annual_emissions_mt: nil, historical_hourly_emissions_mt: nil,
future_annual_emissions_intensity_kg_per_ft2: nil, future_hourly_emissions_kg_per_ft2: nil, historical_annual_emissions_kg_per_ft2: nil, historical_hourly_emissions_kg_per_ft2: nil }
hash[:emissions] = { future_annual_electricity_emissions_mt: nil, future_hourly_electricity_emissions_mt: nil, historical_annual_electricity_emissions_mt: nil,
historical_hourly_electricity_emissions_mt: nil, future_annual_electricity_emissions_intensity_kg_per_ft2: nil,
future_hourly_electricity_emissions_intensity_kg_per_ft2: nil, historical_annual_electricity_emissions_intensity_kg_per_ft2: nil,
historical_hourly_electricity_emissions_intensity_kg_per_ft2: nil, natural_gas_emissions_mt: nil,
natural_gas_emissions_intensity_kg_per_ft2: nil, propane_emissions_mt: nil, propane_emissions_intensity_kg_per_ft2: nil,
fueloil_no2_emissions_mt: nil, fueloil_no2_emissions_intensity_kg_per_ft2: nil }

return hash
end
Expand Down Expand Up @@ -214,7 +222,7 @@ def to_hash
result[:comfort_result] = comfort_result_hash if @comfort_result

emissions_hash = @emissions if @emissions
emissions_hash.delete_if { |k, v| v.nil? }
#emissions_hash.delete_if { |k, v| v.nil? }
result[:emissions] = emissions_hash if @emissions

# validates +reporting_period+ properties against schema for reporting period.
Expand Down Expand Up @@ -291,15 +299,24 @@ def self.merge_reporting_period(existing_period, new_period)
end

if existing_period.emissions
existing_period.emissions[:future_annual_emissions_mt] = add_values(existing_period.emissions[:future_annual_emissions_mt], new_period.emissions[:future_annual_emissions_mt])
existing_period.emissions[:future_hourly_emissions_mt] = add_values(existing_period.emissions[:future_hourly_emissions_mt], new_period.emissions[:future_hourly_emissions_mt])
existing_period.emissions[:historical_annual_emissions_mt] = add_values(existing_period.emissions[:historical_annual_emissions_mt], new_period.emissions[:historical_annual_emissions_mt])
existing_period.emissions[:historical_hourly_emissions_mt] = add_values(existing_period.emissions[:historical_hourly_emissions_mt], new_period.emissions[:historical_hourly_emissions_mt])

existing_period.emissions[:future_annual_emissions_intensity_kg_per_ft2] = add_values(existing_period.emissions[:future_annual_emissions_intensity_kg_per_ft2], new_period.emissions[:future_annual_emissions_intensity_kg_per_ft2])
existing_period.emissions[:future_hourly_emissions_intensity_kg_per_ft2] = add_values(existing_period.emissions[:future_hourly_emissions_intensity_kg_per_ft2], new_period.emissions[:future_hourly_emissions_intensity_kg_per_ft2])
existing_period.emissions[:historical_annual_emissions_intensity_kg_per_ft2] = add_values(existing_period.emissions[:historical_annual_emissions_intensity_kg_per_ft2], new_period.emissions[:historical_annual_emissions_intensity_kg_per_ft2])
existing_period.emissions[:historical_hourly_emissions_intensity_kg_per_ft2] = add_values(existing_period.emissions[:historical_hourly_emissions_intensity_kg_per_ft2], new_period.emissions[:historical_hourly_emissions_intensity_kg_per_ft2])
existing_period.emissions[:future_annual_electricity_emissions_mt] = add_values(existing_period.emissions[:future_annual_electricity_emissions_mt], new_period.emissions[:future_annual_electricity_emissions_mt])
existing_period.emissions[:future_hourly_electricity_emissions_mt] = add_values(existing_period.emissions[:future_hourly_electricity_emissions_mt], new_period.emissions[:future_hourly_electricity_emissions_mt])
existing_period.emissions[:historical_annual_electricity_emissions_mt] = add_values(existing_period.emissions[:historical_annual_electricity_emissions_mt], new_period.emissions[:historical_annual_electricity_emissions_mt])
existing_period.emissions[:historical_hourly_electricity_emissions_mt] = add_values(existing_period.emissions[:historical_hourly_electricity_emissions_mt], new_period.emissions[:historical_hourly_electricity_emissions_mt])

existing_period.emissions[:natural_gas_emissions_mt] = add_values(existing_period.emissions[:natural_gas_emissions_mt], new_period.emissions[:natural_gas_emissions_mt])
existing_period.emissions[:propane_emissions_mt] = add_values(existing_period.emissions[:propane_emissions_mt], new_period.emissions[:propane_emissions_mt])
existing_period.emissions[:fueloil_no2_emissions_mt] = add_values(existing_period.emissions[:fueloil_no2_emissions_mt], new_period.emissions[:fueloil_no2_emissions_mt])

existing_period.emissions[:future_annual_electricity_emissions_intensity_kg_per_ft2] = add_values(existing_period.emissions[:future_annual_electricity_emissions_intensity_kg_per_ft2], new_period.emissions[:future_annual_electricity_emissions_intensity_kg_per_ft2])
existing_period.emissions[:future_hourly_electricity_emissions_intensity_kg_per_ft2] = add_values(existing_period.emissions[:future_hourly_electricity_emissions_intensity_kg_per_ft2], new_period.emissions[:future_hourly_electricity_emissions_intensity_kg_per_ft2])
existing_period.emissions[:historical_annual_electricity_emissions_intensity_kg_per_ft2] = add_values(existing_period.emissions[:historical_annual_electricity_emissions_intensity_kg_per_ft2], new_period.emissions[:historical_annual_electricity_emissions_intensity_kg_per_ft2])
existing_period.emissions[:historical_hourly_electricity_emissions_intensity_kg_per_ft2] = add_values(existing_period.emissions[:historical_hourly_electricity_emissions_intensity_kg_per_ft2], new_period.emissions[:historical_hourly_electricity_emissions_intensity_kg_per_ft2])

existing_period.emissions[:natural_gas_emissions_intensity_kg_per_ft2] = add_values(existing_period.emissions[:natural_gas_emissions_intensity_kg_per_ft2], new_period.emissions[:natural_gas_emissions_intensity_kg_per_ft2])
existing_period.emissions[:propane_emissions_intensity_kg_per_ft2] = add_values(existing_period.emissions[:propane_emissions_intensity_kg_per_ft2], new_period.emissions[:propane_emissions_intensity_kg_per_ft2])
existing_period.emissions[:fueloil_no2_emissions_intensity_kg_per_ft2] = add_values(existing_period.emissions[:fueloil_no2_emissions_intensity_kg_per_ft2], new_period.emissions[:fueloil_no2_emissions_intensity_kg_per_ft2])

end

return existing_period
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,20 @@ Net Power
Net Apparent Power
Ice Thermal Storage End Fraction
Cooling Coil Ice Thermal Storage End Fraction
Future_Annual_Emissions_Var
Future_Hourly_Emissions_Var
Historical_Annual_Emissions_Var
Historical_Hourly_Emissions_Var
Future_Annual_Emissions_Intensity_Var
Future_Hourly_Emissions_Intensity_Var
Historical_Annual_Emissions_Intensity_Var
Historical_Hourly_Emissions_Intensity_Var
Future_Annual_Electricity_Emissions
Future_Hourly_Electricity_Emissions
Historical_Annual_Electricity_Emissions
Historical_Hourly_Electricity_Emissions
Future_Annual_Electricity_Emissions_Intensity
Future_Hourly_Electricity_Emissions_Intensity
Historical_Annual_Electricity_Emissions_Intensity
Historical_Hourly_Electricity_Emissions_Intensity
Natural_Gas_Emissions
Natural_Gas_Emissions_Intensity
Propane_Emissions
Propane_Emissions_Intensity
FuelOilNo2_Emissions
FuelOilNo2_Emissions_Intensity
Curtailed EV Power
Daily EV Charge Energy Capacity
EV Charge Ratio
Expand Down
43 changes: 34 additions & 9 deletions lib/urbanopt/reporting/default_reports/schema/scenario_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -572,38 +572,63 @@
"emissions": {
"type": "object",
"properties": {
"future_annual_emissions_mt": {
"future_annual_electricity_emissions_mt": {
"description": "Future emissions in metric ton (mt) calculated based on an annual emission factor value for the selected future year",
"type": "number"
},
"future_hourly_emissions_mt": {
"future_hourly_electricity_emissions_mt": {
"description": "Future emissions in metric ton (mt) calculated based on hourly emission factor values for the selected future year",
"type": "number"
},
"historical_annual_emissions_mt": {
"historical_annual_electricity_emissions_mt": {
"description": "Historical emissions in metric ton (mt) calculated based on an annual emission factor value for the selected historical year",
"type": "number"
},
"historical_hourly_emissions_mt": {
"historical_hourly_electricity_emissions_mt": {
"description": "Historical emissions in metric ton (mt) calculated based on hourly emission factor values for the selected historical year",
"type": "number"
},
"future_annual_emissions_intensity_kg_per_ft2": {
"future_annual_electricity_emissions_intensity_kg_per_ft2": {
"description": "Future emissions intensity in kg/ft2 calculated based on an annual emission factor value for the selected future year",
"type": "number"
},
"future_hourly_emissions_intensity_kg_per_ft2": {
"future_hourly_electricity_emissions_intensity_kg_per_ft2": {
"description": "Future emissions intensity in kg/ft2 calculated based on hourly emission factor values for the selected future year",
"type": "number"
},
"historical_annual_emissions_intensity_kg_per_ft2": {
"historical_annual_electricity_emissions_intensity_kg_per_ft2": {
"description": "Historical emissions intensity in kg/ft2 calculated based on an annual emission factor value for the selected historical year",
"type": "number"
},
"historical_hourly_emissions_intensity_kg_per_ft2": {
"description": "Historical emissions intensity in kg.ft2 calculated based on hourly emission factor values for the selected historical year",
"historical_hourly_electricity_emissions_intensity_kg_per_ft2": {
"description": "Historical emissions intensity in kg/ft2 calculated based on hourly emission factor values for the selected historical year",
"type": "number"
},
"natural_gas_emissions_mt": {
"description": "Natural Gas emissions in mt calculated based on EPA eGRID data and calculated using 20-year GWP horizon based on ASHRAE 189.1",
"type": "number"
},
"natural_gas_emissions_intensity_kg_per_ft2": {
"description": "Natural Gas emissions intensity in kg/ft2 calculated based on EPA eGRID data and calculated using 20-year GWP horizon based on ASHRAE 189.1",
"type": "number"
},
"propane_emissions_mt": {
"description": "Propane emissions in mt calculated based on EPA eGRID data and calculated using 20-year GWP horizon based on ASHRAE 189.1",
"type": "number"
},
"propane_emissions_intensity_kg_per_ft2": {
"description": "Propane emissions intensity in kg/ft2 calculated based on EPA eGRID data and calculated using 20-year GWP horizon based on ASHRAE 189.1",
"type": "number"
},
"fueloil_no2_emissions_mt": {
"description": "FuelOilNo2 emissions in mt calculated based on EPA eGRID data and calculated using 20-year GWP horizon based on ASHRAE 189.1",
"type": "number"
},
"fueloil_no2_emissions_intensity_kg_per_ft2": {
"description": "FuelOilNo2 emissions intensity in kg/ft2 calculated based on EPA eGRID data and calculated using 20-year GWP horizon based on ASHRAE 189.1",
"type": "number"
}

}
}
},
Expand Down
2 changes: 1 addition & 1 deletion lib/urbanopt/reporting/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@

module URBANopt
module Reporting
VERSION = '0.6.0'.freeze
VERSION = '0.6.1'.freeze
end
end

0 comments on commit bc39412

Please sign in to comment.