GlobalConfigMap in Python#

The global configuration map is a data structure that contains all of the options passed to Einsums or set by its modules. This functionality has been exposed to Python so that users can use it.

class einsums.core.GlobalConfigMap#

A data structure containing all of the various options provided by Einsums. Users can add their own as well.

static get_singleton() einsums.core.GlobalConfigMap#

Returns the single unique instance of the map.

emtpy() bool#

Checks whether the map has any data.

Returns:

True if the map is empy, false if there is data in the map.

size() int#

Gets the number of items in the map.

Returns:

The number of items in the map.

max_size() int#

Finds the maximum size of the map. If an element is added that would push the map past this size, it will need to be reallocated.

Returns:

The maximum number of elements the map can contain.

get_str(key: str) str#

Gets the value of a string option.

Parameters:

key – The option name to retrieve.

Returns:

The value associated with the given key, or the empty string "" if there is no value.

get_int(key: str) int#

Gets the value of an integer option.

Parameters:

key – The option name to retrieve.

Returns:

The value associated with the given key, or 0 if there is no value.

get_float(key: str) float#

Gets the value of a floating-point option.

Parameters:

key – The option name to retrieve.

Returns:

The value associated with the given key, or 0.0 if there is no value.

get_bool(key: str) bool#

Gets the value of a Boolean option.

Parameters:

key – The option name to retrieve.

Returns:

The value associated with the given key, or false if there is no value.

set_str(key: str, value: str)#

Sets the value of a string option. Adds the option if it does not already exist.

Parameters:
  • key – The name of the option.

  • value – The new value to associate with the option.

set_int(key: str, value: int)#

Sets the value of an integer option. Adds the option if it does not already exist.

Parameters:
  • key – The name of the option.

  • value – The new value to associate with the option.

set_float(key: str, value: float)#

Sets the value of a floating-point option. Adds the option if it does not already exist.

Parameters:
  • key – The name of the option.

  • value – The new value to associate with the option.

set_bool(key: str, value: bool)#

Sets the value of a Boolean option. Adds the option if it does not already exist.

Parameters:
  • key – The name of the option.

  • value – The new value to associate with the option.