-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathparse_input.jl
More file actions
55 lines (50 loc) · 1.5 KB
/
Copy pathparse_input.jl
File metadata and controls
55 lines (50 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
using ArgParse
using YAML
function parse_commandline()
parser = ArgParseSettings()
@add_arg_table! parser begin
"init_file"
help = "Path to the initial configuration file (accepts multiple files)"
arg_type = String
required = true
"config_file"
help = "Path to the simulation parameters file (e.g., input.yaml)"
arg_type = String
required = true
"--steps"
help = "Ovveride the number of steps in the config file"
arg_type = Int
"--nsim"
help = "Ovveride the number of chains per config file"
arg_type = Int
"--temperature", "-T"
help = "Ovveride the temperature in the input file"
arg_type = Float64
"--density", "-D"
help = "Ovveride the density in the input file (affine transformation)"
arg_type = Float64
"--model"
help = "Ovveride the model in the input file"
arg_type = String
"--list_type"
help = "Ovveride the cell list type (EmptyList or LinkedList)"
arg_type = String
"--verbose", "-v"
help = "verbose"
action = :store_true
"--seed"
help = "Override random number seed"
arg_type = Int
end
return parse_args(parser)
end
function load_config_file(cl_args)
args = YAML.load_file(cl_args["config_file"])
for key in keys(cl_args)
if cl_args[key] !== nothing
args[key] = cl_args[key]
end
end
return args
end
nothing