Skip to content

Commit f8143c1

Browse files
authored
Merge pull request #1032 from EnergySystemsModellingLab/default-output-paths-fix
Remove unnecessary explicit PWD in default output paths
2 parents ae1335d + de427a7 commit f8143c1

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

schemas/settings.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ properties:
2929
results_root:
3030
type: string
3131
description: Results root path to save MUSE2 results
32-
default: ""
32+
default: "muse2_results"
3333
notes: Defaults to a "muse2_results" folder within the current working directory.
3434
graph_results_root:
3535
type: string
3636
description: Results root path to save MUSE2 graph outputs
37-
default: ""
37+
default: "muse2_graphs"
3838
notes: Defaults to a "muse2_graphs" folder within the current working directory.

src/settings.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ use crate::log::DEFAULT_LOG_LEVEL;
55
use anyhow::Result;
66
use documented::DocumentedFields;
77
use serde::{Deserialize, Serialize};
8-
use std::env::current_dir;
98
use std::fmt::Write;
109
use std::path::{Path, PathBuf};
1110

@@ -48,9 +47,9 @@ pub struct Settings {
4847
pub overwrite: bool,
4948
/// Whether to write additional information to CSV files
5049
pub debug_model: bool,
51-
/// Results root path to save MUSE2 results. Defaults to `{pwd}/muse2_results`.
50+
/// Results root path to save MUSE2 results. Defaults to `muse2_results`.
5251
pub results_root: PathBuf,
53-
/// Results root path to save MUSE2 graph outputs. Defaults to `{pwd}/muse2_graphs`.
52+
/// Results root path to save MUSE2 graph outputs. Defaults to `muse2_graphs`.
5453
pub graph_results_root: PathBuf,
5554
}
5655

@@ -60,8 +59,8 @@ impl Default for Settings {
6059
log_level: DEFAULT_LOG_LEVEL.to_string(),
6160
overwrite: false,
6261
debug_model: false,
63-
results_root: current_dir().unwrap().join("muse2_results"),
64-
graph_results_root: current_dir().unwrap().join("muse2_graphs"),
62+
results_root: PathBuf::from("muse2_results"),
63+
graph_results_root: PathBuf::from("muse2_graphs"),
6564
}
6665
}
6766
}
@@ -147,10 +146,7 @@ mod tests {
147146
Settings::load_from_path(&file_path).unwrap(),
148147
Settings {
149148
log_level: "warn".to_string(),
150-
debug_model: false,
151-
overwrite: false,
152-
results_root: current_dir().unwrap().join("muse2_results"),
153-
graph_results_root: current_dir().unwrap().join("muse2_graphs"),
149+
..Settings::default()
154150
}
155151
);
156152
}

0 commit comments

Comments
 (0)