2.11. Data model for user computational settings

In this module, we give a simple computational settings DEFAULT_SETTINGS, which will be used by default in the following calculation, if the users do not specify settings themselves. If they want, they can write some settings in a YAML file.

class qha.settings.Settings(*user_settings)[source]

Contains both user “settings” and default “settings”, where user “settings” will override default “settings”.

The default “settings” are

DEFAULT_SETTINGS: = {
    'energy_unit': 'ry',
    'length_unit': 'angstrom',
    'order': 3,
    'p_min_modifier': 1.0,
    'target': 'parallel',
    'T_MIN': 0,
    'DT_SAMPLE': 10,
    'DELTA_P': 0.1,
    'DELTA_P_SAMPLE': 1,
    'static_only': False,
    'output_directory': './results/',
    'T4FV': ['0', '300'],
    'high_verbosity': False
}
Parameters

user_settings (Union[Dict[str, Any], Tuple[Dict[str, Any], …]]) – It can be a single dictionary or a tuple of dictionaries, with strings as their keys.

to_yaml_file(filename)[source]
qha.settings.from_yaml(filename)[source]

This function reads user “settings” from a YAML file, and generate a Settings class for later use.

Parameters

filename (str) – The name of the YAML file.

Return type

Settings

Returns

A Settings class.