Skip to content

Commit

Permalink
add stub impl for heat_cool_cop function
Browse files Browse the repository at this point in the history
  • Loading branch information
shieldo committed Mar 13, 2024
1 parent 275952f commit e689eb6
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/corpus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1275,8 +1275,9 @@ impl Corpus {
energy_provided: &HashMap<String, Vec<f64>>,
results_end_user: &HashMap<&str, HashMap<&str, f64>>,
energy_supply_conn_name_for_space_hc_system: HashMap<&str, &[&str]>,
) {
todo!()
) -> HashMap<String, NumberOrDivisionByZero> {
// TODO implement when energy supplies are available
Default::default()
}

/// Calculate space heating and cooling demand for each zone and sum.
Expand Down Expand Up @@ -1399,6 +1400,11 @@ pub enum HotWaterResultMap<'a> {
Int(HashMap<&'a str, Vec<usize>>),
}

pub enum NumberOrDivisionByZero {
Number(f64),
DivisionByZero,
}

fn has_unique_some_values<K, V: Eq + Hash>(map: &HashMap<K, Option<V>>) -> bool {
let some_values: Vec<&V> = map.values().flat_map(|v| v.iter()).collect();
let value_set: HashSet<&&V> = some_values.iter().collect();
Expand Down Expand Up @@ -1835,9 +1841,9 @@ type RunResults<'a> = (
Vec<&'a str>,
HashMap<&'a str, HashMap<String, Vec<f64>>>,
HashMap<&'a str, HotWaterResultMap<'a>>,
(),
(),
(),
HashMap<String, NumberOrDivisionByZero>,
HashMap<String, NumberOrDivisionByZero>,
HashMap<String, NumberOrDivisionByZero>,
HashMap<&'a str, Vec<f64>>,
HashMap<&'a str, HashMap<&'a str, HashMap<&'a str, f64>>>,
HashMap<&'a str, f64>,
Expand Down

0 comments on commit e689eb6

Please sign in to comment.