hpcflow.sdk.config.config_file.ConfigFile#
- class hpcflow.sdk.config.config_file.ConfigFile(directory, logger, config_options)#
Bases:
object
Configuration file.
- Parameters:
directory – The directory containing the configuration file.
logger – Where to log messages.
config_options – Configuration options.
Methods
Add a new default config to the config file, and create the file if it doesn't exist.
Get the path to the configuration file.
Get a configuration item.
Get the invocation data for the given configuration.
Get the invocation for the given configuration.
Determine if a configuration item is set.
Change the config key of the loaded config.
Write the (modified) configuration to the configuration file.
Select a matching configuration for this invocation using run-time info.
Modify the invocation parameters of the loaded config.
Attributes
Where to log messages.
The directory containing the configuration file.
The path to the config file.
The cached contents of the config file.
The parsed contents of the config file.
The parsed contents of the config file where the alternate parser was used.
- add_default_config(config_options, name=None)#
Add a new default config to the config file, and create the file if it doesn’t exist.
- Return type:
- contents#
The cached contents of the config file.
- data#
The parsed contents of the config file.
- data_rt#
The parsed contents of the config file where the alternate parser was used.
- directory#
The directory containing the configuration file.
- static get_config_file_path(directory)#
Get the path to the configuration file.
- get_config_item(config_key, name, raise_on_missing=False, default_value=None)#
Get a configuration item.
- Parameters:
config_key (str) – The name of the configuration within the configuration file.
name (str) – The name of the configuration item.
raise_on_missing (bool) – Whether to raise an error if the config item is absent.
default_value – The default value to use when the config item is absent (and
raise_on_missing
is not specified).
- get_invoc_data(config_key)#
Get the invocation data for the given configuration.
- Parameters:
config_key (str) – The name of the configuration within the configuration file.
- get_invocation(config_key)#
Get the invocation for the given configuration.
- Parameters:
config_key (str) – The name of the configuration within the configuration file.
- is_item_set(config_key, name)#
Determine if a configuration item is set.
- logger#
Where to log messages.
- path#
The path to the config file.
- rename_config_key(config_key, new_config_key)#
Change the config key of the loaded config.
- save()#
Write the (modified) configuration to the configuration file.
- static select_invocation(configs, run_time_info, path, config_key=None)#
Select a matching configuration for this invocation using run-time info.
- update_invocation(config_key, environment_setup=None, match=None)#
Modify the invocation parameters of the loaded config.