BaseOption

class ase2sprkkr.common.options.BaseOption(definition, container=None)[source]

A base placeholder for a leaf element of a grammar file, both the a-value-holding ones (Option) and dummy ones (Dummy)

Class hierarchy

Inheritance diagram of ase2sprkkr.common.options.BaseOption

Constructor

__init__(definition, container=None)

Create the object. Just sets the two properties from the parameters.

Parameters:
_save_to_file(file, always=False, name_in_grammar=None, delimiter='')[source]

Write the name-value pair to the given file, if the value is set.

_find_value(name, lower_case=True)[source]
get_path()[source]
as_dict(only_changed='basic', generated=False, copy=False)[source]

Return the value of self, in the case of container as a dictionary. To be redefined in the descendants.

Parameters:
  • only_changed (bool | str) – Return only changed values, or all of them? If True, return only the values, that differ from the defaults. If False, return all the values. The default value ‘basic’ means, return all non-expert values and all changed expert values.

  • generated (bool) –

  • copy (bool) –

clear(do_not_check_required=False, call_hooks=True, generated=True)[source]