_Configuration.load
- _Configuration.load()
load
pyagrum.iniin the current directory, and change the properties if needed. Ifpyagrum.inicontains deprecated keys or invalid values, a warning is emitted.pyagrum.iniis never modified byload(): a deprecated key is applied to its replacement, andsave()writespyagrum.iniwith the new key names.- Raises:
FileNotFoundError – If there is no readable
pyagrum.iniin the current directory.SyntaxError – If
pyagrum.inicontains a malformed line (in this case, nothing is changed).
Example
import pyagrum as gum
with open("pyagrum.ini", "w") as f:
f.write("[tensor]\nvisibleDigits = 6\n")
gum.config.push()
gum.config.load() # pyagrum.ini of the current directory
gum.config["tensor", "visibleDigits"]
# '6'
gum.config.pop()
Class