Skip to content

Commit 0f990f9

Browse files
committed
Just pass debug_model cf. all settings to simulation::run
1 parent 428afe3 commit 0f990f9

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/commands.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ pub fn handle_run_command(
105105
info!("Output data will be written to {}", output_path.display());
106106

107107
// Run the simulation
108-
crate::simulation::run(model, settings, assets, &output_path)
108+
crate::simulation::run(model, assets, &output_path, settings.debug_model)
109109
};
110110

111111
// Once the logger is initialised, we can write fatal errors to log

src/simulation.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
use crate::asset::AssetPool;
33
use crate::model::Model;
44
use crate::output::DataWriter;
5-
use crate::settings::Settings;
65
use anyhow::{bail, Result};
76
use log::info;
87
use std::path::Path;
@@ -21,13 +20,14 @@ pub use prices::CommodityPrices;
2120
/// * `model` - The model to run
2221
/// * `assets` - The asset pool
2322
/// * `output_path` - The folder to which output files will be written
23+
/// * `debug_model` - Whether to write additional information (e.g. duals) to output files
2424
pub fn run(
2525
model: Model,
26-
settings: Settings,
2726
mut assets: AssetPool,
2827
output_path: &Path,
28+
debug_model: bool,
2929
) -> Result<()> {
30-
let mut writer = DataWriter::create(output_path, settings.debug_model)?;
30+
let mut writer = DataWriter::create(output_path, debug_model)?;
3131

3232
let mut opt_results = None; // all results of dispatch optimisation
3333
for year in model.iter_years() {

0 commit comments

Comments
 (0)