Switch
- class ase2sprkkr.common.configuration_definitions.Switch(item, values, name=None, template=None)[source]
Items of this class can control, which elements of grammar will be active and which not
Class hierarchy
Constructor
- __init__(item, values, name=None, template=None)[source]
- Parameters:
item – The name of Option, whose value determine the active elements
values –
Dictionary, with the possible values of the item in the keys and the active elements in the values.
example:
V('TYPE', Keyword('SCALAR', 'COMPLEX'), Switch( {'SCALAR' : V('SCALAR' : int), 'COMPLEX': V('COMPLEX', complex) }
desribes both the following files:
TYPE=SCALAR SCALAR=1
- and::
TYPE=COMPLEX COMPLEX=1e5 7e5
name – Not needed to be supplied, it can be autogenerated.
- create_object = None
- empty = Empty
- Parameters:
name (str | None) –
- Return type:
ParserElement