pyabsa.framework.configuration_class.configuration_template
Module Contents
Classes
Simple object for storing attributes. |
Attributes
- class pyabsa.framework.configuration_class.configuration_template.ConfigManager(args=None, **kwargs)[source]
Bases:
argparse.Namespace
Simple object for storing attributes.
Implements equality by attribute names and values, and provides a simple string representation.
- __getattribute__(arg_name)[source]
Get the value of an argument and increment its call count.
- Parameters:
arg_name – The name of the argument.
- Returns:
The value of the argument.
- __setattr__(arg_name, value)[source]
Set the value of an argument and add it to the argument dict and call count dict.
- Parameters:
arg_name – The name of the argument.
value – The value of the argument.
- get(key, default=None)[source]
Get the value of a key from the parameter dict. If the key is found, increment its call frequency. :param key: The key to look for in the parameter dict. :param default: The default value to return if the key is not found. :return: The value of the key in the parameter dict, or the default value if the key is not found.
- update(*args, **kwargs)[source]
Update the parameter dict with the given arguments and keyword arguments, and check if the updated configuration is valid. :param args: Positional arguments to update the parameter dict. :param kwargs: Keyword arguments to update the parameter dict.
- pop(*args)[source]
Pop a value from the parameter dict. :param args: Arguments to pop from the parameter dict. :return: The value popped from the parameter dict.
- keys()[source]
Get a list of all keys in the parameter dict. :return: A list of all keys in the parameter dict.
- values()[source]
Get a list of all values in the parameter dict. :return: A list of all values in the parameter dict.
- items()[source]
Get a list of all key-value pairs in the parameter dict. :return: A list of all key-value pairs in the parameter dict.
- __str__()[source]
Get a string representation of the parameter dict. :return: A string representation of the parameter dict.
- __contains__(item)[source]
Check if the given item is in the parameter dict. :param item: The item to check. :return: True if the item is in the parameter dict, False otherwise.
- __getitem__(item)[source]
Get the value of a key from the parameter dict. :param item: The key to look for in the parameter dict. :return: The value of the key in the parameter dict.
- __setitem__(key, value)[source]
Set the value of a key in the parameter dict. Also set the call frequency of the key to 0 and check if the updated configuration is valid. :param key: The key to set the value for in the parameter dict. :param value: The value to set for the key in the parameter dict.
- __delitem__(key)[source]
Delete a key-value pair from the parameter dict and check if the updated configuration is valid. :param key: The key to delete from the parameter dict.