muse2/
lib.rs

1//! Common functionality for MUSE2.
2#![warn(missing_docs)]
3
4/// The main GitHub issues page for MUSE2
5pub const ISSUES_URL: &str = concat!(env!("CARGO_PKG_REPOSITORY"), "/issues");
6
7use dirs::config_dir;
8use std::path::PathBuf;
9
10pub mod agent;
11pub mod asset;
12pub mod cli;
13pub mod commodity;
14pub mod finance;
15pub mod graph;
16pub mod id;
17pub mod input;
18pub mod log;
19pub mod model;
20pub mod output;
21pub mod process;
22pub mod region;
23pub mod settings;
24pub mod simulation;
25pub mod time_slice;
26pub mod units;
27pub mod year;
28
29#[cfg(test)]
30mod fixture;
31
32/// Get config dir for program.
33///
34/// In the unlikely event this path cannot be retrieved, the CWD will be returned.
35pub fn get_muse2_config_dir() -> PathBuf {
36    let Some(mut config_dir) = config_dir() else {
37        return PathBuf::default();
38    };
39
40    config_dir.push("muse2");
41    config_dir
42}