Configuration

Read, parse, and extract the configuration parameters.

Contents

Index

Parser

ACFlow.inp_tomlFunction
inp_toml(f::String, key::String, necessary::Bool)

Parse the configuration file (in toml format). It reads only parts of the configuration file, which depends on the value of key.

Arguments

  • f -> Filename of configuration.
  • key -> Parameter's name.
  • necessary -> If it is true and configuration is absent, raise an error.

Returns

  • value -> Parameter's value.
inp_toml(f::String, necessary::Bool)

Parse the configuration file (in toml format). It reads the whole file.

Arguments

  • f -> Filename of configuration.
  • necessary -> If it is true and configuration is absent, raise an error.

Returns

  • dict -> A Dictionary struct that contains all the key-value pairs.
ACFlow.fil_dictFunction
fil_dict(cfg::Dict{String,Any})

Transfer configurations from dict cfg to internal dicts (including PBASE, PMaxEnt, PBarRat, PNevanAC, PStochAC, PStochSK, PStochOM and PStochPX etc). In other words, all the relevant internal dicts should be filled / updated in this function.

Arguments

  • cfg -> A dict struct that contains all the configurations (from ac.toml).

Returns

N/A

ACFlow.see_dictFunction
see_dict()

Display all of the relevant configuration parameters to the terminal.

Arguments

N/A

Returns

N/A

See also: fil_dict.

ACFlow.rev_dict_bFunction
rev_dict_b(BASE::Dict{String,Any})

Setup the configuration dictionary: PBASE.

Arguments

  • BASE -> A dict struct that contains configurations from the [BASE] block.

Returns

N/A

See also: PBASE.

rev_dict_b(BASE::Dict{String,Vector{Any}})

Setup the configuration dictionary: PBASE.

Arguments

  • BASE -> A dict struct that contains configurations from the [BASE] block.

Returns

N/A

See also: PBASE.

ACFlow.rev_dict_mFunction
rev_dict_m(S::MaxEntSolver, MaxEnt::Dict{String,Any})

Setup the configuration dictionary: PMaxEnt.

Arguments

  • S -> A MaxEntSolver struct.
  • MaxEnt -> A dict struct that contains configurations from the [MaxEnt] block.

Returns

N/A

See also: PMaxEnt.

rev_dict_m(S::MaxEntSolver, MaxEnt::Dict{String,Vector{Any}})

Setup the configuration dictionary: PMaxEnt.

Arguments

  • S -> A MaxEntSolver struct.
  • MaxEnt -> A dict struct that contains configurations from the [MaxEnt] block.

Returns

N/A

See also: PMaxEnt.

ACFlow.rev_dict_rFunction
rev_dict_r(S::BarRatSolver, BarRat::Dict{String,Any})

Setup the configuration dictionary: PBarRat.

Arguments

  • S -> A BarRatSolver struct.
  • BarRat -> A dict struct that contains configurations from the [BarRat] block.

Returns

N/A

See also: PBarRat.

rev_dict_r(S::BarRatSolver, BarRat::Dict{String,Vector{Any}})

Setup the configuration dictionary: PBarRat.

Arguments

  • S -> A BarRatSolver struct.
  • BarRat -> A dict struct that contains configurations from the [BarRat] block.

Returns

N/A

See also: PBarRat.

ACFlow.rev_dict_nFunction
rev_dict_n(S::NevanACSolver, NevanAC::Dict{String,Any})

Setup the configuration dictionary: PNevanAC.

Arguments

  • S -> A NevanACSolver struct.
  • NevanAC -> A dict struct that contains configurations from the [NevanAC] block.

Returns

N/A

See also: PNevanAC.

rev_dict_n(S::NevanACSolver, NevanAC::Dict{String,Vector{Any}})

Setup the configuration dictionary: PNevanAC.

Arguments

  • S -> A NevanACSolver struct.
  • NevanAC -> A dict struct that contains configurations from the [NevanAC] block.

Returns

N/A

See also: PNevanAC.

ACFlow.rev_dict_aFunction
rev_dict_a(S::StochACSolver, StochAC::Dict{String,Any})

Setup the configuration dictionary: PStochAC.

Arguments

  • S -> A StochACSolver struct.
  • StochAC -> A dict struct that contains configurations from the [StochAC] block.

Returns

N/A

See also: PStochAC.

rev_dict_a(S::StochACSolver, StochAC::Dict{String,Vector{Any}})

