_Configuration.load

_Configuration.load()

load pyagrum.ini in the current directory, and change the properties if needed. If pyagrum.ini contains deprecated keys or invalid values, a warning is emitted. pyagrum.ini is never modified by load(): a deprecated key is applied to its replacement, and save() writes pyagrum.ini with the new key names.

Raises:
  • FileNotFoundError – If there is no readable pyagrum.ini in the current directory.

  • SyntaxError – If pyagrum.ini contains 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

_Configuration