ForceBalance API
1.3
Automated optimization of force fields and empirical potentials
|
Functions | |
def | read_mvals (fobj) |
def | read_pvals (fobj) |
def | read_priors (fobj) |
def | read_internals (fobj) |
def | printsection (heading, optdict, typedict) |
Print out a section of the input file in a parser-compliant and readable format. More... | |
def | parse_inputs (input_file=None) |
Parse through the input file and read all user-supplied options. More... | |
Variables | |
logger = getLogger(__name__) | |
dictionary | gen_opts_types |
Default general options. More... | |
dictionary | tgt_opts_types |
Default fitting target options. More... | |
all_opts_names = list(itertools.chain(*[i.keys() for i in gen_opts_types.values()])) + list(itertools.chain(*[i.keys() for i in tgt_opts_types.values()])) | |
list | iocc = [] |
Check for uniqueness of option names. More... | |
dictionary | gen_opts_defaults = {} |
Default general options - basically a collapsed veresion of gen_opts_types. More... | |
dictionary | subdict = {} |
dictionary | tgt_opts_defaults = {} |
Default target options - basically a collapsed version of tgt_opts_types. More... | |
dictionary | bkwd |
Option maps for maintaining backward compatibility. More... | |
list | mainsections = ["SIMULATION","TARGET","OPTIONS","END","NONE"] |
Listing of sections in the input file. More... | |
dictionary | ParsTab |
ParsTab that refers to subsection parsers. More... | |
def src.parser.parse_inputs | ( | input_file = None | ) |
Parse through the input file and read all user-supplied options.
This is usually the first thing that happens when an executable script is called. Our parser first loads the default options, and then updates these options as it encounters keywords.
Each keyword corresponds to a variable type; each variable type (e.g. string, integer, float, boolean) is treated differently. For more elaborate inputs, there is a 'section' variable type.
There is only one set of general options, but multiple sets of target options. Each target has its own section delimited by the $target keyword, and we build a list of target options.
[in] | input_file | The name of the input file. |
Implement internal coordinates.
Implement sampling correction.
Implement charge groups.
Definition at line 471 of file parser.py.
def src.parser.printsection | ( | heading, | |
optdict, | |||
typedict | |||
) |
Print out a section of the input file in a parser-compliant and readable format.
At the time of writing of this function, it's mainly intended to be called by MakeInputFile.py. The heading is printed first (it is something like $options or $target). Then it loops through the variable types (strings, allcaps, etc...) and the keys in each variable type. The one-line description of each key is printed out as a comment, and then the key itself is printed out along with the value provided in optdict. If optdict is None, then the default value is printed out instead.
[in] | heading | Heading, either $options or $target |
[in] | optdict | Options dictionary or None. |
[in] | typedict | Option type dictionary, either gen_opts_types or tgt_opts_types specified in this file. |
src.parser.all_opts_names = list(itertools.chain(*[i.keys() for i in gen_opts_types.values()])) + list(itertools.chain(*[i.keys() for i in tgt_opts_types.values()])) |
dictionary src.parser.bkwd |
Option maps for maintaining backward compatibility.
dictionary src.parser.gen_opts_defaults = {} |
dictionary src.parser.gen_opts_types |
Default general options.
Note that the documentation is included in part of the key; this will aid in automatic doc-extraction. :) In the 5-tuple we have: Default value, priority (larger number means printed first), short docstring, description of scope, list of filter strings for pulling out pertinent targets (MakeInputFile.py)
list src.parser.iocc = [] |
list src.parser.mainsections = ["SIMULATION","TARGET","OPTIONS","END","NONE"] |
dictionary src.parser.ParsTab |
dictionary src.parser.tgt_opts_defaults = {} |