Setup the configuration dictionary: PStochAC.

Arguments

  • S -> A StochACSolver struct.
  • StochAC -> A dict struct that contains configurations from the [StochAC] block.

Returns

N/A

See also: PStochAC.

ACFlow.rev_dict_kFunction
rev_dict_k(S::StochSKSolver, StochSK::Dict{String,Any})

Setup the configuration dictionary: PStochSK.

Arguments

  • S -> A StochSKSolver struct.
  • StochSK -> A dict struct that contains configurations from the [StochSK] block.

Returns

N/A

See also: PStochSK.

rev_dict_k(S::StochSKSolver, StochSK::Dict{String,Vector{Any}})

Setup the configuration dictionary: PStochSK.

Arguments

  • S -> A StochSKSolver struct.
  • StochSK -> A dict struct that contains configurations from the [StochSK] block.

Returns

N/A

See also: PStochSK.

ACFlow.rev_dict_sFunction
rev_dict_s(S::StochOMSolver, StochOM::Dict{String,Any})

Setup the configuration dictionary: PStochOM.

Arguments

  • S -> A StochOMSolver struct.
  • StochOM -> A dict struct that contains configurations from the [StochOM] block.

Returns

N/A

See also: PStochOM.

rev_dict_s(S::StochOMSolver, StochOM::Dict{String,Vector{Any}})

Setup the configuration dictionary: PStochOM.

Arguments

  • S -> A StochOMSolver struct.
  • StochOM -> A dict struct that contains configurations from the [StochOM] block.

Returns

N/A

See also: PStochOM.

ACFlow.rev_dict_xFunction
rev_dict_x(S::StochPXSolver, StochPX::Dict{String,Any})

Setup the configuration dictionary: PStochPX.

Arguments

  • S -> A StochPXSolver struct.
  • StochPX -> A dict struct that contains configurations from the [StochPX] block.

Returns

N/A

See also: PStochPX.

rev_dict_x(S::StochPXSolver, StochPX::Dict{String,Vector{Any}})

Setup the configuration dictionary: PStochPX.

Arguments

  • S -> A StochPXSolver struct.
  • StochPX -> A dict struct that contains configurations from the [StochPX] block.

Returns

N/A

See also: PStochPX.

Validation

ACFlow.chk_dictFunction
chk_dict()

Validate the correctness and consistency of configurations.

Arguments

N/A

Returns

N/A

See also: fil_dict, _v.

ACFlow._vFunction
_v(key::String, val::Array{Any,1})

Verify the value array. Called by chk_dict() function only.

Arguments

  • key -> Key of parameter.
  • val -> Value of parameter.

Returns

N/A

See also: chk_dict.

Extraction

ACFlow.get_bFunction
get_b(key::String)

Extract configurations from dict: PBASE.

Arguments

  • key -> Key of parameter.

Returns

  • value -> Value of parameter.

See also: PBASE.

ACFlow.get_mFunction
get_m(key::String)

Extract configurations from dict: PMaxEnt.

Arguments

  • key -> Key of parameter.

Returns

  • value -> Value of parameter.

See also: PMaxEnt.

ACFlow.get_rFunction
get_r(key::String)

Extract configurations from dict: PBarRat.

Arguments

  • key -> Key of parameter.

Returns

  • value -> Value of parameter.

See also: PBarRat.

ACFlow.get_nFunction
get_n(key::String)

Extract configurations from dict: PNevanAC.

Arguments

  • key -> Key of parameter.

Returns

  • value -> Value of parameter.

See also: PNevanAC.

ACFlow.get_aFunction
get_a(key::String)

Extract configurations from dict: PStochAC.

Arguments

  • key -> Key of parameter.

Returns

  • value -> Value of parameter.

See also: PStochAC.

ACFlow.get_kFunction
get_k(key::String)

Extract configurations from dict: PStochSK.

Arguments

  • key -> Key of parameter.

Returns

  • value -> Value of parameter.

See also: PStochSK.

ACFlow.get_sFunction
get_s(key::String)

Extract configurations from dict: PStochOM.

Arguments

  • key -> Key of parameter.

Returns

  • value -> Value of parameter.

See also: PStochOM.

ACFlow.get_xFunction
get_x(key::String)

Extract configurations from dict: PStochPX.

Arguments

  • key -> Key of parameter.

Returns

  • value -> Value of parameter.

See also: PStochPX.