_Configuration.set
- _Configuration.set(section, option, value, no_hook=False)
set a property in a section. Preferably use
__getitem__and__setitem__.- Parameters:
section (
str) – The section name (has to exist in defaults).option (
str) – The option/property name (has to exist in defaults).value (
str) – The value (will be stored as string).no_hook (
bool, optional) – Should this call trigger the hooks?
- Raises:
SyntaxError – If the section name or the property name does not exist.
ValueError – If the value does not respect the type declared for this key in defaults.
Example
import pyagrum as gum
gum.config.push()
gum.config.set("tensor", "visibleDigits", 6) # same as gum.config["tensor", "visibleDigits"] = 6
gum.config["tensor", "visibleDigits"]
# '6'
gum.config.pop()
Class