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 example;
15pub mod finance;
16pub mod graph;
17pub mod id;
18pub mod input;
19pub mod log;
20pub mod model;
21pub mod output;
22pub mod patch;
23pub mod process;
24pub mod region;
25pub mod settings;
26pub mod simulation;
27pub mod time_slice;
28pub mod units;
29pub mod year;
30
31#[cfg(test)]
32mod fixture;
33
34/// Get config dir for program.
35///
36/// In the unlikely event this path cannot be retrieved, the CWD will be returned.
37pub fn get_muse2_config_dir() -> PathBuf {
38    let Some(mut config_dir) = config_dir() else {
39        return PathBuf::default();
40    };
41
42    config_dir.push("muse2");
43    config_dir
44}