Skip to content

Commit

Permalink
EC-369 update create_appliance_gains
Browse files Browse the repository at this point in the history
This method panicked when running demo_fhs.json.

When fixing the discrepancy, a potential bug was highlighted so have commented this line out for now.
  • Loading branch information
rachowell committed Feb 26, 2025
1 parent 822e6de commit 39b278a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/wrappers/future_homes_standard/future_homes_standard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1692,6 +1692,8 @@ fn create_appliance_gains(
if let Some(use_data) = map_appliance.use_data {
// value on energy label is defined differently between appliance types
// TODO (from Python) - translation of efficiencies should be its own function
let (kwhcycle, loadingfactor) =
appliance_kwh_cycle_loading_factor(input, &appliance_key, &appliance_map)?;

let app = FhsAppliance::new(
map_appliance.util_unit,
Expand Down Expand Up @@ -1784,7 +1786,10 @@ fn create_appliance_gains(
.map(|&frac| WATTS_PER_KILOWATT as f64 / DAYS_PER_YEAR as f64 * frac * annual_kwh)
.collect();
power_scheds.insert(appliance_key, flat_schedule.clone());
priority.insert(appliance_key, (None, kwhcycle));

// Python has the below line which references a variable that hasn't been assigned at this point(kwhcycle), may be erroneous.
// Commenting out so the Rust can compile
// priority.insert(appliance_key, (None, kwhcycle));

let appliance_uses_gas: bool = false; // upstream Python checks appliance key contains substring 'gas', may be erroneous

Expand Down

0 comments on commit 39b278a

Please sign in to comment.