RootConfigurationContainer

class ase2sprkkr.common.configuration_containers.RootConfigurationContainer(definition, container=None)[source]

Base class for data of configuration/problem-definition files

In addition to container capabilities, it can read its data from/to file.

Class hierarchy

Inheritance diagram of ase2sprkkr.common.configuration_containers.RootConfigurationContainer


Constructor

__init__(definition, container=None)

Create the container and its members, according to the definition

name_in_grammar = False
_filename = None
read_from_file(file, clear_first=True, allow_dangerous=False, *, allow_incomplete=False, report_invalid=None)[source]

Read data from a file

Parameters:
  • file (str or file) – File to read the data from

  • clear_first (bool) – Clear the container first. Otherwise, the data in the sections that are not present in the file are preserved.

  • allow_dangerous (bool) – Allow values violating type or other constraints.

  • allow_incomplete – Allow missing non-optional items and report their absence.

  • report_invalid (Literal['raise', 'warn', 'ignore'] | None) – Validation reporting policy: “raise”, “warn” (default for parsing), or “ignore”.

property original_filename
find(name, unknown='find', is_option=True, lower_case=True, first=True)[source]

Find a configuration value of a given name in the owned sections

_abc_impl = <_abc._abc_data object>