Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "1.96.1"
channel = "1.97.0"
profile = "default"
6 changes: 3 additions & 3 deletions src/asset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ impl Asset {
format!(
"No process availabilities supplied for process {} in region {} in year {}. \
You should update process_availabilities.csv.",
&process.id, region_id, commission_year
process.id, region_id, commission_year
)
})?
.clone();
Expand All @@ -271,7 +271,7 @@ impl Asset {
format!(
"No commodity flows supplied for process {} in region {} in year {}. \
You should update process_flows.csv.",
&process.id, region_id, commission_year
process.id, region_id, commission_year
)
})?
.clone();
Expand All @@ -282,7 +282,7 @@ impl Asset {
format!(
"No process parameters supplied for process {} in region {} in year {}. \
You should update process_parameters.csv.",
&process.id, region_id, commission_year
process.id, region_id, commission_year
)
})?
.clone();
Expand Down
2 changes: 1 addition & 1 deletion src/asset/capacity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ mod tests {
#[case] right: AssetCapacity,
) {
assert_eq!(left.partial_cmp(&right), None);
assert!(left != right);
assert_ne!(left, right);
}

#[rstest]
Expand Down
2 changes: 1 addition & 1 deletion src/input/agent/search_space.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ where
producers.iter().any(|producer| producer.id == process.id),
"Process '{}' does not produce commodity '{commodity_id}' in region \
'{region_id}' in year {year}",
&process.id
process.id
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/input/process/availability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ impl ProcessAvailabilityRaw {
fn to_bounds(&self, length: Year) -> Result<RangeInclusive<Dimensionless>> {
// Parse availability_range string
let availability_range = parse_range(&self.limits, Dimensionless(0.0)..=Dimensionless(1.0))
.with_context(|| format!("Could not parse availabilities range: {}", &self.limits))?;
.with_context(|| format!("Could not parse availabilities range: {}", self.limits))?;

// Convert to bounds based on fraction of the year covered
let ts_frac = length / Year(1.0);
Expand Down
6 changes: 3 additions & 3 deletions src/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1021,9 +1021,9 @@ mod tests {
cost: MoneyPerFlow(0.0),
};

assert!(flow_in.direction() == FlowDirection::Input);
assert!(flow_out.direction() == FlowDirection::Output);
assert!(flow_zero.direction() == FlowDirection::Zero);
assert_eq!(flow_in.direction(), FlowDirection::Input);
assert_eq!(flow_out.direction(), FlowDirection::Output);
assert_eq!(flow_zero.direction(), FlowDirection::Zero);
}

#[rstest]
Expand Down
10 changes: 5 additions & 5 deletions src/simulation/investment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ pub fn select_best_assets(
!opt_assets.is_empty(),
"Failed to meet demand for commodity '{}' in region '{}' with provided investment \
options. This may be due to overly restrictive process investment constraints.",
&commodity.id,
commodity.id,
region_id
);

Expand Down Expand Up @@ -406,7 +406,7 @@ pub fn select_best_assets(
// Save appraisal results
writer.write_appraisal_debug_info(
year,
&format!("{} {} round {}", &commodity.id, &agent.id, round),
&format!("{} {} round {}", commodity.id, agent.id, round),
&outputs_for_opts,
&demand,
)?;
Expand All @@ -422,7 +422,7 @@ pub fn select_best_assets(
"Investment appraisal completed with unmet demand for commodity '{}', region '{}', \
year '{}', agent '{}'. {} non-feasible investments were not considered. \
This unmet demand may still be satisfied during the full system dispatch.",
&commodity.id, region_id, year, agent.id, num_nonfeasible
commodity.id, region_id, year, agent.id, num_nonfeasible
);
break;
}
Expand All @@ -435,8 +435,8 @@ pub fn select_best_assets(
// Log the selected asset
debug!(
"Selected {} asset '{}' (capacity: {})",
&best_output.asset.state(),
&best_output.asset.process_id(),
best_output.asset.state(),
best_output.asset.process_id(),
best_output.asset.capacity().total_capacity()
);

Expand Down
4 changes: 2 additions & 2 deletions src/simulation/investment/appraisal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -653,9 +653,9 @@ mod tests {

// Commissioned assets should be prioritised first
assert!(outputs[0].asset.is_commissioned());
assert!(outputs[0].asset.commission_year() == 2020);
assert_eq!(outputs[0].asset.commission_year(), 2020);
assert!(outputs[1].asset.is_commissioned());
assert!(outputs[1].asset.commission_year() == 2015);
assert_eq!(outputs[1].asset.commission_year(), 2015);

// Non-commissioned assets should come after
assert!(!outputs[2].asset.is_commissioned());
Expand Down
2 changes: 1 addition & 1 deletion src/simulation/market.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ pub fn select_assets_for_single_market(
{
debug!(
"Running asset selection for agent '{}' in market '{}|{}'",
&agent.id, commodity_id, region_id
agent.id, commodity_id, region_id
);

// Get demand portion for this market for this agent in this year
Expand Down
2 changes: 1 addition & 1 deletion tests/regression.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ fn compare_output_dirs(cur_output_dir1: &Path, test_data_dir: &Path, debug_model
let file_names2 = get_csv_file_names(test_data_dir);

// Check that output files haven't been added/removed
assert!(file_names1 == file_names2);
assert_eq!(file_names1, file_names2);

let mut errors = Vec::new();
for file_name in file_names1 {
Expand Down
Loading