From 868e9dea2b4a308f2796db4c9d74dac16caa8905 Mon Sep 17 00:00:00 2001 From: Yingli Date: Tue, 5 Nov 2024 10:36:37 -0700 Subject: [PATCH] format revision --- .../resources/electrical_panel.rb | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/measures/ResStockArguments/resources/electrical_panel.rb b/measures/ResStockArguments/resources/electrical_panel.rb index ef80c870f1..922bbc6434 100644 --- a/measures/ResStockArguments/resources/electrical_panel.rb +++ b/measures/ResStockArguments/resources/electrical_panel.rb @@ -232,14 +232,14 @@ def has_cooling(hvac_cooling_type) def is_ducted_heat_pump_heating(heat_pump_type) if [HPXML::HVACTypeHeatPumpAirToAir, HPXML::HVACTypeHeatPumpGroundToAir].include?(heat_pump_type) - return 'true' + return true else - return 'false' + return false end end def convert_fuel_and_presence(equipment_present, fuel_type) - if equipment_present == 'false' + if equipment_present == false return 'none' else return simplify_fuel_type(fuel_type) @@ -284,10 +284,11 @@ def get_major_elec_load_count(args) load_count = load_vars.sum load_count = load_count_hvac_adjustment(load_count, args) + return load_count end def electric_fuel_and_presence(equipment_present, fuel_type) - if equipment_present == 'false' + if equipment_present == false return 0 else return is_electric_fuel(fuel_type) @@ -303,10 +304,10 @@ def is_electric_fuel(fuel_type) end def has_pv(pv_system_present) - if pv_system_present == 'false' - return 0 - else + if pv_system_present return 1 + else + return 0 end end @@ -317,10 +318,10 @@ def load_count_hvac_adjustment(load_count, args) hvac_cooling_type = convert_cooling_type(args[:cooling_system_type], args[:heat_pump_type]) #Count ducted heat pump only once if it provides heating and cooling - if hvac_cooling_type == "heat pump" and is_ducted_heat_pump_heating == 'true' + if hvac_cooling_type == "heat pump" and is_ducted_heat_pump_heating == true load_count = load_count - 1 #Assuming a single ducted heat pump provides heating and cooling #Don't count plug-in Room ACs as major loads - elsif HPXML::HVACTypeRoomAirConditioner == "room air conditioner" + elsif hvac_cooling_type == HPXML::HVACTypeRoomAirConditioner load_count = load_count - 1 end return load_count