YAML- and JSON-format input files¶
In its new input format, APBS accepts either JSON- or YAML-format input files.
These input files consist of the following keywords and objects:
Input file class structure¶
The input file object parsing and validation follows the basic pattern implemented in apbs.input_file.InputFile
(see below).
This class should serve as a template for adding new input file sections.
Input file parsing classes.
-
class
apbs.input_file.
InputFile
(dict_=None, yaml=None, json=None)[source]¶ Bases:
abc.ABC
Base class for input file classes.
-
from_dict
(input_)[source]¶ Parse dictionary-format input into this object.
Parameters: input (dict) – input dictionary Raises: KeyError – when input is missing
-
from_json
(input_)[source]¶ Parse JSON-format input string into this object.
Parameters: input (str) – JSON-format input string
-
from_yaml
(input_)[source]¶ Parse YAML-format input string into this object.
Parameters: input (str) – YAML-format input string
-
validate
()[source]¶ Validate the object.
Raises: ValueError – if object is not valid
-