pyabsa.framework.configuration_class.configuration_template

Attributes

config

Classes

ConfigManager

Simple object for storing attributes.

Module Contents

class pyabsa.framework.configuration_class.configuration_template.ConfigManager(args=None, **kwargs)

Bases: argparse.Namespace

Simple object for storing attributes.

Implements equality by attribute names and values, and provides a simple string representation.

__getattribute__(arg_name)

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)

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)

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)

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)

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()

Get a list of all keys in the parameter dict. :return: A list of all keys in the parameter dict.

values()

Get a list of all values in the parameter dict. :return: A list of all values in the parameter dict.

items()

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__()

Get a string representation of the parameter dict. :return: A string representation of the parameter dict.

__repr__()

Return the string representation of the parameter dict.

__len__()

Return the number of items in the parameter dict.

__iter__()

Return an iterator over the keys of the parameter dict.

__contains__(item)

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)

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)

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)

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.

__eq__(other)

Check if the parameter dict is equal to another object. :param other: The other object to compare with the parameter dict. :return: True if the parameter dict is equal to the other object, False otherwise.

__ne__(other)

Check if the parameter dict is not equal to another object. :param other: The other object to compare with the parameter dict. :return: True if the parameter dict is not equal to the other object, False otherwise.

pyabsa.framework.configuration_class.configuration_template.config