Params: add development parameters

This commit is contained in:
Akemi Izuko 2023-11-16 21:22:48 -07:00
parent 7dffab78e1
commit 2c37cae636
Signed by: akemi
GPG key ID: 8DE0764E1809E9FC
4 changed files with 15 additions and 1 deletions

View file

@ -8,5 +8,7 @@ edition = "2021"
[dependencies]
clap = { version = "4.4.8", features = ["derive"]}
derive_builder = "0.12.0"
rand = "0.8.5"
rand_distr = "0.4.3"
serde = { version = "1.0.192", features = ["derive"]}
toml = "0.8.8"

View file

@ -2,7 +2,7 @@ check:
cargo check
run:
cargo run -- params.toml 2>/dev/null | python3 scripts/format.py
@cargo run -- params.toml 2>/dev/null | python3 scripts/format.py
debug:
cargo run -- params.toml

View file

@ -91,3 +91,7 @@
[types.gen_tuple]
gen_each_field = 0.5
get_instant = 0.5
[dev]
float_gen_distro_pos_stddiv = 56713724e30 # DO NOT expand with zeros
float_gen_distro_neg_stddiv = 56713724e30

View file

@ -18,6 +18,7 @@ toml_struct!{
global_flow: GlobalFlow,
statements: Statments,
types: Types,
dev: Dev,
}
}
@ -149,6 +150,13 @@ toml_struct!{
}
}
toml_struct!{
struct Dev {
float_gen_distro_pos_stddiv: f32,
float_gen_distro_neg_stddiv: f32,
}
}
impl Params {
pub fn parse(p: &PathBuf) -> Self {
let file_string = fs::read_to_string(p)