atomsmltr.utils package#

The atomsmltr.utils subpackage provides several tools that are useful accross the whole module

class atomsmltr.utils.InfoString(title: str)[source]#

Bases: object

Generates info strings

Parameters:

title (str) – the title of the infostring object

absorb_section(info, target_section: str, new_name: str = None)[source]#

incorporates a section from another infostring object

Parameters:
  • info (InfoString) – the infostring object from which we take the section

  • target_section (str) – name of the section to incorporate

  • new_name (str, optional) – name of the incorporated section. If None is given we use the name of the original section, by default None

add_element(name: str, value: str = None, section: str = None)[source]#

adds an element in a given section

Parameters:
  • name (str) – name of the element

  • value (str, optional) – value of the element, by default None

  • section (str, optional) – name of the section. If None is given, the element is added to the lastly used section, by default None

add_section(name: str)[source]#

adds a new section for parameters

Parameters:

name (str) – the section name

property elements#

the elements inside the infostring object

Type:

OrderedDict

generate(display_title=True)[source]#

generates a string from the infostring object

Parameters:

display_title (bool, optional) – whether to display the title, by default True

Returns:

out_str – a string with all parameters from the info string

Return type:

str

merge(info, prefix='')[source]#

merges an entire infostring

Parameters:
  • info (InfoString) – infostring object to merge

  • prefix (str, optional) – prefix added to the names of the sections incorporated from the merged infostring, by default “”

rm_element(name: str, section: str = None)[source]#

removes an element from a section

Parameters:
  • name (str) – name of the element to remove

  • section (str, optional) – name of the section. If None is given, the element is removed from the lastly used section, by default None

property title: str#

titile of the infostring object

Type:

str

class atomsmltr.utils.Plottable[source]#

Bases: ABC

This class defines several methods that should be common to all objects that contain data to be plotted

Subpackages#

Submodules#