SectionDefinition
- class ase2sprkkr.common.container_definitions.SectionDefinition(name, members=[], alternative_names=[], info=None, description=None, is_optional=False, is_hidden=False, is_expert=False, has_hidden_members=False, name_in_grammar=None, force_order=None, write_alternative_name=False, result_class=None, is_repeated=False)[source]
Base class for definition of the sections in Pot or InputParameters files.
It just redefine a few properties/methods to values/behavior typical for the sections
Class hierarchy
Constructor
- Parameters:
write_alternative_name (bool) –
- __init__(name, members=[], alternative_names=[], info=None, description=None, is_optional=False, is_hidden=False, is_expert=False, has_hidden_members=False, name_in_grammar=None, force_order=None, write_alternative_name=False, result_class=None, is_repeated=False)
Definition of container (e.g. section of an input file). For the rest of the parameters see the
RealItemDefinition
.- Parameters:
has_hidden_members (bool) – If true, this section is not intended for a direct editing
is_repeated (bool or string) – The section can be repeated. The name of the section appears only once on the beginning (this differs from ValueDefinition.is_repeated #TODO - merge the meaning of the swtich). If a non-empty string is given, the values are divided by the string.
force_order (bool) – If True, the items has to retain the order, if False, the items can be in the input file in any order.
write_alternative_name (bool) –
- property values
- custom_value_name = 'CUSTOM_VALUE'
Just the name that appears in the grammar, when it is printed.
- classmethod delimited_custom_value_grammar()[source]
Return the grammar for the custom child with delimiter. The delimiter can delimite it either from the previous child or from the section name.
- accept_value(value)[source]
Return, whether a given value is accepted by this type of object. Accepting does not mean that the value can be validated. It is a base check, that a type of the value is suitable to be used here. If it is not – e.g. single value is assigned to a section – then the container can try to find another object (e.g. contained value of the same name) where the value is accepted.
- Return type:
bool