Skip to content
Snippets Groups Projects
  • Florian Atteneder's avatar
    59e9670f
    dg1d: allow parameter overriding on cmd line... · 59e9670f
    Florian Atteneder authored
    dg1d:  allow parameter overriding on cmd line (!193)
    
    Allows to use `main(parfile, "Mesh.n" => "1")` to override the value given in the parfile.
    
    ---
    
    To do this we
    - parse the TOML file
    - flatten the dict-of-dicts to a single dict with the keys joined by a `.`
    - insert the parameters
    - unflatten the dict to a dict-of-dicts
    - write this to the output directory
    
    Unfortunately, `TOML.jl` does not allow to parse into `OrderedDict`.
    This causes the newly written parfiles to be messed up.
    Furthermore, by manually re-writing the parfiles we also do not preserve any comments or formatting.
    59e9670f
    History
    dg1d: allow parameter overriding on cmd line...
    Florian Atteneder authored
    dg1d:  allow parameter overriding on cmd line (!193)
    
    Allows to use `main(parfile, "Mesh.n" => "1")` to override the value given in the parfile.
    
    ---
    
    To do this we
    - parse the TOML file
    - flatten the dict-of-dicts to a single dict with the keys joined by a `.`
    - insert the parameters
    - unflatten the dict to a dict-of-dicts
    - write this to the output directory
    
    Unfortunately, `TOML.jl` does not allow to parse into `OrderedDict`.
    This causes the newly written parfiles to be messed up.
    Furthermore, by manually re-writing the parfiles we also do not preserve any comments or formatting.