Utility Functions/Classes

Custom Datatypes

This module defines subclasses of UserDict and UserList to be able to prevent unintended modifications

masci_tools.util.lockable_containers.LockContainer(lock_object: Union[masci_tools.util.lockable_containers.LockableList, masci_tools.util.lockable_containers.LockableDict]) Generator[source]

Contextmanager for temporarily locking a lockable object. Object is unfrozen when exiting with block

Parameters

lock_object – lockable container (not yet frozen)

class masci_tools.util.lockable_containers.LockableDict(*args: dict, recursive: bool = True, **kwargs: object)[source]

Subclass of UserDict, which can prevent modifications to itself. Raises RuntimeError if modification is attempted.

Use LockableDict.freeze() to enforce. LockableDict.get_unlocked() returns a copy of the locked object with builtin lists and dicts

Parameters

recursive – bool if True (default) all subitems (lists or dicts) are converted into their lockable counterparts

All other args or kwargs will be passed on to initialize the UserDict

IMPORTANT NOTE:

This is not a direct subclass of dict. So isinstance(a, dict) will be False if a is an LockableDict

freeze() None[source]

Freezes the object. This prevents further modifications

get_unlocked() dict[source]

Get copy of object with builtin lists and dicts

property locked: bool

Returns whether the object is locked

class masci_tools.util.lockable_containers.LockableList(*args: Iterable[Any], recursive: bool = True, **kwargs: Iterable[Any])[source]

Subclass of UserList, which can prevent modifications to itself. Raises RuntimeError if modification is attempted.

Use LockableList.freeze() to enforce. LockableList.get_unlocked() returns a copy of the locked object with builtin lists and dicts

Parameters

recursive – bool if True (default) all subitems (lists or dicts) are converted into their lockable counterparts

All other args or kwargs will be passed on to initialize the UserList

IMPORTANT NOTE:

This is not a direct subclass of list. So isinstance(a, list) will be False if a is an LockableList

append(item: object) None[source]

S.append(value) – append value to the end of the sequence

clear() None[source]

Clear the list

extend(other: Iterable[object]) None[source]

S.extend(iterable) – extend sequence by appending elements from the iterable

freeze() None[source]

Freezes the object. This prevents further modifications

get_unlocked() Iterable[Any][source]

Get copy of object with builtin lists and dicts

insert(i: int, item: object) None[source]

S.insert(index, value) – insert value before index

property locked: bool

Returns whether the object is locked

pop(i: int = - 1) object[source]

return the value at index i (default last) and remove it from list

remove(item: object) None[source]

S.remove(value) – remove first occurrence of value. Raise ValueError if the value is not present.

reverse() None[source]

S.reverse() – reverse IN PLACE

This module defines a small helper class to make case insensitive dictionary lookups available naturally

class masci_tools.util.case_insensitive_dict.CaseInsensitiveDict(*args: Mapping[Any, Any], upper: bool = False, **kwargs: Union[bool, object])[source]

Dict with case insensitive lookup. Used in Schema dicts to make finding paths for tags and attributes easier. Does not preserve the case of the inserted key. Does not support case insensitive lookups in nested dicts Subclass of masci_tools.util.lockable_containers.LockableDict. So can be frozen via the`freeze()` method

Parameters

upper – bool if True the method upper() will be used instead of lower() to normalize keys

All other args or kwargs will be passed on to initialize the UserDict

IMPORTANT NOTE:

This is not a direct subcalss of dict. So isinstance(a, dict) will be False if a is an CaseInsensitiveDict

class masci_tools.util.case_insensitive_dict.CaseInsensitiveFrozenSet(iterable: Optional[Iterable[Any]] = None, upper: bool = False)[source]

Frozenset (i.e. immutable set) with case insensitive membership tests. Used in Schema dicts in tag_info entries to make flexible classification easy Preserves the case of the entered keys (original_case() returns the case of the first encounter)

Parameters

iterable – iterable only containing str

Note:

There might be subtle differences to expected behaviour with the methods __radd__, __ror__, and so on

difference(*others: Iterable[Any]) masci_tools.util.case_insensitive_dict.CaseInsensitiveFrozenSet[source]

Return the difference of two or more sets as a new set.

(i.e. all elements that are in this set but not the others.)

intersection(*others: Iterable[Any]) masci_tools.util.case_insensitive_dict.CaseInsensitiveFrozenSet[source]

Return the intersection of two sets as a new set.

(i.e. all elements that are in both sets.)

isdisjoint(other: Iterable[Any]) bool[source]

Return True if two sets have a null intersection.

issubset(other: Iterable[Any]) bool[source]

Report whether another set contains this set.

issuperset(other: Iterable[Any]) bool[source]

Report whether this set contains another set.

symmetric_difference(other: Iterable[Any]) masci_tools.util.case_insensitive_dict.CaseInsensitiveFrozenSet[source]

Return the symmetric difference of two sets as a new set.

(i.e. all elements that are in exactly one of the sets.)

union(*others: Iterable[Any]) masci_tools.util.case_insensitive_dict.CaseInsensitiveFrozenSet[source]

Return the union of sets as a new set.

(i.e. all elements that are in either set.)

Common XML utility

Common functions for parsing input/output files or XMLschemas from FLEUR

masci_tools.util.xml.common_functions.abs_to_rel_xpath(xpath, new_root)[source]

Convert a given xpath to be relative from a tag appearing in the original xpath.

Parameters
  • xpath – str of the xpath to convert

  • new_root – str of the tag from which the new xpath should be relative

Returns

str of the relative xpath

masci_tools.util.xml.common_functions.check_complex_xpath(node, base_xpath, complex_xpath)[source]

Check that the given complex xpath produces a subset of the results for the simple xpath

Parameters
  • node – root node of an etree

  • base_xpath – str of the xpath without complex syntax

  • complex_xpath – str of the xpath to check

Raises

ValueError – If the complex_xpath does not produce a subset of the results of the base_xpath

masci_tools.util.xml.common_functions.clear_xml(tree)[source]

Removes comments and executes xinclude tags of an xml tree.

Parameters

tree – an xml-tree which will be processed

Returns

cleared_tree, an xmltree without comments and with replaced xinclude tags

masci_tools.util.xml.common_functions.eval_xpath(node, xpath, logger=None, list_return=False, namespaces=None)[source]

Tries to evaluate an xpath expression. If it fails it logs it. If a absolute path is given (starting with ‘/’) and the tag of the node does not match the root. It will try to find the tag in the path and convert it into a relative path

Parameters
  • node – root node of an etree

  • xpath – xpath expression (relative, or absolute)

  • logger – logger object for logging warnings, errors, if not provided all errors will be raised

  • list_return – if True, the returned quantity is always a list even if only one element is in it

  • namespaces – dict, passed to namespaces argument in xpath call

Returns

text, attribute or a node list

masci_tools.util.xml.common_functions.get_xml_attribute(node, attributename, logger=None)[source]

Get an attribute value from a node.

Parameters
  • node – a node from etree

  • attributename – a string with the attribute name.

  • logger – logger object for logging warnings, errors, if not provided all errors will be raised

Returns

either attributevalue, or None

masci_tools.util.xml.common_functions.reverse_xinclude(xmltree, schema_dict, included_tags, **kwargs)[source]

Split the xmltree back up according to the given included tags. The original xmltree will be returned with the corresponding xinclude tags and the included trees are returned in a dict mapping the inserted filename to the extracted tree

Tags for which no known filename is known are returned under unknown-1.xml, … The following tags have known filenames:

  • relaxation: relax.xml

  • kPointLists: kpts.xml

  • symmetryOperations: sym.xml

  • atomSpecies: species.xml

  • atomGroups: atoms.xml

Additional mappings can be given in the keyword arguments

Parameters
  • xmltree – an xml-tree which will be processed

  • schema_dict – Schema dictionary containing all the necessary information

  • included_tags – Iterable of str, containing the names of the tags to be excluded

Returns

xmltree with the inseerted xinclude tags and a dict mapping the filenames to the excluded trees

Raises

ValueError – if the tag can not be found in teh given xmltree

masci_tools.util.xml.common_functions.split_off_attrib(xpath)[source]

Splits off attribute of the given xpath (part after @)

Parameters

xpath – str of the xpath to split up

masci_tools.util.xml.common_functions.split_off_tag(xpath)[source]

Splits off the last part of the given xpath

Parameters

xpath – str of the xpath to split up

masci_tools.util.xml.common_functions.validate_xml(xmltree, schema, error_header='File does not validate')[source]

Checks a given xmltree against a schema and produces a nice error message with all the validation errors collected

Parameters
  • xmltree – xmltree of the file to validate

  • schema – etree.XMLSchema to validate against

  • error_header – str to lead a evtl error message with

Raises

etree.DocumentInvalid if the schema does not validate

Common functions for converting types to and from XML files

masci_tools.util.xml.converters.convert_fleur_electronconfig(econfig_element)[source]

Convert electronConfig tag to eConfig string

masci_tools.util.xml.converters.convert_fleur_lo(loelements)[source]

Converts lo xml elements from the inp.xml file into a lo string for the inpgen

masci_tools.util.xml.converters.convert_from_fortran_bool(stringbool)[source]

Converts a string in this case (‘T’, ‘F’, or ‘t’, ‘f’) to True or False

Parameters

stringbool – a string (‘t’, ‘f’, ‘F’, ‘T’)

Returns

boolean (either True or False)

masci_tools.util.xml.converters.convert_from_xml(xmlstring, schema_dict, name, text=False, constants=None, logger=None, list_return=False)[source]

Tries to converts a given string to the types specified in the schema_dict. First succeeded conversion will be returned

If no logger is given and a attribute cannot be converted an error is raised

Parameters
  • stringattribute – str, Attribute to convert.

  • schema_dict – Schema dictionary containing all the information

  • name – name of the attribute or element

  • text – bool, decides whether to take the definitions for text or attributes

  • constants – dict, of constants defined in fleur input

  • logger – logger object for logging warnings if given the errors are logged and the list is returned with the unconverted values otherwise a error is raised, when the first conversion fails

  • list_return – if True, the returned quantity is always a list even if only one element is in it

Returns

The converted value of the first successful conversion

masci_tools.util.xml.converters.convert_from_xml_explicit(xmlstring, definitions, constants=None, logger=None, list_return=False)[source]

Tries to converts a given string to the types given in definitions. First succeeded conversion will be returned

If no logger is given and a attribute cannot be converted an error is raised

Parameters
  • stringattribute – str, Attribute to convert.

  • definitions – list of AttributeType definitions

  • constants – dict, of constants defined in fleur input

  • logger – logger object for logging warnings if given the errors are logged and the list is returned with the unconverted values otherwise a error is raised, when the first conversion fails

  • list_return – if True, the returned quantity is always a list even if only one element is in it

Returns

The converted value of the first successful conversion

masci_tools.util.xml.converters.convert_from_xml_single_values(xmlstring, possible_types, constants=None, logger=None, list_return=False)[source]

Tries to converts a given string attribute to the types given in possible_types. First succeeded conversion will be returned

If no logger is given and a attribute cannot be converted an error is raised

Parameters
  • stringattribute – str, Attribute to convert.

  • possible_types – list of str What types it will try to convert to

  • constants – dict, of constants defined in fleur input

  • logger – logger object for logging warnings if given the errors are logged and the list is returned with the unconverted values otherwise a error is raised, when the first conversion fails

  • list_return – if True, the returned quantity is always a list even if only one element is in it

Returns

The converted value of the first successful conversion

masci_tools.util.xml.converters.convert_str_version_number(version_str)[source]

Convert the version number as a integer for easy comparisons

Parameters

version_str – str of the version number, e.g. ‘0.33’

Returns

tuple of ints representing the version str

masci_tools.util.xml.converters.convert_to_fortran_bool(boolean)[source]

Converts a Boolean as string to the format defined in the input

Parameters

boolean – either a boolean or a string (‘True’, ‘False’, ‘F’, ‘T’)

Returns

a string (either ‘t’ or ‘f’)

masci_tools.util.xml.converters.convert_to_xml(value, schema_dict, name, text=False, logger=None, list_return=False)[source]

Tries to converts a given string to the types specified in the schema_dict. First succeeded conversion will be returned

If no logger is given and a attribute cannot be converted an error is raised

Parameters
  • stringattribute – str, Attribute to convert.

  • schema_dict – Schema dictionary containing all the information

  • name – name of the attribute or element

  • text – bool, decides whether to take the definitions for text or attributes

  • constants – dict, of constants defined in fleur input

  • logger – logger object for logging warnings if given the errors are logged and the list is returned with the unconverted values otherwise a error is raised, when the first conversion fails

  • list_return – if True, the returned quantity is always a list even if only one element is in it

Returns

The converted value of the first successful conversion

masci_tools.util.xml.converters.convert_to_xml_explicit(value, definitions, logger=None, float_format='.10', list_return=False)[source]

Tries to convert a given list of values to str for a xml file based on the definitions (length and type). First succeeded conversion will be returned

Parameters
  • textvalue – value to convert

  • definitions – list of AttributeType definitions

  • logger – logger object for logging warnings if given the errors are logged and the list is returned with the unconverted values otherwise a error is raised, when the first conversion fails

  • list_return – if True, the returned quantity is always a list even if only one element is in it

Returns

The converted value of the first succesful conversion

masci_tools.util.xml.converters.convert_to_xml_single_values(value, possible_types, logger=None, float_format='.10', list_return=False)[source]

Tries to converts a given attributevalue to a string for a xml file according to the types given in possible_types. First succeeded conversion will be returned

Parameters
  • value – value to convert.

  • possible_types – list of str What types it will try to convert from

  • logger – logger object for logging warnings if given the errors are logged and the list is returned with the unconverted values otherwise a error is raised, when the first conversion fails

  • list_return – if True, the returned quantity is always a list even if only one element is in it

Returns

The converted str of the value of the first succesful conversion

XML Setter functions

Functions for modifying the xml input file of Fleur utilizing the schema dict and as little knowledge of the concrete xpaths as possible

masci_tools.util.xml.xml_setters_names.add_number_to_attrib(xmltree, schema_dict, attributename, add_number, complex_xpath=None, mode='abs', occurrences=None, **kwargs)[source]

Adds a given number to the attribute value in a xmltree specified by the name of the attribute and optional further specification If there are no nodes under the specified xpath an error is raised

Parameters
  • xmltree – an xmltree that represents inp.xml

  • schema_dict – InputSchemaDict containing all information about the structure of the input

  • attributename – the attribute name to change

  • add_number – number to add/multiply with the old attribute value

  • complex_xpath – an optional xpath to use instead of the simple xpath for the evaluation

  • mode – str (either rel or abs). rel multiplies the old value with add_number abs adds the old value and add_number

  • occurrences – int or list of int. Which occurence of the node to set. By default all are set.

Kwargs:
param tag_name

str, name of the tag where the attribute should be parsed

param contains

str, this string has to be in the final path

param not_contains

str, this string has to NOT be in the final path

param exclude

list of str, here specific types of attributes can be excluded valid values are: settable, settable_contains, other

Returns

xmltree with shifted attribute

masci_tools.util.xml.xml_setters_names.add_number_to_first_attrib(xmltree, schema_dict, attributename, add_number, complex_xpath=None, mode='abs', **kwargs)[source]

Adds a given number to the first occurrence of an attribute value in a xmltree specified by the name of the attribute and optional further specification If there are no nodes under the specified xpath an error is raised

Parameters
  • xmltree – an xmltree that represents inp.xml

  • schema_dict – InputSchemaDict containing all information about the structure of the input

  • attributename – the attribute name to change

  • add_number – number to add/multiply with the old attribute value

  • complex_xpath – an optional xpath to use instead of the simple xpath for the evaluation

  • mode – str (either rel or abs). rel multiplies the old value with add_number abs adds the old value and add_number

Kwargs:
param tag_name

str, name of the tag where the attribute should be parsed

param contains

str, this string has to be in the final path

param not_contains

str, this string has to NOT be in the final path

param exclude

list of str, here specific types of attributes can be excluded valid values are: settable, settable_contains, other

Returns

xmltree with shifted attribute

masci_tools.util.xml.xml_setters_names.create_tag(xmltree, schema_dict, tag, complex_xpath=None, create_parents=False, occurrences=None, **kwargs)[source]

This method creates a tag with a uniquely identified xpath under the nodes of its parent. If there are no nodes evaluated the subtags can be created with create_parents=True

The tag is always inserted in the correct place if a order is enforced by the schema

Parameters
  • xmltree – an xmltree that represents inp.xml

  • schema_dict – InputSchemaDict containing all information about the structure of the input

  • tag – str of the tag to create or etree Element with the same name to insert

  • complex_xpath – an optional xpath to use instead of the simple xpath for the evaluation

  • create_parents – bool optional (default False), if True and the given xpath has no results the the parent tags are created recursively

  • occurrences – int or list of int. Which occurence of the parent nodes to create a tag. By default all nodes are used.

Kwargs:
param contains

str, this string has to be in the final path

param not_contains

str, this string has to NOT be in the final path

Returns

xmltree with created tags

masci_tools.util.xml.xml_setters_names.delete_att(xmltree, schema_dict, attrib_name, complex_xpath=None, occurrences=None, **kwargs)[source]

This method deletes a attribute with a uniquely identified xpath.

Parameters
  • xmltree – an xmltree that represents inp.xml

  • schema_dict – InputSchemaDict containing all information about the structure of the input

  • tag – str of the attribute to delete

  • complex_xpath – an optional xpath to use instead of the simple xpath for the evaluation

  • occurrences – int or list of int. Which occurence of the parent nodes to delete a attribute. By default all nodes are used.

Kwargs:
param tag_name

str, name of the tag where the attribute should be parsed

param contains

str, this string has to be in the final path

param not_contains

str, this string has to NOT be in the final path

param exclude

list of str, here specific types of attributes can be excluded valid values are: settable, settable_contains, other

Returns

xmltree with deleted attributes

masci_tools.util.xml.xml_setters_names.delete_tag(xmltree, schema_dict, tag_name, complex_xpath=None, occurrences=None, **kwargs)[source]

This method deletes a tag with a uniquely identified xpath.

Parameters
  • xmltree – an xmltree that represents inp.xml

  • schema_dict – InputSchemaDict containing all information about the structure of the input

  • tag – str of the tag to delete

  • complex_xpath – an optional xpath to use instead of the simple xpath for the evaluation

  • occurrences – int or list of int. Which occurence of the parent nodes to delete a tag. By default all nodes are used.

Kwargs:
param contains

str, this string has to be in the final path

param not_contains

str, this string has to NOT be in the final path

Returns

xmltree with deleted tags

masci_tools.util.xml.xml_setters_names.replace_tag(xmltree, schema_dict, tag_name, newelement, complex_xpath=None, occurrences=None, **kwargs)[source]

This method deletes a tag with a uniquely identified xpath.

Parameters
  • xmltree – an xmltree that represents inp.xml

  • schema_dict – InputSchemaDict containing all information about the structure of the input

  • tag – str of the tag to replace

  • newelement – etree Element to replace the tag

  • complex_xpath – an optional xpath to use instead of the simple xpath for the evaluation

  • occurrences – int or list of int. Which occurence of the parent nodes to replace a tag. By default all nodes are used.

Kwargs:
param contains

str, this string has to be in the final path

param not_contains

str, this string has to NOT be in the final path

Returns

xmltree with replaced tags

masci_tools.util.xml.xml_setters_names.set_atomgroup(xmltree, schema_dict, attributedict, position=None, species=None, create=False)[source]

Method to set parameters of an atom group of the fleur inp.xml file.

Parameters
  • xmltree – xml etree of the inp.xml

  • schema_dict – InputSchemaDict containing all information about the structure of the input

  • attributedict – a python dict specifying what you want to change.

  • position – position of an atom group to be changed. If equals to ‘all’, all species will be changed

  • species – atom groups, corresponding to the given species will be changed

  • create – bool, if species does not exist create it and all subtags?

Returns

xml etree of the new inp.xml

attributedict is a python dictionary containing dictionaries that specify attributes to be set inside the certain specie. For example, if one wants to set a beta noco parameter it can be done via:

'attributedict': {'nocoParams': {'beta': val}}
masci_tools.util.xml.xml_setters_names.set_atomgroup_label(xmltree, schema_dict, atom_label, attributedict, create=False)[source]

This method calls set_atomgroup() method for a certain atom species that corresponds to an atom with a given label.

Parameters
  • xmltree – xml etree of the inp.xml

  • schema_dict – InputSchemaDict containing all information about the structure of the input

  • atom_label – string, a label of the atom which specie will be changed. ‘all’ to change all the species

  • attributedict – a python dict specifying what you want to change.

  • create – bool, if species does not exist create it and all subtags?

Returns

xml etree of the new inp.xml

attributedict is a python dictionary containing dictionaries that specify attributes to be set inside the certain specie. For example, if one wants to set a beta noco parameter it can be done via:

'attributedict': {'nocoParams': {'beta': val}}
masci_tools.util.xml.xml_setters_names.set_attrib_value(xmltree, schema_dict, attributename, attribv, complex_xpath=None, occurrences=None, create=False, **kwargs)[source]

Sets an attribute in a xmltree to a given value, specified by its name and further specifications. If there are no nodes under the specified xpath a tag can be created with create=True. The attribute values are converted automatically according to the types of the attribute with convert_to_xml() if they are not str already.

Parameters
  • xmltree – an xmltree that represents inp.xml

  • schema_dict – InputSchemaDict containing all information about the structure of the input

  • attributename – the attribute name to set

  • attribv – value or list of values to set

  • complex_xpath – an optional xpath to use instead of the simple xpath for the evaluation

  • occurrences – int or list of int. Which occurence of the node to set. By default all are set.

  • create – bool optional (default False), if True the tag is created if is missing

Kwargs:
param tag_name

str, name of the tag where the attribute should be parsed

param contains

str, this string has to be in the final path

param not_contains

str, this string has to NOT be in the final path

param exclude

list of str, here specific types of attributes can be excluded valid values are: settable, settable_contains, other

Returns

xmltree with set attribute

masci_tools.util.xml.xml_setters_names.set_complex_tag(xmltree, schema_dict, tag_name, changes, complex_xpath=None, create=False, **kwargs)[source]

Function to correctly set tags/attributes for a given tag. Goes through the attributedict and decides based on the schema_dict, how the corresponding key has to be handled. The tag is specified via its name and evtl. further specification

Supports:

  • attributes

  • tags with text only

  • simple tags, i.e. only attributes (can be optional single/multiple)

  • complex tags, will recursively create/modify them

Parameters
  • xmltree – an xmltree that represents inp.xml

  • schema_dict – InputSchemaDict containing all information about the structure of the input

  • tag_name – name of the tag to set

  • attributedict – Keys in the dictionary correspond to names of tags and the values are the modifications to do on this tag (attributename, subdict with changes to the subtag, …)

  • complex_xpath – an optional xpath to use instead of the simple xpath for the evaluation

  • create – bool optional (default False), if True and the path, where the complex tag is set does not exist it is created

Kwargs:
param contains

str, this string has to be in the final path

param not_contains

str, this string has to NOT be in the final path

Returns

xmltree with changes to the complex tag

masci_tools.util.xml.xml_setters_names.set_first_attrib_value(xmltree, schema_dict, attributename, attribv, complex_xpath=None, create=False, **kwargs)[source]

Sets the first occurrence of an attribute in a xmltree to a given value, specified by its name and further specifications. If there are no nodes under the specified xpath a tag can be created with create=True. The attribute values are converted automatically according to the types of the attribute with convert_to_xml() if they are not str already.

Parameters
  • xmltree – an xmltree that represents inp.xml

  • schema_dict – InputSchemaDict containing all information about the structure of the input

  • attributename – the attribute name to set

  • attribv – value or list of values to set

  • complex_xpath – an optional xpath to use instead of the simple xpath for the evaluation

  • create – bool optional (default False), if True the tag is created if is missing

Kwargs:
param tag_name

str, name of the tag where the attribute should be parsed

param contains

str, this string has to be in the final path

param not_contains

str, this string has to NOT be in the final path

param exclude

list of str, here specific types of attributes can be excluded valid values are: settable, settable_contains, other

Returns

xmltree with set attribute

masci_tools.util.xml.xml_setters_names.set_first_text(xmltree, schema_dict, attributename, attribv, complex_xpath=None, create=False, **kwargs)[source]

Sets the text the first occurrence of a tag in a xmltree to a given value, specified by the name of the tag and further specifications. By default the text will be set on all nodes returned for the specified xpath. If there are no nodes under the specified xpath a tag can be created with create=True. The text values are converted automatically according to the types with convert_to_xml() if they are not str already.

Parameters
  • xmltree – an xmltree that represents inp.xml

  • schema_dict – InputSchemaDict containing all information about the structure of the input

  • tag_name – str name of the tag, where the text should be set

  • text – value or list of values to set

  • complex_xpath – an optional xpath to use instead of the simple xpath for the evaluation

  • create – bool optional (default False), if True the tag is created if is missing

Kwargs:
param contains

str, this string has to be in the final path

param not_contains

str, this string has to NOT be in the final path

Returns

xmltree with set text

masci_tools.util.xml.xml_setters_names.set_inpchanges(xmltree, schema_dict, change_dict, path_spec=None)[source]

This method sets all the attribute and texts provided in the change_dict.

The first occurrence of the attribute/tag is set

Parameters
  • xmltree – xml tree that represents inp.xml

  • schema_dict – InputSchemaDict containing all information about the structure of the input

  • path_spec – dict, with ggf. necessary further specifications for the path of the attribute

Params change_dict

dictionary {attrib_name : value} with all the wanted changes.

An example of change_dict:

change_dict = {'itmax' : 1,
               'l_noco': True,
               'ctail': False,
               'l_ss': True}
Returns

an xmltree of the inp.xml file with changes.

masci_tools.util.xml.xml_setters_names.set_kpath(xmltree, schema_dict, kpath, count, gamma=False)[source]

Sets a k-path directly into inp.xml as a alternative kpoint set with purpose ‘bands’

Warning

This method is only supported for input versions before the Max5 release

Parameters
  • xmltree – xml tree that represents inp.xml

  • schema_dict – InputSchemaDict containing all information about the structure of the input

  • kpath – a dictionary with kpoint name as key and k point coordinate as value

  • count – number of k-points

  • gamma – bool that controls if the gamma-point should be included in the k-point mesh

Returns

an xmltree of the inp.xml file with changes.

masci_tools.util.xml.xml_setters_names.set_kpath_max4(xmltree, schema_dict, kpath, count, gamma=False)[source]

Sets a k-path directly into inp.xml as a alternative kpoint set with purpose ‘bands’

Parameters
  • xmltree – xml tree that represents inp.xml

  • schema_dict – InputSchemaDict containing all information about the structure of the input

  • kpath – a dictionary with kpoint name as key and k point coordinate as value

  • count – number of k-points

  • gamma – bool that controls if the gamma-point should be included in the k-point mesh

Returns

an xmltree of the inp.xml file with changes.

masci_tools.util.xml.xml_setters_names.set_kpointlist(xmltree, schema_dict, kpoints, weights, name=None, kpoint_type='path', special_labels=None, switch=False, overwrite=False)[source]

Explicitely create a kPointList from the given kpoints and weights. This routine will add the specified kPointList with the given name.

Warning

For input versions Max4 and older all keyword arguments are not valid (name, kpoint_type, special_labels, switch and overwrite)

Parameters
  • xmltree – xml tree that represents inp.xml

  • schema_dict – InputSchemaDict containing all information about the structure of the input

  • kpoints – list or array containing the relative coordinates of the kpoints

  • weights – list or array containing the weights of the kpoints

  • name – str for the name of the list, if not given a default name is generated

  • kpoint_type – str specifying the type of the kPointList (‘path’, ‘mesh’, ‘spex’, ‘tria’, …)

  • special_labels – dict mapping indices to labels. The labels will be inserted for the kpoints corresponding to the given index

  • switch – bool, if True the kPointlist will be used by Fleur when starting the next calculation

  • overwrite – bool, if True and a kPointlist with the given name already exists it will be overwritten

Returns

an xmltree of the inp.xml file with changes.

masci_tools.util.xml.xml_setters_names.set_kpointlist_max4(xmltree, schema_dict, kpoints, weights)[source]

Explicitely create a kPointList from the given kpoints and weights. This routine is specific to input versions Max4 and before and will replace any existing kPointCount, kPointMesh, … with the specified kPointList

Parameters
  • xmltree – xml tree that represents inp.xml

  • schema_dict – InputSchemaDict containing all information about the structure of the input

  • kpoints – list or array containing the relative coordinates of the kpoints

  • weights – list or array containing the weights of the kpoints

Returns

an xmltree of the inp.xml file with changes.

masci_tools.util.xml.xml_setters_names.set_nkpts(xmltree, schema_dict, count, gamma=False)[source]

Sets a k-point mesh directly into inp.xml

Warning

This method is only supported for input versions before the Max5 release

Parameters
  • xmltree – xml tree that represents inp.xml

  • schema_dict – InputSchemaDict containing all information about the structure of the input

  • count – number of k-points

  • gamma – bool that controls if the gamma-point should be included in the k-point mesh

Returns

an xmltree of the inp.xml file with changes.

masci_tools.util.xml.xml_setters_names.set_nkpts_max4(xmltree, schema_dict, count, gamma=False)[source]

Sets a k-point mesh directly into inp.xml specific for inputs of version Max4

Parameters
  • xmltree – xml tree that represents inp.xml

  • schema_dict – InputSchemaDict containing all information about the structure of the input

  • count – number of k-points

  • gamma – bool that controls if the gamma-point should be included in the k-point mesh

Returns

an xmltree of the inp.xml file with changes.

masci_tools.util.xml.xml_setters_names.set_simple_tag(xmltree, schema_dict, tag_name, changes, complex_xpath=None, create_parents=False, **kwargs)[source]

Sets one or multiple simple tag(s) in an xmltree. A simple tag can only hold attributes and has no subtags. The tag is specified by its name and further specification If the tag can occur multiple times all existing tags are DELETED and new ones are written. If the tag only occurs once it will automatically be created if its missing.

Parameters
  • xmltree – an xmltree that represents inp.xml

  • schema_dict – InputSchemaDict containing all information about the structure of the input

  • tag_name – str name of the tag to modify/set

  • changes – list of dicts or dict with the changes. Elements in list describe multiple tags. Keys in the dictionary correspond to {‘attributename’: attributevalue}

  • complex_xpath – an optional xpath to use instead of the simple xpath for the evaluation

  • create_parents – bool optional (default False), if True and the path, where the simple tags are set does not exist it is created

Kwargs:
param contains

str, this string has to be in the final path

param not_contains

str, this string has to NOT be in the final path

Returns

xmltree with set simple tags

masci_tools.util.xml.xml_setters_names.set_species(xmltree, schema_dict, species_name, attributedict, create=False)[source]

Method to set parameters of a species tag of the fleur inp.xml file.

Parameters
  • xmltree – xml etree of the inp.xml

  • schema_dict – InputSchemaDict containing all information about the structure of the input

  • species_name – string, name of the specie you want to change Can be name of the species, ‘all’ or ‘all-<string>’ (sets species with the string in the species name)

  • attributedict – a python dict specifying what you want to change.

  • create – bool, if species does not exist create it and all subtags?

Raises

ValueError – if species name is non existent in inp.xml and should not be created. also if other given tags are garbage. (errors from eval_xpath() methods)

Return xmltree

xml etree of the new inp.xml

attributedict is a python dictionary containing dictionaries that specify attributes to be set inside the certain specie. For example, if one wants to set a MT radius it can be done via:

attributedict = {'mtSphere' : {'radius' : 2.2}}

Another example:

'attributedict': {'special': {'socscale': 0.0}}

that switches SOC terms on a sertain specie. mtSphere, atomicCutoffs, energyParameters, lo, electronConfig, nocoParams, ldaU and special keys are supported. To find possible keys of the inner dictionary please refer to the FLEUR documentation flapw.de

masci_tools.util.xml.xml_setters_names.set_species_label(xmltree, schema_dict, atom_label, attributedict, create=False)[source]

This method calls set_species() method for a certain atom species that corresponds to an atom with a given label

Parameters
  • xmltree – xml etree of the inp.xml

  • schema_dict – InputSchemaDict containing all information about the structure of the input

  • atom_label – string, a label of the atom which specie will be changed. ‘all’ to change all the species

  • attributedict – a python dict specifying what you want to change.

  • create – bool, if species does not exist create it and all subtags?

Returns

xml etree of the new inp.xml

masci_tools.util.xml.xml_setters_names.set_text(xmltree, schema_dict, tag_name, text, complex_xpath=None, occurrences=None, create=False, **kwargs)[source]

Sets the text on tags in a xmltree to a given value, specified by the name of the tag and further specifications. By default the text will be set on all nodes returned for the specified xpath. If there are no nodes under the specified xpath a tag can be created with create=True. The text values are converted automatically according to the types with convert_to_xml() if they are not str already.

Parameters
  • xmltree – an xmltree that represents inp.xml

  • schema_dict – InputSchemaDict containing all information about the structure of the input

  • tag_name – str name of the tag, where the text should be set

  • text – value or list of values to set

  • complex_xpath – an optional xpath to use instead of the simple xpath for the evaluation

  • occurrences – int or list of int. Which occurence of the node to set. By default all are set.

  • create – bool optional (default False), if True the tag is created if is missing

Kwargs:
param contains

str, this string has to be in the final path

param not_contains

str, this string has to NOT be in the final path

Returns

xmltree with set text

masci_tools.util.xml.xml_setters_names.shift_value(xmltree, schema_dict, change_dict, mode='abs', path_spec=None)[source]

Shifts numerical values of attributes directly in the inp.xml file.

The first occurrence of the attribute is shifted

Parameters
  • xmltree – xml tree that represents inp.xml

  • schema_dict – InputSchemaDict containing all information about the structure of the input

  • change_dict – a python dictionary with the keys to shift and the shift values.

  • mode – ‘abs’ if change given is absolute, ‘rel’ if relative

  • path_spec – dict, with ggf. necessary further specifications for the path of the attribute

Returns

a xml tree with shifted values

An example of change_dict:

change_dict = {'itmax' : 1, 'dVac': -0.123}
masci_tools.util.xml.xml_setters_names.shift_value_species_label(xmltree, schema_dict, atom_label, attributename, value_given, mode='abs', **kwargs)[source]

Shifts the value of an attribute on a species by label if atom_label contains ‘all’ then applies to all species

Parameters
  • xmltree – xml etree of the inp.xml

  • schema_dict – InputSchemaDict containing all information about the structure of the input

  • atom_label – string, a label of the atom which specie will be changed. ‘all’ if set up all species

  • attributename – name of the attribute to change

  • value_given – value to add or to multiply by

  • mode – ‘rel’ for multiplication or ‘abs’ for addition

Kwargs if the attributename does not correspond to a unique path:
param contains

str, this string has to be in the final path

param not_contains

str, this string has to NOT be in the final path

Returns

xml etree of the new inp.xml

masci_tools.util.xml.xml_setters_names.switch_kpointset(xmltree, schema_dict, list_name)[source]

Switch the used k-point set

Warning

This method is only supported for input versions after the Max5 release

Parameters
  • xmltree – xml tree that represents inp.xml

  • schema_dict – InputSchemaDict containing all information about the structure of the input

  • list_name – name of the kPoint set to use

Returns

an xmltree of the inp.xml file with changes.

masci_tools.util.xml.xml_setters_names.switch_kpointset_max4(xmltree, schema_dict, list_name)[source]

Sets a k-point mesh directly into inp.xml specific for inputs of version Max4

Warning

This method is only supported for input versions after the Max5 release

Parameters
  • xmltree – xml tree that represents inp.xml

  • schema_dict – InputSchemaDict containing all information about the structure of the input

  • list_name – name of the kPoint set to use

Returns

an xmltree of the inp.xml file with changes.

This module contains useful methods for initializing or modifying a n_mmp_mat file for LDA+U

masci_tools.util.xml.xml_setters_nmmpmat.rotate_nmmpmat(xmltree, nmmplines, schema_dict, species_name, orbital, phi, theta)[source]

Rotate the density matrix with the given angles phi and theta

Parameters
  • xmltree – an xmltree that represents inp.xml

  • nmmplines – list of lines in the n_mmp_mat file

  • schema_dict – InputSchemaDict containing all information about the structure of the input

  • species_name – string, name of the species you want to change

  • orbital – integer, orbital quantum number of the LDA+U procedure to be modified

  • phi – float, angle (radian), by which to rotate the density matrix

  • theta – float, angle (radian), by which to rotate the density matrix

Raises
  • ValueError – If something in the input is wrong

  • KeyError – If no LDA+U procedure is found on a species

Returns

list with modified nmmplines

masci_tools.util.xml.xml_setters_nmmpmat.set_nmmpmat(xmltree, nmmplines, schema_dict, species_name, orbital, spin, state_occupations=None, orbital_occupations=None, denmat=None, phi=None, theta=None)[source]

Routine sets the block in the n_mmp_mat file specified by species_name, orbital and spin to the desired density matrix

Parameters
  • xmltree – an xmltree that represents inp.xml

  • nmmplines – list of lines in the n_mmp_mat file

  • schema_dict – InputSchemaDict containing all information about the structure of the input

  • species_name – string, name of the species you want to change

  • orbital – integer, orbital quantum number of the LDA+U procedure to be modified

  • spin – integer, specifies which spin block should be modified

  • state_occupations – list, sets the diagonal elements of the density matrix and everything else to zero

  • denmat – matrix, specify the density matrix explicitely

  • phi – float, optional angle (radian), by which to rotate the density matrix before writing it

  • theta – float, optional angle (radian), by which to rotate the density matrix before writing it

Raises
  • ValueError – If something in the input is wrong

  • KeyError – If no LDA+U procedure is found on a species

Returns

list with modified nmmplines

masci_tools.util.xml.xml_setters_nmmpmat.validate_nmmpmat(xmltree, nmmplines, schema_dict)[source]

Checks that the given nmmp_lines is valid with the given xmltree

Checks that the number of blocks is as expected from the inp.xml and each block does not contain non-zero elements outside their size given by the orbital quantum number in the inp.xml. Additionally the occupations, i.e. diagonal elements are checked that they are in between 0 and the maximum possible occupation

Parameters
  • xmltree – an xmltree that represents inp.xml

  • nmmplines – list of lines in the n_mmp_mat file

Raises

ValueError – if any of the above checks are violated.

Functions for modifying the xml input file of Fleur with explicit xpath arguments These can still use the schema dict for finding information about the xpath

masci_tools.util.xml.xml_setters_xpaths.eval_xpath_create(xmltree, schema_dict, xpath, base_xpath, create_parents=False, occurrences=None, list_return=False)[source]

Evaluates and xpath and creates tag if the result is empty

Parameters
  • xmltree – an xmltree that represents inp.xml

  • schema_dict – InputSchemaDict containing all information about the structure of the input

  • xpath – a path where to place a new tag

  • base_xpath – path where to place a new tag without complex syntax ([] conditions and so on)

  • create_parents – bool optional (default False), if True also the parents of the tag are created if they are missing

  • occurrences – int or list of int. Which occurence of the parent nodes to create a tag if the tag is missing. By default all nodes are used.

  • list_return – if True, the returned quantity is always a list even if only one element is in it

Returns

list of nodes from the result of the xpath expression

masci_tools.util.xml.xml_setters_xpaths.xml_add_number_to_attrib(xmltree, schema_dict, xpath, base_xpath, attributename, add_number, mode='abs', occurrences=None)[source]

Adds a given number to the attribute value in a xmltree. By default the attribute will be shifted on all nodes returned for the specified xpath. If there are no nodes under the specified xpath an error is raised

Parameters
  • xmltree – an xmltree that represents inp.xml

  • schema_dict – InputSchemaDict containing all information about the structure of the input

  • xpath – a path where to set the attributes

  • base_xpath – path where to place a new tag without complex syntax ([] conditions and so on)

  • attributename – the attribute name to change

  • add_number – number to add/multiply with the old attribute value

  • mode – str (either rel or abs). rel multiplies the old value with add_number abs adds the old value and add_number

  • occurrences – int or list of int. Which occurence of the node to set. By default all are set.

Raises
  • ValueError – If the attribute is unknown or cannot be float or int

  • ValueError – If the evaluation of the old values failed

  • ValueError – If a float result is written to a integer attribute

Returns

xmltree with shifted attribute

masci_tools.util.xml.xml_setters_xpaths.xml_add_number_to_first_attrib(xmltree, schema_dict, xpath, base_xpath, attributename, add_number, mode='abs')[source]

Adds a given number to the first occurrence of a attribute value in a xmltree. If there are no nodes under the specified xpath an error is raised

Parameters
  • xmltree – an xmltree that represents inp.xml

  • schema_dict – InputSchemaDict containing all information about the structure of the input

  • xpath – a path where to set the attributes

  • base_xpath – path where to place a new tag without complex syntax ([] conditions and so on)

  • attributename – the attribute name to change

  • add_number – number to add/multiply with the old attribute value

  • mode – str (either rel or abs). rel multiplies the old value with add_number abs adds the old value and add_number

Raises
  • ValueError – If the attribute is unknown or cannot be float or int

  • ValueError – If the evaluation of the old values failed

  • ValueError – If a float result is written to a integer attribute

Returns

xmltree with shifted attribute

masci_tools.util.xml.xml_setters_xpaths.xml_create_tag_schema_dict(xmltree, schema_dict, xpath, base_xpath, element, create_parents=False, occurrences=None)[source]

This method evaluates an xpath expression and creates a tag in a xmltree under the returned nodes. If there are no nodes evaluated the subtags can be created with create_parents=True

The tag is always inserted in the correct place if a order is enforced by the schema

Parameters
  • xmltree – an xmltree that represents inp.xml

  • schema_dict – InputSchemaDict containing all information about the structure of the input

  • xpath – a path where to place a new tag

  • base_xpath – path where to place a new tag without complex syntax ([] conditions and so on)

  • element – a tag name or etree Element to be created

  • create_parents – bool optional (default False), if True and the given xpath has no results the the parent tags are created recursively

  • occurrences – int or list of int. Which occurence of the parent nodes to create a tag. By default all nodes are used.

Raises

ValueError – If the nodes are missing and create_parents=False

Returns

xmltree with created tags

masci_tools.util.xml.xml_setters_xpaths.xml_set_attrib_value(xmltree, schema_dict, xpath, base_xpath, attributename, attribv, occurrences=None, create=False)[source]

Sets an attribute in a xmltree to a given value. By default the attribute will be set on all nodes returned for the specified xpath. If there are no nodes under the specified xpath a tag can be created with create=True. The attribute values are converted automatically according to the types of the attribute with convert_to_xml() if they are not str already.

Parameters
  • xmltree – an xmltree that represents inp.xml

  • schema_dict – InputSchemaDict containing all information about the structure of the input

  • xpath – a path where to set the attributes

  • base_xpath – path where to place a new tag without complex syntax ([] conditions and so on)

  • attributename – the attribute name to set

  • attribv – value or list of values to set

  • occurrences – int or list of int. Which occurence of the node to set. By default all are set.

  • create – bool optional (default False), if True the tag is created if is missing

Raises
  • ValueError – If the conversion to string failed

  • ValueError – If the tag is missing and create=False

  • ValueError – If the attributename is not allowed on the base_xpath

Returns

xmltree with set attribute

masci_tools.util.xml.xml_setters_xpaths.xml_set_complex_tag(xmltree, schema_dict, xpath, base_xpath, attributedict, create=False)[source]

Recursive Function to correctly set tags/attributes for a given tag. Goes through the attributedict and decides based on the schema_dict, how the corresponding key has to be handled.

Supports:

  • attributes

  • tags with text only

  • simple tags, i.e. only attributes (can be optional single/multiple)

  • complex tags, will recursively create/modify them

Parameters
  • xmltree – an xmltree that represents inp.xml

  • schema_dict – InputSchemaDict containing all information about the structure of the input

  • xpath – a path where to set the attributes

  • base_xpath – path where to place a new tag without complex syntax ([] conditions and so on)

  • tag_name – name of the tag to set

  • attributedict – Keys in the dictionary correspond to names of tags and the values are the modifications to do on this tag (attributename, subdict with changes to the subtag, …)

  • create – bool optional (default False), if True and the path, where the complex tag is set does not exist it is created

Returns

xmltree with changes to the complex tag

masci_tools.util.xml.xml_setters_xpaths.xml_set_first_attrib_value(xmltree, schema_dict, xpath, base_xpath, attributename, attribv, create=False)[source]

Sets the first occurrence attribute in a xmltree to a given value. If there are no nodes under the specified xpath a tag can be created with create=True. The attribute values are converted automatically according to the types of the attribute with convert_to_xml() if they are not str already.

Parameters
  • xmltree – an xmltree that represents inp.xml

  • schema_dict – InputSchemaDict containing all information about the structure of the input

  • xpath – a path where to set the attribute

  • base_xpath – path where to place a new tag without complex syntax ([] conditions and so on)

  • attributename – the attribute name to set

  • attribv – value or list of values to set

  • create – bool optional (default False), if True the tag is created if is missing

Raises
  • ValueError – If the conversion to string failed

  • ValueError – If the tag is missing and create=False

  • ValueError – If the attributename is not allowed on the base_xpath

Returns

xmltree with set attribute

masci_tools.util.xml.xml_setters_xpaths.xml_set_first_text(xmltree, schema_dict, xpath, base_xpath, text, create=False)[source]

Sets the text on the first occurrence of a tag in a xmltree to a given value. If there are no nodes under the specified xpath a tag can be created with create=True. The text values are converted automatically according to the types with convert_to_xml() if they are not str already.

Parameters
  • xmltree – an xmltree that represents inp.xml

  • schema_dict – InputSchemaDict containing all information about the structure of the input

  • xpath – a path where to set the text

  • base_xpath – path where to place a new tag without complex syntax ([] conditions and so on)

  • text – value or list of values to set

  • create – bool optional (default False), if True the tag is created if is missing

Raises
  • ValueError – If the conversion to string failed

  • ValueError – If the tag is missing and create=False

Returns

xmltree with set text

masci_tools.util.xml.xml_setters_xpaths.xml_set_simple_tag(xmltree, schema_dict, xpath, base_xpath, tag_name, changes, create_parents=False)[source]

Sets one or multiple simple tag(s) in an xmltree. A simple tag can only hold attributes and has no subtags. If the tag can occur multiple times all existing tags are DELETED and new ones are written. If the tag only occurs once it will automatically be created if its missing.

Parameters
  • xmltree – an xmltree that represents inp.xml

  • schema_dict – InputSchemaDict containing all information about the structure of the input

  • xpath – a path where to set the attributes

  • base_xpath – path where to place a new tag without complex syntax ([] conditions and so on)

  • tag_name – name of the tag to set

  • changes – list of dicts or dict with the changes. Elements in list describe multiple tags. Keys in the dictionary correspond to {‘attributename’: attributevalue}

  • create_parents – bool optional (default False), if True and the path, where the simple tags are set does not exist it is created

Returns

xmltree with set simple tags

masci_tools.util.xml.xml_setters_xpaths.xml_set_text(xmltree, schema_dict, xpath, base_xpath, text, occurrences=None, create=False)[source]

Sets the text on tags in a xmltree to a given value. By default the text will be set on all nodes returned for the specified xpath. If there are no nodes under the specified xpath a tag can be created with create=True. The text values are converted automatically according to the types with convert_to_xml() if they are not str already.

Parameters
  • xmltree – an xmltree that represents inp.xml

  • schema_dict – InputSchemaDict containing all information about the structure of the input

  • xpath – a path where to set the text

  • base_xpath – path where to place a new tag without complex syntax ([] conditions and so on)

  • text – value or list of values to set

  • occurrences – int or list of int. Which occurence of the node to set. By default all are set.

  • create – bool optional (default False), if True the tag is created if is missing

Raises
  • ValueError – If the conversion to string failed

  • ValueError – If the tag is missing and create=False

Returns

xmltree with set text

Basic functions for modifying the xml input file of Fleur. These functions DO NOT have the ability to create missing tags on the fly. This functionality is added on top in xml_setters_xpaths since we need the schema dictionary to do these operations robustly

masci_tools.util.xml.xml_setters_basic.xml_create_tag(xmltree, xpath, element, place_index=None, tag_order=None, occurrences=None, correct_order=True, several=True)[source]

This method evaluates an xpath expression and creates a tag in a xmltree under the returned nodes. If there are no nodes under the specified xpath an error is raised.

The tag is appended by default, but can be inserted at a certain index (place_index) or can be inserted according to a given order of tags

Parameters
  • xmltree – an xmltree that represents inp.xml

  • xpath – a path where to place a new tag

  • element – a tag name or etree Element to be created

  • place_index – defines the place where to put a created tag

  • tag_order – defines a tag order

  • occurrences – int or list of int. Which occurence of the parent nodes to create a tag. By default all nodes are used.

  • correct_order – bool, if True (default) and a tag_order is given, that does not correspond to the given order in the xmltree (only order wrong no unknown tags) it will be corrected and a warning is given This is necessary for some edge cases of the xml schemas of fleur

  • several – bool, if True multiple tags od the given name are allowed

Raises

ValueError – If the insertion failed in any way (tag_order does not match, failed to insert, …)

Returns

xmltree with created tags

masci_tools.util.xml.xml_setters_basic.xml_delete_att(xmltree, xpath, attrib, occurrences=None)[source]

Deletes an xml attribute in an xmletree.

Parameters
  • xmltree – an xmltree that represents inp.xml

  • xpath – a path to the attribute to be deleted

  • attrib – the name of an attribute

  • occurrences – int or list of int. Which occurence of the parent nodes to create a tag. By default all nodes are used.

Returns

xmltree with deleted attribute

masci_tools.util.xml.xml_setters_basic.xml_delete_tag(xmltree, xpath, occurrences=None)[source]

Deletes a xml tag in an xmletree.

Parameters
  • xmltree – an xmltree that represents inp.xml

  • xpath – a path to the tag to be deleted

  • occurrences – int or list of int. Which occurence of the parent nodes to create a tag. By default all nodes are used.

Returns

xmltree with deleted tag

masci_tools.util.xml.xml_setters_basic.xml_replace_tag(xmltree, xpath, newelement, occurrences=None)[source]

replaces xml tags by another tag on an xmletree in place

Parameters
  • xmltree – an xmltree that represents inp.xml

  • xpath – a path to the tag to be replaced

  • newelement – a new tag

  • occurrences – int or list of int. Which occurence of the parent nodes to create a tag. By default all nodes are used.

Returns

xmltree with replaced tag

masci_tools.util.xml.xml_setters_basic.xml_set_attrib_value_no_create(xmltree, xpath, attributename, attribv, occurrences=None)[source]

Sets an attribute in a xmltree to a given value. By default the attribute will be set on all nodes returned for the specified xpath.

Parameters
  • xmltree – an xmltree that represents inp.xml

  • xpath – a path where to set the attributes

  • attributename – the attribute name to set

  • attribv – value or list of values to set (if not str they will be converted with str(value))

  • occurrences – int or list of int. Which occurence of the node to set. By default all are set.

Raises

ValueError – If the lengths of attribv or occurrences do not match number of nodes

Returns

xmltree with set attribute

masci_tools.util.xml.xml_setters_basic.xml_set_text_no_create(xmltree, xpath, text, occurrences=None)[source]

Sets the text of a tag in a xmltree to a given value. By default the text will be set on all nodes returned for the specified xpath.

Parameters
  • xmltree – an xmltree that represents inp.xml

  • xpath – a path where to set the text

  • text – value or list of values to set (if not str they will be converted with str(value))

  • occurrences – int or list of int. Which occurrence of the node to set. By default all are set.

Raises

ValueError – If the lengths of text or occurrences do not match number of nodes

Returns

xmltree with set text

XML Getter functions

This module provides functions to extract distinct parts of the fleur xml files for easy versioning and reuse

masci_tools.util.xml.xml_getters.get_cell(xmltree, schema_dict, logger=None, convert_to_angstroem=True)[source]

Get the Bravais matrix from the given fleur xml file. In addition a list determining in, which directions there are periodic boundary conditions in the system.

Warning

Only the explicit definition of the Bravais matrix is supported. Old inputs containing the latnam definitions are not supported

Parameters
  • xmltree – etree representing the fleur xml file

  • schema_dict – schema dictionary corresponding to the file version of the xmltree

  • logger – logger object for logging warnings, errors

  • convert_to_angstroem – bool if True the bravais matrix is converted to angstroem

Returns

numpy array of the bravais matrix and list of boolean values for periodic boundary conditions

masci_tools.util.xml.xml_getters.get_fleur_modes(xmltree, schema_dict, logger=None)[source]

Determine the calculation modes of fleur for the given xml file. Calculation modes are things that change the produced files or output in the out.xml files

Parameters
  • xmltree – etree representing the fleur xml file

  • schema_dict – schema dictionary corresponding to the file version of the xmltree

  • logger – logger object for logging warnings, errors

Returns

dictionary with all the extracted calculation modes

The following modes are inspected:

  • jspin: How many spins are considered in the calculation

  • noco: Is the calculation non-collinear?

  • soc: Is spin-orbit coupling included?

  • relax: Is the calculation a structure relaxation?

  • gw: Special mode for GW/Spex calculations

  • force_theorem: Is a Force theorem calculation performed?

  • film: Is the structure a film system

  • ldau: Is LDA+U included?

  • dos: Is it a density of states calculation?

  • band: Is it a bandstructure calculation?

  • bz_integration: How is the integration over the Brillouin-Zone performed?

masci_tools.util.xml.xml_getters.get_kpoints_data(xmltree, schema_dict, name=None, index=None, only_used=False, logger=None, convert_to_angstroem=True)[source]

Get the kpoint sets defined in the given fleur xml file.

Warning

For file versions before Max5 the name argument is not valid

Parameters
  • xmltree – etree representing the fleur xml file

  • schema_dict – schema dictionary corresponding to the file version of the xmltree

  • name – str, optional, if given only the kpoint set with the given name is returned

  • index – int, optional, if given only the kpoint set with the given index is returned

  • only_used – bool if True only the kpoint list used in the calculation is returned

  • logger – logger object for logging warnings, errors

  • convert_to_angstroem – bool if True the bravais matrix is converted to angstroem

Returns

tuple containing the kpoint information

The tuple contains the following entries:

  1. kpoints

    dict or list (list if there is only one kpoint set), containing the coordinates of the kpoints

  2. weights

    dict or list (list if there is only one kpoint set), containing the weights of the kpoints

  3. cell

    numpy array, bravais matrix of the given system

  4. pbc

    list of booleans, determines in which directions periodic boundary conditions are applicable

masci_tools.util.xml.xml_getters.get_kpoints_data_max4(xmltree, schema_dict, logger=None, convert_to_angstroem=True, only_used=False)[source]

Get the kpoint sets defined in the given fleur xml file.

Note

This function is specific to file version before and including the Max4 release of fleur

Parameters
  • xmltree – etree representing the fleur xml file

  • schema_dict – schema dictionary corresponding to the file version of the xmltree

  • logger – logger object for logging warnings, errors

  • convert_to_angstroem – bool if True the bravais matrix is converted to angstroem

  • only_used – (Has no effect for Max4) bool if True only the kpoint list used in the calculation is returned

Returns

tuple containing the kpoint information

The tuple contains the following entries:

  1. kpoints

    list containing the coordinates of the kpoints

  2. weights

    list containing the weights of the kpoints

  3. cell

    numpy array, bravais matrix of the given system

  4. pbc

    list of booleans, determines in which directions periodic boundary conditions are applicable

masci_tools.util.xml.xml_getters.get_nkpts(xmltree, schema_dict, logger=None)[source]

Get the number of kpoints that will be used in the calculation specified in the given fleur XMl file.

Warning

For file versions before Max5 only kPointList or kPointCount tags will work. However, for kPointCount there is no real guarantee that for every occasion it will correspond to the number of kpoints. So a warning is written out

Parameters
  • xmltree – etree representing the fleur xml file

  • schema_dict – schema dictionary corresponding to the file version of the xmltree

  • logger – logger object for logging warnings, errors

Returns

int with the number of kpoints

masci_tools.util.xml.xml_getters.get_nkpts_max4(xmltree, schema_dict, logger=None)[source]

Get the number of kpoints that will be used in the calculation specified in the given fleur XMl file. Version specific for Max4 versions or older

Warning

For file versions before Max5 only kPointList or kPointCount tags will work. However, for kPointCount there is no real guarantee that for every occasion it will correspond to the number of kpoints. So a warning is written out

Parameters
  • xmltree – etree representing the fleur xml file

  • schema_dict – schema dictionary corresponding to the file version of the xmltree

  • logger – logger object for logging warnings, errors

Returns

int with the number of kpoints

masci_tools.util.xml.xml_getters.get_parameter_data(xmltree, schema_dict, inpgen_ready=True, write_ids=True, extract_econfig=False, logger=None)[source]

This routine returns an python dictionary produced from the inp.xml file, which contains all the parameters needed to setup a new inp.xml from a inpgen input file to produce the same input (for parameters that the inpgen can control)

Parameters
  • xmltree – etree representing the fleur xml file

  • schema_dict – schema dictionary corresponding to the file version of the xmltree

  • inpgen_ready – Bool, return a dict which can be inputed into inpgen while setting atoms

  • write_ids – Bool, if True the atom ids are added to the atom namelists

  • logger – logger object for logging warnings, errors

Returns

dict, which will lead to the same inp.xml (in case if other defaults, which can not be controlled by input for inpgen, were changed)

masci_tools.util.xml.xml_getters.get_relaxation_information(xmltree, schema_dict, logger=None)[source]

Get the relaxation information from the given fleur XML file. This includes the current displacements, energy and posforce evolution

Parameters
  • xmltree – etree representing the fleur xml file

  • schema_dict – schema dictionary corresponding to the file version of the xmltree

  • logger – logger object for logging warnings, errors

Returns

dict with the relaxation information

Raises

ValueError – If no relaxation section is included in the xml tree

masci_tools.util.xml.xml_getters.get_relaxation_information_pre029(xmltree, schema_dict, logger=None)[source]

Get the relaxation information from the given fleur XML file. This includes the current displacements, energy and posforce evolution

Parameters
  • xmltree – etree representing the fleur xml file

  • schema_dict – schema dictionary corresponding to the file version of the xmltree

  • logger – logger object for logging warnings, errors

Returns

dict with the relaxation information

Raises

ValueError – If no relaxation section is included in the xml tree

masci_tools.util.xml.xml_getters.get_structure_data(xmltree, schema_dict, include_relaxations=True, site_namedtuple=False, convert_to_angstroem=True, normalize_kind_name=True, logger=None)[source]

Get the structure defined in the given fleur xml file.

Warning

Only the explicit definition of the Bravais matrix is supported. Old inputs containing the latnam definitions are not supported

Warning

In versions 0.5.0 or later the output of the atom sites was restructured to be more interoperable with other IO functions (e.g. write_inpgen_file()) The new format returns a list of AtomSiteProperties instead of the list of tuples (position, symbol)

For better compatibility this output is not default in 0.5.0 but instead is enabled by site_namedtuple=True and a DeprecationWarning is given when this argument is False.

Note

In versions 0.5.0 or later the returned atom positions correspond to the relaxed structure if a relaxation section is present in the xmltree

Parameters
  • xmltree – etree representing the fleur xml file

  • schema_dict – schema dictionary corresponding to the file version of the xmltree

  • include_relaxations – bool if True and a relaxation section is included the resulting positions correspond to the relaxed structure

  • logger – logger object for logging warnings, errors

  • convert_to_angstroem – bool if True the bravais matrix is converted to angstroem

Returns

tuple containing the structure information

The tuple contains the following entries:

  1. atom_data

    list of (named)tuples containing the absolute positions and symbols of the atoms

  2. cell

    numpy array, bravais matrix of the given system

  3. pbc

    list of booleans, determines in which directions periodic boundary conditions are applicable

masci_tools.util.xml.xml_getters.get_symmetry_information(xmltree, schema_dict, logger=None)[source]

Get the symmetry information from the given fleur XML file. This includes the rotation matrices and shifts defined in the symmetryOperations tag.

Note

Only the explicit definition of the used symmetry operations in the xml file is supported.

Parameters
  • xmltree – etree representing the fleur xml file

  • schema_dict – schema dictionary corresponding to the file version of the xmltree

  • logger – logger object for logging warnings, errors

Returns

tuple of the rotations and their respective shifts

Raises

ValueError – If no symmetryOperations section is included in the xml tree

Basic IO helper functions

Here commonly used functions that do not need aiida-stuff (i.e. can be tested without a database) are collected.

class masci_tools.io.common_functions.AtomSiteProperties(position, symbol, kind)
kind

Alias for field number 2

position

Alias for field number 0

symbol

Alias for field number 1

masci_tools.io.common_functions.abs_to_rel(vector, cell)[source]

Converts a position vector in absolute coordinates to relative coordinates.

Parameters
  • vector – list or np.array of length 3, vector to be converted

  • cell – Bravais matrix of a crystal 3x3 Array, List of list or np.array

Returns

list of length 3 of scaled vector, or False if vector was not length 3

masci_tools.io.common_functions.abs_to_rel_f(vector, cell, pbc)[source]

Converts a position vector in absolute coordinates to relative coordinates for a film system.

Parameters
  • vector – list or np.array of length 3, vector to be converted

  • cell – Bravais matrix of a crystal 3x3 Array, List of list or np.array

  • pbc – Boundary conditions, List or Tuple of 3 Boolean

Returns

list of length 3 of scaled vector, or False if vector was not length 3

masci_tools.io.common_functions.angles_to_vec(magnitude, theta, phi)[source]

convert (magnitude, theta, phi) to (x,y,z)

theta/phi need to be in radians!

Input can be single number, list of numpy.ndarray data Returns x,y,z vector

masci_tools.io.common_functions.camel_to_snake(name)[source]

Converts camelCase to snake_case variable names Used in the Fleur parser to convert attribute names from the xml files

masci_tools.io.common_functions.convert_to_fortran(val, quote_strings=True)[source]
Parameters

val – the value to be read and converted to a Fortran-friendly string.

masci_tools.io.common_functions.convert_to_fortran_string(string)[source]

converts some parameter strings to the format for the inpgen :param string: some string :returns: string in right format (extra “” if not already present)

masci_tools.io.common_functions.convert_to_pystd(value)[source]

Recursively convert numpy datatypes to standard python, needed by aiida-core.

Usage:

converted = convert_to_pystd(to_convert)

where to_convert can be a dict, array, list, or single valued variable

masci_tools.io.common_functions.fac(n)[source]

Returns the factorial of n

masci_tools.io.common_functions.filter_out_empty_dict_entries(dict_to_filter)[source]

Filter out entries in a given dict that correspond to empty values. At the moment this is empty lists, dicts and None

Parameters

dict_to_filter – dict to filter

Returns

dict without empty entries

masci_tools.io.common_functions.find_symmetry_relation(from_pos, to_pos, rotations, shifts, cell, relative_pos=False, film=False)[source]

Find symmetry relation between the given vectors. This functions assumes that a symmetry relation exists otherwise an error is raised

Parameters
  • from_pos – vector to rotate

  • to_pos – vector to rotate to

  • rotations – list of np.arrays with the given symmetry rotations

  • shifts – list of np.arrays with the given shifts for the symmetry operations

  • cell – Bravais matrix of a crystal 3x3 Array, List of list or np.array

  • relative_pos – bool if True the given vectors are assuemd to be in internal coordinates

  • film – bool if True the vectors are assumed to be film coordinates

Returns

tuple of rotation and shift mapping from_pos to to_pos

Raises

ValueError – If no symmetry relation is found

masci_tools.io.common_functions.get_corestates_from_potential(potfile='potential')[source]

Read core states from potential file

masci_tools.io.common_functions.get_ef_from_potfile(potfile)[source]

extract fermi energy from potfile

masci_tools.io.common_functions.get_highest_core_state(nstates, energies, lmoments)[source]

Find highest lying core state from list of core states, needed to find and check energy contour

masci_tools.io.common_functions.get_wigner_matrix(l, phi, theta)[source]

Produces the wigner rotation matrix for the density matrix

Parameters
  • l – int, orbital quantum number

  • phi – float, angle (radian) corresponds to euler angle alpha

  • theta – float, angle (radian) corresponds to euler angle beta

masci_tools.io.common_functions.interpolate_dos(dosfile, return_original=False)[source]

interpolation function copied from complexdos3 fortran code

Principle of DOS here: Two-point contour integration for DOS in the middle of the two points. The input DOS and energy must be complex. Parameter deltae should be of the order of magnitude of eim:

      <-2*deltae->   _
           /\        |     DOS=(n(1)+n(2))/2 + (n(1)-n(2))*eim/deltae
          /  \       |
        (1)  (2)   2*i*eim=2*i*pi*Kb*Tk
        /      \     |
       /        \    |
------------------------ (Real E axis)
Parameters

input – either absolute path of ‘complex.dos’ file or file handle to it

Returns

E_Fermi, numpy array of interpolated dos

Note

output units are in Ry!

masci_tools.io.common_functions.is_sequence(arg)[source]

Checks if arg is a sequence

masci_tools.io.common_functions.open_general(filename_or_handle, iomode=None)[source]

Open a file directly from a path or use a file handle if that is given. Also take care of closed files by reopenning them. This is intended to be used like this:

f = open_general(outfile)
with f: # make sure the file is properly closed
    txt = f.readlines()
masci_tools.io.common_functions.rel_to_abs(vector, cell)[source]

Converts a position vector in internal coordinates to absolute coordinates in Angstrom.

Parameters
  • vector – list or np.array of length 3, vector to be converted

  • cell – Bravais matrix of a crystal 3x3 Array, List of list or np.array

Returns

list of legth 3 of scaled vector, or False if vector was not lenth 3

masci_tools.io.common_functions.rel_to_abs_f(vector, cell)[source]

Converts a position vector in internal coordinates to absolute coordinates in Angstrom for a film structure (2D).

masci_tools.io.common_functions.skipHeader(seq, n)[source]

Iterate over a sequence skipping the first n elements

Args:

seq (iterable): Iterable sequence n (int): Number of Elements to skip in the beginning of the sequence

Yields:

item: Elements in seq after the first n elements

masci_tools.io.common_functions.vec_to_angles(vec)[source]

converts vector (x,y,z) to (magnitude, theta, phi)

Small utility functions for inspecting hdf files and converting the complete file structure into a python dictionary

masci_tools.io.hdf5_util.h5dump(file, group='/')[source]

Shows the overall filestructure of an hdf file Goes through all groups and subgroups and prints the attributes or the shape and datatype of the datasets

Parameters

filepath – path to the hdf file

masci_tools.io.hdf5_util.hdfList(name, obj)[source]

Print the name of the current object (indented to create a nice tree structure)

Also prints attribute values and dataset shapes and datatypes

masci_tools.io.hdf5_util.read_groups(hdfdata, flatten=False)[source]

Recursive function to read a hdf datastructure and extract the datasets and attributes

Parameters
  • hdfdata – current hdf group to process

  • flatten – bool, if True the dictionary will be flattened (does not check for lost information)

Returns

two dictionaries, one with the datasets the other with the attributes in the file

masci_tools.io.hdf5_util.read_hdf_simple(file, flatten=False)[source]

Reads in an hdf file and returns its context in a nested dictionary

Parameters
  • filepath – path or filehandle to the hdf file

  • flatten – bool, if True the dictionary will be flattened (does not check for lost information)

Returns

two dictionaries, one with the datasets the other with the attributes in the file

Non unique group attribute or dataset names will be overwritten in the return dict

Logging Utility

This module defines useful utility for logging related functionality

class masci_tools.util.logging_util.DictHandler(log_dict, ignore_unknown_levels=False, **kwargs)[source]

Custom Handler for the logging module inserting logging messages into a given dictionary.

Messages are grouped into list under the names of the error categories. Keyword arguments can be used to modify the keys for the different levels

emit(record)[source]

Emit a record.

class masci_tools.util.logging_util.OutParserLogAdapter(logger, extra)[source]

This adapter expects the passed in dict-like object to have a ‘iteration’ key, whose value is prepended as [Iteration i] to the message

process(msg, kwargs)[source]

Process the logging message and keyword arguments passed in to a logging call to insert contextual information. You can either manipulate the message itself, the keyword args or both. Return the message and kwargs modified (or not) to suit your needs.

Normally, you’ll only need to override this one method in a LoggerAdapter subclass for your specific needs.

Fleur parser utility

This module contains helper functions for extracting information easily from the schema_dicts defined for the Fleur input/output

Also provides convienient functions to use just a attribute name for extracting the attribute from the right place in the given etree

masci_tools.util.schema_dict_util.attrib_exists(node, schema_dict, name, logger=None, **kwargs)[source]

Evaluates whether the attribute exists in the xmltree based on the given name and additional further specifications with the available type information

Parameters
  • node – etree Element, on which to execute the xpath evaluations

  • schema_dict – dict, containing all the path information and more

  • name – str, name of the tag

  • logger – logger object for logging warnings, errors, if not provided all errors will be raised

Kwargs:
param tag_name

str, name of the tag where the attribute should be parsed

param contains

str, this string has to be in the final path

param not_contains

str, this string has to NOT be in the final path

param exclude

list of str, here specific types of attributes can be excluded valid values are: settable, settable_contains, other

Returns

bool, True if any tag with the attribute exists

masci_tools.util.schema_dict_util.eval_simple_xpath(node, schema_dict, name, logger=None, **kwargs)[source]

Evaluates a simple xpath expression of the tag in the xmltree based on the given name and additional further specifications with the available type information

Parameters
  • node – etree Element, on which to execute the xpath evaluations

  • schema_dict – dict, containing all the path information and more

  • name – str, name of the tag

  • logger – logger object for logging warnings, errors, if not provided all errors will be raised

Kwargs:
param contains

str, this string has to be in the final path

param not_contains

str, this string has to NOT be in the final path

param list_return

bool, if True a list is always returned

Returns

etree Elements obtained via the simple xpath expression

masci_tools.util.schema_dict_util.evaluate_attribute(node, schema_dict, name, constants=None, logger=None, **kwargs)[source]

Evaluates the value of the attribute based on the given name and additional further specifications with the available type information

Parameters
  • node – etree Element, on which to execute the xpath evaluations

  • schema_dict – dict, containing all the path information and more

  • name – str, name of the attribute

  • constants – dict, contains the defined constants

  • logger – logger object for logging warnings, errors, if not provided all errors will be raised

Kwargs:
param tag_name

str, name of the tag where the attribute should be parsed

param contains

str, this string has to be in the final path

param not_contains

str, this string has to NOT be in the final path

param exclude

list of str, here specific types of attributes can be excluded valid values are: settable, settable_contains, other

param list_return

if True, the returned quantity is always a list even if only one element is in it

param optional

bool, if True and no logger given none or an empty list is returned

Returns

list or single value, converted in convert_xml_attribute

masci_tools.util.schema_dict_util.evaluate_parent_tag(node, schema_dict, name, constants=None, logger=None, **kwargs)[source]

Evaluates all attributes of the parent tag based on the given name and additional further specifications with the available type information

Parameters
  • node – etree Element, on which to execute the xpath evaluations

  • schema_dict – dict, containing all the path information and more

  • name – str, name of the tag

  • constants – dict, contains the defined constants

  • logger – logger object for logging warnings, errors, if not provided all errors will be raised

Kwargs:
param contains

str, this string has to be in the final path

param not_contains

str, this string has to NOT be in the final path

param only_required

bool (optional, default False), if True only required attributes are parsed

param ignore

list of str (optional), attributes not to parse

param list_return

if True, the returned quantity is always a list even if only one element is in it

param strict_missing_error

if True, and no logger is given an error is raised if any attribute is not found

Returns

dict, with attribute values converted via convert_xml_attribute

masci_tools.util.schema_dict_util.evaluate_single_value_tag(node, schema_dict, name, constants=None, logger=None, **kwargs)[source]

Evaluates the value and unit attribute of the tag based on the given name and additional further specifications with the available type information

Parameters
  • node – etree Element, on which to execute the xpath evaluations

  • schema_dict – dict, containing all the path information and more

  • name – str, name of the tag

  • constants – dict, contains the defined constants

  • logger – logger object for logging warnings, errors, if not provided all errors will be raised

Kwargs:
param contains

str, this string has to be in the final path

param not_contains

str, this string has to NOT be in the final path

param only_required

bool (optional, default False), if True only required attributes are parsed

param ignore

list of str (optional), attributes not to parse

param list_return

if True, the returned quantity is always a list even if only one element is in it

param strict_missing_error

if True, and no logger is given an error is raised if any attribute is not found

Returns

value and unit, both converted in convert_xml_attribute

masci_tools.util.schema_dict_util.evaluate_tag(node, schema_dict, name, constants=None, logger=None, subtags=False, text=True, **kwargs)[source]

Evaluates all attributes of the tag based on the given name and additional further specifications with the available type information

Parameters
  • node – etree Element, on which to execute the xpath evaluations

  • schema_dict – dict, containing all the path information and more

  • name – str, name of the tag

  • constants – dict, contains the defined constants

  • logger – logger object for logging warnings, errors, if not provided all errors will be raised

  • subtags – optional bool, if True the subtags of the given tag are evaluated

  • text – optional bool, if True the text of the tag is also parsed

Kwargs:
param contains

str, this string has to be in the final path

param not_contains

str, this string has to NOT be in the final path

param only_required

bool (optional, default False), if True only required attributes are parsed

param ignore

list of str (optional), attributes not to parse

param list_return

if True, the returned quantity is always a list even if only one element is in it

param strict_missing_error

if True, and no logger is given an error is raised if any attribute is not found

Returns

dict, with attribute values converted via convert_xml_attribute

masci_tools.util.schema_dict_util.evaluate_text(node, schema_dict, name, constants=None, logger=None, **kwargs)[source]

Evaluates the text of the tag based on the given name and additional further specifications with the available type information

Parameters
  • node – etree Element, on which to execute the xpath evaluations

  • schema_dict – dict, containing all the path information and more

  • name – str, name of the tag

  • constants – dict, contains the defined constants

  • logger – logger object for logging warnings, errors, if not provided all errors will be raised

Kwargs:
param contains

str, this string has to be in the final path

param not_contains

str, this string has to NOT be in the final path

param list_return

if True, the returned quantity is always a list even if only one element is in it

param optional

bool, if True and no logger given none or an empty list is returned

Returns

list or single value, converted in convert_xml_text

masci_tools.util.schema_dict_util.get_attrib_xpath(schema_dict, name, contains=None, not_contains=None, exclude=None, tag_name=None)[source]

Tries to find a unique path from the schema_dict based on the given name of the attribute and additional further specifications

Parameters
  • schema_dict – dict, containing all the path information and more

  • name – str, name of the attribute

  • root_tag – str, name of the tag from which the path should be relative

  • contains – str or list of str, this string has to be in the final path

  • not_contains – str or list of str, this string has to NOT be in the final path

  • exclude – list of str, here specific types of attributes can be excluded valid values are: settable, settable_contains, other

  • tag_name – str, if given this name will be used to find a path to a tag with the same name in get_tag_xpath()

Returns

str, xpath to the tag with the given attribute

Raises

ValueError – If no unique path could be found

masci_tools.util.schema_dict_util.get_number_of_nodes(node, schema_dict, name, logger=None, **kwargs)[source]

Evaluates the number of occurences of the tag in the xmltree based on the given name and additional further specifications with the available type information

Parameters
  • node – etree Element, on which to execute the xpath evaluations

  • schema_dict – dict, containing all the path information and more

  • name – str, name of the tag

  • logger – logger object for logging warnings, errors, if not provided all errors will be raised

Kwargs:
param contains

str, this string has to be in the final path

param not_contains

str, this string has to NOT be in the final path

Returns

bool, True if any nodes with the path exist

masci_tools.util.schema_dict_util.get_relative_attrib_xpath(schema_dict, name, root_tag, contains=None, not_contains=None, exclude=None, tag_name=None)[source]

Tries to find a unique relative path from the schema_dict based on the given name of the attribute name of the root, from which the path should be relative and additional further specifications

Parameters
  • schema_dict – dict, containing all the path information and more

  • name – str, name of the attribute

  • contains – str or list of str, this string has to be in the final path

  • not_contains – str or list of str, this string has to NOT be in the final path

  • exclude – list of str, here specific types of attributes can be excluded valid values are: settable, settable_contains, other

  • tag_name – str, if given this name will be used to find a path to a tag with the same name in get_relative_tag_xpath()

Returns

str, xpath for the given tag

Raises

ValueError – If no unique path could be found

masci_tools.util.schema_dict_util.get_relative_tag_xpath(schema_dict, name, root_tag, contains=None, not_contains=None)[source]

Tries to find a unique relative path from the schema_dict based on the given name of the tag name of the root, from which the path should be relative and additional further specifications

Parameters
  • schema_dict – dict, containing all the path information and more

  • name – str, name of the tag

  • root_tag – str, name of the tag from which the path should be relative

  • contains – str or list of str, this string has to be in the final path

  • not_contains – str or list of str, this string has to NOT be in the final path

Returns

str, xpath for the given tag

Raises

ValueError – If no unique path could be found

masci_tools.util.schema_dict_util.get_tag_info(schema_dict, name, contains=None, not_contains=None, path_return=True, convert_to_builtin=False, multiple_paths=False, parent=False)[source]

Tries to find a unique path from the schema_dict based on the given name of the tag and additional further specifications and returns the tag_info entry for this tag

Parameters
  • schema_dict – dict, containing all the path information and more

  • name – str, name of the tag

  • contains – str or list of str, this string has to be in the final path

  • not_contains – str or list of str, this string has to NOT be in the final path

  • path_return – bool, if True the found path will be returned alongside the tag_info

  • convert_to_builtin – bool, if True the CaseInsensitiveFrozenSets are converetd to normal sets with the rigth case of the attributes

  • multiple_paths – bool, if True mulitple paths are allowed to match as long as they have the same tag_info

  • parent – bool, if True the tag_info for the parent of the tag is returned

Returns

dict, tag_info for the found xpath

Returns

str, xpath to the tag if path_return=True

masci_tools.util.schema_dict_util.get_tag_xpath(schema_dict, name, contains=None, not_contains=None)[source]

Tries to find a unique path from the schema_dict based on the given name of the tag and additional further specifications

Parameters
  • schema_dict – dict, containing all the path information and more

  • name – str, name of the tag

  • contains – str or list of str, this string has to be in the final path

  • not_contains – str or list of str, this string has to NOT be in the final path

Returns

str, xpath for the given tag

Raises

ValueError – If no unique path could be found

masci_tools.util.schema_dict_util.read_constants(root, schema_dict, logger=None)[source]

Reads in the constants defined in the inp.xml and returns them combined with the predefined constants from fleur as a dictionary

Parameters
  • root – root of the etree of the inp.xml file

  • schema_dict – schema_dictionary of the version of the file to read (inp.xml or out.xml)

  • logger – logger object for logging warnings, errors

Returns

a python dictionary with all defined constants

masci_tools.util.schema_dict_util.tag_exists(node, schema_dict, name, logger=None, **kwargs)[source]

Evaluates whether the tag exists in the xmltree based on the given name and additional further specifications with the available type information

Parameters
  • node – etree Element, on which to execute the xpath evaluations

  • schema_dict – dict, containing all the path information and more

  • name – str, name of the tag

  • logger – logger object for logging warnings, errors, if not provided all errors will be raised

Kwargs:
param contains

str, this string has to be in the final path

param not_contains

str, this string has to NOT be in the final path

Returns

bool, True if any nodes with the path exist

This module contains the functions necessary to parse mathematical expressions with predefined constants given in the inp.xml file of Fleur

exception masci_tools.util.fleur_calculate_expression.MissingConstant[source]
masci_tools.util.fleur_calculate_expression.calculate_expression(expression, constants=None, prevCommand=None, exp_return=False)[source]

Recursively evaluates the given expression string with the given defined constants

Parameters
  • expression – str containing the expression to be parsed

  • constants – dict with all defined constants (predefined in the Fleur code or defined in the inp.xml)

  • prevCommand – str, which gives the command before the beginning of the current block if it is given the calculation is stopped, when a command is encountered, which should be exectuted after prevCommand (order of operations)

  • exp_return – bool, determines whether to return the remaining string of the expression

Returns

float value of the given expression string

masci_tools.util.fleur_calculate_expression.evaluate_bracket(expression, constants)[source]

Evaluates the bracket opened at the start of the expression

Parameters
  • expression – expression to be parsed

  • constants – dict with defined constants

Returns

value of the expression inside the brackets and remaining string of the expression after the corresponding closed bracket

masci_tools.util.fleur_calculate_expression.get_first_number(expression)[source]

Reads the number in the beginning of the expression string. This number can begin with a sign +-, a number or the decimal point

Parameters

expression – str of the expression

Returns

float value of the number in the beginning and the string of the remaining expression

masci_tools.util.fleur_calculate_expression.get_first_string(expression)[source]

Reads the letter string in the beginning of the expression string.

Parameters

expression – str of the expression

Returns

letter string in the beginning and the string of the remaining expression

This module contains a class which organizes the known parsing tasks for outxml files and provides fuctionality for adding custom tasks easily

class masci_tools.util.parse_tasks.ParseTasks(version, task_file=None, validate_defaults=False)[source]

Representation of all known parsing tasks for the out.xml file

When set up it will initialize the known default tasks and check if they work for the given output version

Accesing definition of task example

from masci_tools.io.parsers.fleur import ParseTasks

p = ParseTasks('0.33')
totE_definition = p.tasks['total_energy']
add_task(task_name, task_definition, **kwargs)[source]

Add a new task definition to the tasks dictionary

Will first check if the definition has all the required keys

Parameters
  • task_name – str, key in the tasks dict

  • task_definition – dict with the defined tasks

  • overwrite – bool (optional), if True and the key is present in the dictionary it will be overwritten with the new definition

  • append – bool (optional), if True and the key is present in the dictionary the new defintions will be inserted into this dictionary (inner keys WILL BE OVERWRITTEN). Additionally if an inner key is overwritten with an empty dict the inner key will be removed

The following keys are expected in each entry of the task_definition dictionary:
param parse_type

str, defines which methods to use when extracting the information

param path_spec

dict with all the arguments that should be passed to get_tag_xpath or get_attrib_xpath to get the correct path

param subdict

str, if present the parsed values are put into this key in the output dictionary

param overwrite_last

bool, if True no list is inserted and each entry overwrites the last

For the allAttribs parse_type there are more keys that can appear:
param base_value

str, optional. If given the attribute with this name will be inserted into the key from the task_definition all other keys are formatted as {task_key}_{attribute_name}

param ignore

list of str, these attributes will be ignored

param overwrite

list of str, these attributes will not create a list and overwrite any value that might be there

param flat

bool, if False the dict parsed from the tag is inserted as a dict into the correspondin key if True the values will be extracted and put into the output dictionary with the format {task_key}_{attribute_name}

property all_attribs_function

Return the registered parse functions for parsing multipl attributes

property conversion_functions

Return the registered conversion functions

determine_tasks(fleurmodes, minimal=False)[source]

Determine, which tasks to perform based on the fleur_modes

Parameters
  • fleurmodes – dict with the calculation modes

  • minimal – bool, whether to only perform minimal tasks

property general_tasks

Tasks to perform for the root node

property iteration_tasks

Tasks to perform for each iteration

property migrations

Return the registered migrations

property parse_functions

Return the registered parse functions

perform_task(task_name, node, out_dict, schema_dict, constants, logger=None, use_lists=True)[source]

Evaluates the task given in the tasks_definition dict

Parameters
  • task_name – str, specifies the task to perform

  • node – etree.Element, the xpath expressions are evaluated from this node

  • out_dict – dict, output will be put in this dictionary

  • schema_dict – dict, here all paths and attributes are stored according to the outputschema

  • constants – dict with all the defined mathematical constants

  • logger – logger object for logging warnings, errors

  • root_tag – str, this string will be appended in front of any xpath before it is evaluated

  • use_lists – bool, if True lists are created for each key if not otherwise specified

show_available_tasks(show_definitions=False)[source]

Print all currently available task keys. If show_definitions is True also the corresponding defintions will be printed

masci_tools.util.parse_tasks.find_migration(start, target, migrations)[source]

Tries to find a migration path from the start to the target version via the defined migration functions

Parameters
  • start – str of the starting version

  • target – str of the target version

  • migrations – dict of funcs registered via the register_migration_function decorator

Returns

list of migration functions to be called to go from start to target

This module defines decorators for the ParseTasks class to make extending/modifying the parser more convenient

Up till now 3 decorators are defined:
  • `register_migration` marks a function of making backwards incompatible changes to the parsing tasks

  • `register_parsing_function` gives a mappimg between available parsing functions and the keywords in the parsing tasks

  • `conversion_function` makes the decorated function available to be called easily after a certain parsing task has occured

masci_tools.util.parse_tasks_decorators.conversion_function(func)[source]

Marks a function as a conversion function, which can be called after performing a parsing task. The function can be specified via the _conversions control key in the task definitions.

A conversion function has to have the following arguments:
param out_dict

dict with the previously parsed information

param parser_info_out

dict, with warnings, info, errors, …

and return only the modified output dict

masci_tools.util.parse_tasks_decorators.register_migration(base_version, target_version)[source]

Decorator to add migration for task definition dictionary to the ParseTasks class The function should only take the dict of task definitions as an argument

Parameters
  • base_version – str of the version, from which the migration starts

  • target_version – str or list of str with the versions that work after the migration has been performed

masci_tools.util.parse_tasks_decorators.register_parsing_function(parse_type_name, all_attribs_keys=False)[source]

Decorator to add parse type for task definition dictionary.

Parameters
  • parse_type_name – str, the function can be selected in task defintions via this string

  • all_attribs_keys – bool, if True the arguments for parsing multiple attributes are valid

The decorated function has to have the following arguments:
param node

etree Element, on which to execute the xpath evaluations

param schema_dict

dict, containing all the path information and more

param name

str, name of the tag/attribute

param parser_info_out

dict, with warnings, info, errors, …

param kwargs

here all other keyword arguments are collected

This module contains custom conversion functions for the outxml_parser, which cannot be handled by the standard parsing framework

masci_tools.io.parsers.fleur.outxml_conversions.calculate_total_magnetic_moment(out_dict, logger)[source]

Calculate the the total magnetic moment per cell

Parameters

out_dict – dict with the already parsed information

masci_tools.io.parsers.fleur.outxml_conversions.calculate_walltime(out_dict, logger)[source]

Calculate the walltime from start and end time

Parameters
  • out_dict – dict with the already parsed information

  • logger – logger object for logging warnings, errors, if not provided all errors will be raised

masci_tools.io.parsers.fleur.outxml_conversions.convert_forces(out_dict, logger)[source]

Convert the parsed forces from a iteration

Parameters

out_dict – dict with the already parsed information

masci_tools.io.parsers.fleur.outxml_conversions.convert_ldau_definitions(out_dict, logger)[source]

Convert the parsed information from LDA+U into a more readable dict

ldau_info has keys for each species with LDA+U ({species_name}/{atom_number}) and this in turn contains a dict with the LDA+U definition for the given orbital (spdf)

Parameters

out_dict – dict with the already parsed information

masci_tools.io.parsers.fleur.outxml_conversions.convert_relax_info(out_dict, logger)[source]

Convert the general relaxation information

Parameters

out_dict – dict with the already parsed information

masci_tools.io.parsers.fleur.outxml_conversions.convert_total_energy(out_dict, logger)[source]

Convert total energy to eV

Functions for expanding/splitting or converting electron configuration strings

masci_tools.util.econfig.convert_fleur_config_to_econfig(fleurconf_str, keep_spin=False)[source]

‘[Kr] (4d3/2) (4d5/2) (4f5/2) (4f7/2)’ -> ‘[Kr] 4d10 4f14’, or ‘[Kr] 4d3/2 4d5/2 4f5/2 4f7/2’

# for now only use for coreconfig, it will fill all orbitals, since it has no information on the filling.

Parameters
  • fleurconf_str – string of the electron config like it is read from the inp.xml

  • keep_spin – bool if True the spin indices will be kept in the converted string

Returns

string of the electron config to be used in the inpgen

masci_tools.util.econfig.get_coreconfig(element, full=False)[source]

returns the econfiguration as a string of an element.

Parameters
  • element – element string

  • full – a bool if True the econfig without [He]… is returned

Returns

coreconfig string

masci_tools.util.econfig.get_econfig(element, full=False)[source]

returns the econfiguration as a string of an element.

Parameters
  • element – element string

  • full – a bool if True the econfig without [He]… is returned

Returns

a econfig string

masci_tools.util.econfig.rek_econ(econfigstr)[source]

recursive routine to return a full econfig ‘[Xe] 4f14 | 5d10 6s2 6p4’ -> ‘1s 2s … 4f14 | 5d10 6s2 6p4’

Parameters

econfigstr – electron config string to expand

Returns

expanded econfig string

Basic Fleur Schema parser functions

Load all fleur schema related functions

class masci_tools.io.parsers.fleur.fleur_schema.AttributeType(base_type, length)
base_type

Alias for field number 0

length

Alias for field number 1

class masci_tools.io.parsers.fleur.fleur_schema.InputSchemaDict(*args, xmlschema=None, **kwargs)[source]

This class contains information parsed from the FleurInputSchema.xsd

The keys contain the following information:

inp_version

Version string of the input schema represented in this object

tag_paths

simple xpath expressions to all valid tag names Multiple paths or ambiguous tag names are parsed as a list

_basic_types

Parsed definitions of all simple Types with their respective base type (int, float, …) and evtl. length restrictions (Only used in the schema construction itself)

attrib_types

All possible base types for all valid attributes. If multiple are possible a list, with ‘string’ always last (if possible)

simple_elements

All elements with simple types and their type definition with the additional attributes

unique_attribs

All attributes and their paths, which occur only once and have a unique path

unique_path_attribs

All attributes and their paths, which have a unique path but occur in multiple places

other_attribs

All attributes and their paths, which are not in ‘unique_attribs’ or ‘unique_path_attribs’

omitt_contained_tags

All tags, which only contain a list of one other tag

tag_info

For each tag (path), the valid attributes and tags (optional, several, order, simple, text)

classmethod fromPath(path)[source]

load the FleurInputSchema dict for the specified FleurInputSchema file

Parameters

path – path to the input schema file

Returns

InputSchemaDict object with the information for the provided file

classmethod fromVersion(version, logger=None, no_cache=False)[source]

load the FleurInputSchema dict for the specified version

Parameters
  • version – str with the desired version, e.g. ‘0.33’

  • logger – logger object for warnings, errors and information, …

Returns

InputSchemaDict object with the information for the provided version

property inp_version

Returns the input version as an integer for comparisons (> or <)

class masci_tools.io.parsers.fleur.fleur_schema.OutputSchemaDict(*args, xmlschema=None, **kwargs)[source]

This object contains information parsed from the FleurOutputSchema.xsd

The keys contain the following information:

out_version

Version string of the output schema represented in this class

input_tag

Name of the element containing the fleur input

tag_paths

simple xpath expressions to all valid tag names not in an iteration Multiple paths or ambiguous tag names are parsed as a list

iteration_tag_paths

simple relative xpath expressions to all valid tag names inside an iteration. Multiple paths or ambiguous tag names are parsed as a list

_basic_types

Parsed definitions of all simple Types with their respective base type (int, float, …) and evtl. length restrictions (Only used in the schema construction itself)

_input_basic_types

Part of the parsed definitions of all simple Types with their respective base type (int, float, …) and evtl. length restrictions from the input schema (Only used in the schema construction itself)

attrib_types

All possible base types for all valid attributes. If multiple are possible a list, with ‘string’ always last (if possible)

simple_elements

All elements with simple types and their type definition with the additional attributes

unique_attribs

All attributes and their paths, which occur only once and have a unique path outside of an iteration

unique_path_attribs

All attributes and their paths, which have a unique path but occur in multiple places outside of an iteration

other_attribs

All attributes and their paths, which are not in ‘unique_attribs’ or ‘unique_path_attribs’ outside of an iteration

iteration_unique_attribs

All attributes and their relative paths, which occur only once and have a unique path inside of an iteration

iteration_unique_path_attribs

All attributes and their relative paths, which have a unique path but occur in multiple places inside of an iteration

iteration_other_attribs

All attributes and their relative paths, which are not in ‘unique_attribs’ or ‘unique_path_attribs’ inside of an iteration

omitt_contained_tags

All tags, which only contain a list of one other tag

tag_info

For each tag outside of an iteration (path), the valid attributes and tags (optional, several, order, simple, text)

iteration_tag_info

For each tag inside of an iteration (relative path), the valid attributes and tags (optional, several, order, simple, text)

classmethod fromPath(path, inp_path=None, inpschema_dict=None)[source]

load the FleurOutputSchema dict for the specified paths

Parameters
  • path – str path to the FleurOutputSchema file

  • inp_path – str path to the FleurInputSchema file (defaults to same folder as path)

Returns

OutputSchemaDict object with the information for the provided files

classmethod fromVersion(version, inp_version=None, logger=None, no_cache=False)[source]

load the FleurOutputSchema dict for the specified version

Parameters
  • version – str with the desired version, e.g. ‘0.33’

  • inp_version – str with the desired input version, e.g. ‘0.33’ (defaults to version)

  • logger – logger object for warnings, errors and information, …

Returns

OutputSchemaDict object with the information for the provided versions

property inp_version

Returns the input version as an integer for comparisons (> or <)

property out_version

Returns the output version as an integer for comparisons (> or <)

masci_tools.io.parsers.fleur.fleur_schema.add_fleur_schema(path, overwrite=False)[source]

Adds the FleurInput/OutputSchema from the specified path (folder containing the Schemas) to the folder with the correct version number and creates the schema_dicts

Parameters
  • path – path to the folder containing the schema files

  • overwrite – bool, if True and the schema with the same version exists it will be overwritten. Otherwise an error is raised

masci_tools.io.parsers.fleur.fleur_schema.schema_dict_version_dispatch(output_schema=False)[source]

Decorator for creating variations of functions based on the inp/out version of the schema_dict. All functions here need to have the signature:

def f(node, schema_dict, *args, **kwargs):
    pass

So schema_dict is the second positional argument

Inspired by singledispatch in the functools module

functions to extract information about the fleur schema input or output

class masci_tools.io.parsers.fleur.fleur_schema.fleur_schema_parser_functions.AttributeType(base_type, length)
base_type

Alias for field number 0

length

Alias for field number 1

masci_tools.io.parsers.fleur.fleur_schema.fleur_schema_parser_functions.extract_attribute_types(xmlschema, namespaces, **kwargs)[source]

Determine the required type of all attributes

Parameters
  • xmlschema – xmltree representing the schema

  • namespaces – dictionary with the defined namespaces

Returns

possible types of the attributes in a dictionary, if multiple types are possible a list is inserted for the tag

masci_tools.io.parsers.fleur.fleur_schema.fleur_schema_parser_functions.extract_text_types(xmlschema, namespaces, **kwargs)[source]

Determine the required type of all elements with text

Parameters
  • xmlschema – xmltree representing the schema

  • namespaces – dictionary with the defined namespaces

Returns

possible types of the attributes in a dictionary, if multiple types are possible a list is inserted for the tag

masci_tools.io.parsers.fleur.fleur_schema.fleur_schema_parser_functions.get_basic_types(xmlschema, namespaces, **kwargs)[source]

find all types, which can be traced back directly to a base_type

Parameters
  • xmlschema – xmltree representing the schema

  • namespaces – dictionary with the defined namespaces

Returns

dictionary with type names and their corresponding type_definition meaning a dicationary with possible base types and evtl. length restriction

masci_tools.io.parsers.fleur.fleur_schema.fleur_schema_parser_functions.get_input_tag(xmlschema, namespaces, **kwargs)[source]

Returns the tag for the input type element of the outxmlschema

Parameters
  • xmlschema – xmltree representing the schema

  • namespaces – dictionary with the defined namespaces

Returns

name of the element with the type ‘FleurInputType’

masci_tools.io.parsers.fleur.fleur_schema.fleur_schema_parser_functions.get_omittable_tags(xmlschema, namespaces, **kwargs)[source]

find tags with no attributes and, which are only used to mask a list of one other possible tag (e.g. atomSpecies)

Parameters
  • xmlschema – xmltree representing the schema

  • namespaces – dictionary with the defined namespaces

Returns

list of tags, containing only a sequence of one allowed tag

masci_tools.io.parsers.fleur.fleur_schema.fleur_schema_parser_functions.get_other_attribs(xmlschema, namespaces, **kwargs)[source]

Determine all other attributes not contained in settable or settable_contains

Parameters
  • xmlschema – xmltree representing the schema

  • namespaces – dictionary with the defined namespaces

Returns

dictionary with all attributes and the corresponding list of paths to the tag

masci_tools.io.parsers.fleur.fleur_schema.fleur_schema_parser_functions.get_root_tag(xmlschema, namespaces, **kwargs)[source]

Returns the tag for the root element of the xmlschema

Parameters
  • xmlschema – xmltree representing the schema

  • namespaces – dictionary with the defined namespaces

Returns

name of the single element defined in the first level of the schema

masci_tools.io.parsers.fleur.fleur_schema.fleur_schema_parser_functions.get_tag_info(xmlschema, namespaces, **kwargs)[source]
Get all important information about the tags
  • allowed attributes

  • contained tags (simple (only attributes), optional (with default values), several, order, text tags)

Parameters
  • xmlschema – xmltree representing the schema

  • namespaces – dictionary with the defined namespaces

Returns

dictionary with the tag information

masci_tools.io.parsers.fleur.fleur_schema.fleur_schema_parser_functions.get_tag_paths(xmlschema, namespaces, **kwargs)[source]

Determine simple xpaths to all possible tags

Parameters
  • xmlschema – xmltree representing the schema

  • namespaces – dictionary with the defined namespaces

Returns

possible paths of all tags in a dictionary, if multiple paths are possible a list is inserted for the tag

masci_tools.io.parsers.fleur.fleur_schema.fleur_schema_parser_functions.get_text_tags(xmlschema, namespaces, **kwargs)[source]

find all elements, who can contain text

Parameters
  • xmlschema – xmltree representing the schema

  • namespaces – dictionary with the defined namespaces

Returns

dictionary with tags and their corresponding type_definition meaning a dicationary with possible base types and evtl. length restriction

masci_tools.io.parsers.fleur.fleur_schema.fleur_schema_parser_functions.get_unique_attribs(xmlschema, namespaces, **kwargs)[source]

Determine all attributes, which can be set through set_inpchanges in aiida_fleur Meaning ONE possible path and no tags in the path with maxOccurs!=1

Parameters
  • xmlschema – xmltree representing the schema

  • namespaces – dictionary with the defined namespaces

Returns

dictionary with all settable attributes and the corresponding path to the tag

masci_tools.io.parsers.fleur.fleur_schema.fleur_schema_parser_functions.get_unique_path_attribs(xmlschema, namespaces, **kwargs)[source]

Determine all attributes, with multiple possible path that do have at least one path with all contained tags maxOccurs!=1

Parameters
  • xmlschema – xmltree representing the schema

  • namespaces – dictionary with the defined namespaces

Returns

dictionary with all attributes and the corresponding list of paths to the tag

masci_tools.io.parsers.fleur.fleur_schema.fleur_schema_parser_functions.type_order(type_def)[source]

Key function for sorting the type definitions to avoid conflicts

Sorted by base_type first (bool before int, string at the end) and then by length in ascending order (unbounded last)

Parameters

type_def – definition to be sorted

Defined constants

Here we collect physical constants which are used throughout the code. That way we ensure consistency.

Note

For masci-tools versions after v0.4.6, the constants values used in the KKR functions for conversion between Angstrom and Bohr radius, and electron Volt and Rydberg, have been replaced by the NIST values by default. Prior to that, two different versions had been in use. If you need to work with KKR calculations / aiida-kkr workchains performed with these constants versions, you can switch to these older KKR constants versions by setting the environment variable MASCI_TOOLS_USE_OLD_CONSTANTS prior to loading masci-tools. During interpreter runtime, the chosen version cannot be switched.

  • For KKR constants versions used starting from masci-tools v0.4.7, more specifically starting from commit 66953f8, Apr 28, 2021, do not set MASCI_TOOLS_USE_OLD_CONSTANTS.

  • For KKR constants versions used in masci-tools v0.4.0-dev7 - v0.4.6, more specifically starting from commit c171563, Feb 16, 2021, to prior to commit 66953f8, Apr 28, 2021, set MASCI_TOOLS_USE_OLD_CONSTANTS to 'interim'.

  • For KKR constants versions used prior to masci-tools v0.4.0-dev7, more specifically prior to commit c171563, Feb 16, 2021, set MASCI_TOOLS_USE_OLD_CONSTANTS to 'old' or 'True'.

   1.. literalinclude:: ../../../masci_tools/util/constants.py
   2   :language: python
   3   :lines: 28-
   4   :linenos:
   5
   6"""
   7import numpy as np
   8import os
   9
  10# NIST https://physics.nist.gov/cgi-bin/cuu/Value?hrev
  11HTR_TO_EV = 27.211386245988  #(53)
  12RY_TO_EV = 13.605693122994  #(26)
  13BOHR_A = 0.5291772108
  14HTR_TO_KELVIN = 315_775.02480407
  15#Scipy bohr 5.29177210903e-11 m
  16#Scipy htr 27.211386245988 eV
  17# NIST BOHR 0.529177210903 #(80)
  18#https://physics.nist.gov/cgi-bin/cuu/Value?bohrrada0
  19
  20#KKR constants versions. See module docstring for details.
  21_MASCI_TOOLS_USE_OLD_CONSTANTS = os.environ.get('MASCI_TOOLS_USE_OLD_CONSTANTS', None)
  22if _MASCI_TOOLS_USE_OLD_CONSTANTS and _MASCI_TOOLS_USE_OLD_CONSTANTS.lower() in ['old', 'true']:
  23    ANG_BOHR_KKR = 1.8897261254578281
  24    RY_TO_EV_KKR = 13.605693009
  25elif _MASCI_TOOLS_USE_OLD_CONSTANTS and _MASCI_TOOLS_USE_OLD_CONSTANTS.lower() in ['interim']:
  26    ANG_BOHR_KKR = 1.8897261249935897
  27    RY_TO_EV_KKR = RY_TO_EV
  28else:
  29    #Set the constants to the NIST values
  30    ANG_BOHR_KKR = 1.8897261246257702
  31    RY_TO_EV_KKR = RY_TO_EV
  32
  33#Fleur
  34#htr_eV   = 27.21138602
  35#bohr=0.5291772108
  36#bohrtocm=0.529177e-8
  37#pymatgen uses scipy.constants
  38#ase: Bohr 0.5291772105638411
  39#Hartree 27.211386024367243
  40#Rydberg 13.605693012183622
  41#1/Bohr
  42#1.8897261258369282
  43#aiida-core units:
  44#bohr_to_ang = 0.52917720859
  45
  46#Predefined constants in the Fleur Code (These are accepted in the inp.xml)
  47FLEUR_DEFINED_CONSTANTS = {
  48    'Pi': np.pi,
  49    'Deg': 2 * np.pi / 360.0,
  50    'Ang': 1.8897261247728981,
  51    'nm': 18.897261247728981,
  52    'pm': 0.018897261247728981,
  53    'Bohr': 1.0,
  54    'Htr': 1.0,
  55    'eV': 1.0 / HTR_TO_EV,
  56    'Ry': 0.5
  57}
  58
  59PERIODIC_TABLE_ELEMENTS = {
  60    0: {  # This is for empty spheres etc.
  61        'mass': 1.00000,
  62        'name': 'Unknown',
  63        'symbol': 'X'
  64    },
  65    1: {
  66        'mass': 1.00794,
  67        'name': 'Hydrogen',
  68        'symbol': 'H',
  69        'econfig': '1s1',
  70        'fleur_default_econfig': '| 1s1',
  71        'lo': '',
  72        'rmt': 0.65,
  73        'lmax': '',
  74        'jri': 981,
  75        'soc': False,
  76        'mag': False
  77    },
  78    2: {
  79        'mass': 4.002602,
  80        'name': 'Helium',
  81        'symbol': 'He',
  82        'econfig': '1s2',
  83        'fleur_default_econfig': '| 1s2',
  84        'lo': '',
  85        'rmt': 1.2,
  86        'lmax': '',
  87        'jri': 981
  88    },
  89    3: {
  90        'mass': 6.941,
  91        'name': 'Lithium',
  92        'symbol': 'Li',
  93        'econfig': '1s2 | 2s1',
  94        'fleur_default_econfig': '1s2 | 2s1',
  95        'lo': '',
  96        'rmt': 2.13,
  97        'lmax': '',
  98        'jri': 981
  99    },
 100    4: {
 101        'mass': 9.012182,
 102        'name': 'Beryllium',
 103        'symbol': 'Be',
 104        'econfig': '1s2 | 2s2',
 105        'fleur_default_econfig': '1s2 | 2s2',
 106        'lo': '',
 107        'rmt': 1.87,
 108        'lmax': '',
 109        'jri': 981
 110    },
 111    5: {
 112        'mass': 10.811,
 113        'name': 'Boron',
 114        'symbol': 'B',
 115        'econfig': '1s2 | 2s2 2p1',
 116        'fleur_default_econfig': '1s2 | 2s2 2p1',
 117        'lo': '',
 118        'rmt': 1.4,
 119        'lmax': '',
 120        'jri': 981
 121    },
 122    6: {
 123        'mass': 12.0107,
 124        'name': 'Carbon',
 125        'symbol': 'C',
 126        'econfig': '[He] 2s2 | 2p2',
 127        'fleur_default_econfig': '[He] 2s2 | 2p2',
 128        'lo': '',
 129        'rmt': 1.2,
 130        'lmax': '',
 131        'jri': 981
 132    },
 133    7: {
 134        'mass': 14.0067,
 135        'name': 'Nitrogen',
 136        'symbol': 'N',
 137        'econfig': '[He] 2s2 | 2p3',
 138        'fleur_default_econfig': '[He] 2s2 | 2p3',
 139        'lo': '',
 140        'rmt': 1.0,
 141        'lmax': '',
 142        'jri': 981
 143    },
 144    8: {
 145        'mass': 15.9994,
 146        'name': 'Oxygen',
 147        'symbol': 'O',
 148        'econfig': '[He] 2s2 | 2p4',
 149        'fleur_default_econfig': '[He] 2s2 | 2p4',
 150        'lo': '',
 151        'rmt': 1.1,
 152        'lmax': '',
 153        'jri': 981
 154    },
 155    9: {
 156        'mass': 18.9984032,
 157        'name': 'Fluorine',
 158        'symbol': 'F',
 159        'econfig': '[He] 2s2 | 2p5',
 160        'fleur_default_econfig': '[He] 2s2 | 2p5',
 161        'lo': '',
 162        'rmt': 1.2,
 163        'lmax': '',
 164        'jri': 981
 165    },
 166    10: {
 167        'mass': 20.1797,
 168        'name': 'Neon',
 169        'symbol': 'Ne',
 170        'econfig': '[He] 2s2 | 2p6',
 171        'fleur_default_econfig': '[He] 2s2 | 2p6',
 172        'lo': '',
 173        'rmt': 2.1,
 174        'lmax': '',
 175        'jri': 981
 176    },
 177    11: {
 178        'mass': 22.98977,
 179        'name': 'Sodium',
 180        'symbol': 'Na',
 181        'econfig': '[He] 2s2 | 2p6 3s1',
 182        'fleur_default_econfig': '[He] | 2s2 2p6 3s1',
 183        'lo': '2s 2p',
 184        'rmt': 2.1,
 185        'lmax': '',
 186        'jri': 981
 187    },
 188    12: {
 189        'mass': 24.305,
 190        'name': 'Magnesium',
 191        'symbol': 'Mg',
 192        'econfig': '[He] 2s2 | 2p6 3s2',
 193        'fleur_default_econfig': '[He] 2s2 | 2p6 3s2',
 194        'lo': '2p',
 195        'rmt': 2.3,
 196        'lmax': '',
 197        'jri': 981
 198    },
 199    13: {
 200        'mass': 26.981538,
 201        'name': 'Aluminium',
 202        'symbol': 'Al',
 203        'econfig': '[He] 2s2 2p6 | 3s2 3p1',
 204        'fleur_default_econfig': '[He] 2s2 2p6 | 3s2 3p1',
 205        'lo': '',
 206        'rmt': 2.1,
 207        'lmax': '',
 208        'jri': 981
 209    },
 210    14: {
 211        'mass': 28.0855,
 212        'name': 'Silicon',
 213        'symbol': 'Si',
 214        'econfig': '[He] 2s2 2p6 | 3s2 3p2',
 215        'fleur_default_econfig': '[He] 2s2 2p6 | 3s2 3p2',
 216        'lo': '',
 217        'rmt': 2.0,
 218        'lmax': '',
 219        'jri': 981
 220    },
 221    15: {
 222        'mass': 30.973761,
 223        'name': 'Phosphorus',
 224        'symbol': 'P',
 225        'econfig': '[He] 2s2 2p6 | 3s2 3p3',
 226        'fleur_default_econfig': '[He] 2s2 2p6 | 3s2 3p3',
 227        'lo': '',
 228        'rmt': 1.9,
 229        'lmax': '',
 230        'jri': 981
 231    },
 232    16: {
 233        'mass': 32.065,
 234        'name': 'Sulfur',
 235        'symbol': 'S',
 236        'econfig': '[He] 2s2 2p6 | 3s2 3p4',
 237        'fleur_default_econfig': '[He] 2s2 2p6 | 3s2 3p4',
 238        'lo': '',
 239        'rmt': 1.7,
 240        'lmax': '',
 241        'jri': 981
 242    },
 243    17: {
 244        'mass': 35.453,
 245        'name': 'Chlorine',
 246        'symbol': 'Cl',
 247        'econfig': '[He] 2s2 2p6 | 3s2 3p5',
 248        'fleur_default_econfig': '[He] 2s2 2p6 | 3s2 3p5',
 249        'lo': '',
 250        'rmt': 1.7,
 251        'lmax': '',
 252        'jri': 981
 253    },
 254    18: {
 255        'mass': 39.948,
 256        'name': 'Argon',
 257        'symbol': 'Ar',
 258        'econfig': '[He] 2s2 2p6 | 3s2 3p6',
 259        'fleur_default_econfig': '[He] 2s2 2p6 | 3s2 3p6',
 260        'lo': '',
 261        'rmt': 1.8,
 262        'lmax': '',
 263        'jri': 981
 264    },
 265    19: {
 266        'mass': 39.0983,
 267        'name': 'Potassium',
 268        'symbol': 'K',
 269        'econfig': '[Ne] 3s2 | 3p6 4s1',
 270        'fleur_default_econfig': '[Ne] | 3s2 3p6 4s1',
 271        'lo': '3s 3p',
 272        'rmt': 2.0,
 273        'lmax': '',
 274        'jri': 981
 275    },
 276    20: {
 277        'mass': 40.078,
 278        'name': 'Calcium',
 279        'symbol': 'Ca',
 280        'econfig': '[Ne] 3s2 | 3p6 4s2',
 281        'fleur_default_econfig': '[Ne] | 3s2 3p6 4s2',
 282        'lo': '3s 3p',
 283        'rmt': 2.3,
 284        'lmax': '',
 285        'jri': 981
 286    },
 287    21: {
 288        'mass': 44.955912,
 289        'name': 'Scandium',
 290        'symbol': 'Sc',
 291        'econfig': '[Ne] 3s2 3p6 | 4s2 3d1',
 292        'fleur_default_econfig': '[Ne] | 3s2 3p6 4s2 3d1',
 293        'lo': '3s 3p',
 294        'rmt': 2.2,
 295        'lmax': '',
 296        'jri': 981
 297    },
 298    22: {
 299        'mass': 47.867,
 300        'name': 'Titanium',
 301        'symbol': 'Ti',
 302        'econfig': '[Ne] | 3s2 3p6 4s2 3d2',
 303        'fleur_default_econfig': '[Ne] | 3s2 3p6 4s2 3d2',
 304        'lo': '3s 3p',
 305        'rmt': 2.1,
 306        'lmax': '',
 307        'jri': 981
 308    },
 309    23: {
 310        'mass': 50.9415,
 311        'name': 'Vanadium',
 312        'symbol': 'V',
 313        'econfig': '[Ne] 3s2 3p6 | 4s2 3d3',
 314        'fleur_default_econfig': '[Ne] | 3s2 3p6 4s2 3d3',
 315        'lo': '3s 3p',
 316        'rmt': 1.9,
 317        'lmax': '',
 318        'jri': 981
 319    },
 320    24: {
 321        'mass': 51.9961,
 322        'name': 'Chromium',
 323        'symbol': 'Cr',
 324        'econfig': '[Ne] 3s2 3p6 | 4s1 3d5',
 325        'fleur_default_econfig': '[Ne] | 3s2 3p6 4s1 3d5',
 326        'lo': '3s 3p',
 327        'rmt': 1.8,
 328        'lmax': '',
 329        'jri': 981
 330    },
 331    25: {
 332        'mass': 54.938045,
 333        'name': 'Manganese',
 334        'symbol': 'Mn',
 335        'econfig': '[Ne] 3s2 3p6 | 4s2 3d5',
 336        'fleur_default_econfig': '[Ne] | 3s2 3p6 4s2 3d5',
 337        'lo': '3s 3p',
 338        'rmt': 2.0,
 339        'lmax': '',
 340        'jri': 981
 341    },
 342    26: {
 343        'mass': 55.845,
 344        'name': 'Iron',
 345        'symbol': 'Fe',
 346        'econfig': '[Ne] 3s2 3p6 | 4s2 3d6',
 347        'fleur_default_econfig': '[Ne] | 3s2 3p6 4s2 3d6',
 348        'lo': '3s 3p',
 349        'rmt': 2.00,
 350        'lmax': '',
 351        'jri': 981
 352    },
 353    27: {
 354        'mass': 58.933195,
 355        'name': 'Cobalt',
 356        'symbol': 'Co',
 357        'econfig': '[Ne] 3s2 3p6 | 4s2 3d7',
 358        'fleur_default_econfig': '[Ne] 3s2 | 3p6 4s2 3d7',
 359        'lo': '3p',
 360        'rmt': 1.9,
 361        'lmax': '',
 362        'jri': 981
 363    },
 364    28: {
 365        'mass': 58.6934,
 366        'name': 'Nickel',
 367        'symbol': 'Ni',
 368        'econfig': '[Ne] 3s2 3p6 | 4s2 3d8',
 369        'fleur_default_econfig': '[Ne] 3s2 | 3p6 4s2 3d8',
 370        'lo': '3p',
 371        'rmt': 1.9,
 372        'lmax': '',
 373        'jri': 981
 374    },
 375    29: {
 376        'mass': 63.546,
 377        'name': 'Copper',
 378        'symbol': 'Cu',
 379        'econfig': '[Ne] 3s2 3p6 |4s1 3d10',
 380        'fleur_default_econfig': '[Ne] 3s2 | 3p6 4s1 3d10',
 381        'lo': '3p',
 382        'rmt': 2.1,
 383        'lmax': '',
 384        'jri': 981
 385    },
 386    30: {
 387        'mass': 65.38,
 388        'name': 'Zinc',
 389        'symbol': 'Zn',
 390        'econfig': '[Ne] 3s2 3p6 | 3d10 4s2',
 391        'fleur_default_econfig': '[Ne] 3s2 3p6 | 3d10 4s2',
 392        'lo': '3d',
 393        'rmt': 2.2,
 394        'lmax': '',
 395        'jri': 981
 396    },
 397    31: {
 398        'mass': 69.723,
 399        'name': 'Gallium',
 400        'symbol': 'Ga',
 401        'econfig': '[Ne] 3s2 3p6 | 3d10 4s2 4p1',
 402        'fleur_default_econfig': '[Ne] 3s2 3p6 | 3d10 4s2 4p1',
 403        'lo': '3d',
 404        'rmt': 2.1,
 405        'lmax': '',
 406        'jri': 981
 407    },
 408    32: {
 409        'mass': 72.64,
 410        'name': 'Germanium',
 411        'symbol': 'Ge',
 412        'econfig': '[Ne] 3s2 3p6 | 3d10 4s2 4p2',
 413        'fleur_default_econfig': '[Ne] 3s2 3p6 | 3d10 4s2 4p2',
 414        'lo': '3d',
 415        'rmt': 2.1,
 416        'lmax': '',
 417        'jri': 981
 418    },
 419    33: {
 420        'mass': 74.9216,
 421        'name': 'Arsenic',
 422        'symbol': 'As',
 423        'econfig': '[Ne] 3s2 3p6 | 3d10 4s2 4p3',
 424        'fleur_default_econfig': '[Ne] 3s2 3p6 | 3d10 4s2 4p3',
 425        'lo': '3d',
 426        'rmt': 2.0,
 427        'lmax': '',
 428        'jri': 981
 429    },
 430    34: {
 431        'mass': 78.96,
 432        'name': 'Selenium',
 433        'symbol': 'Se',
 434        'econfig': '[Ne] 3s2 3p6 | 3d10 4s2 4p4',
 435        'fleur_default_econfig': '[Ne] 3s2 3p6 | 3d10 4s2 4p4',
 436        'lo': '3d',
 437        'rmt': 2.0,
 438        'lmax': '',
 439        'jri': 981
 440    },
 441    35: {
 442        'mass': 79.904,
 443        'name': 'Bromine',
 444        'symbol': 'Br',
 445        'econfig': '[Ne] 3s2 3p6 | 3d10 4s2 4p5',
 446        'fleur_default_econfig': '[Ne] 3s2 3p6 | 3d10 4s2 4p5',
 447        'lo': '3d',
 448        'rmt': 2.1,
 449        'lmax': '',
 450        'jri': 981
 451    },
 452    36: {
 453        'mass': 83.798,
 454        'name': 'Krypton',
 455        'symbol': 'Kr',
 456        'econfig': '[Ne] 3s2 3p6 | 3d10 4s2 4p6',
 457        'fleur_default_econfig': '[Ne] 3s2 3p6 | 3d10 4s2 4p6',
 458        'lo': '3d',
 459        'rmt': 2.2,
 460        'lmax': '',
 461        'jri': 981
 462    },
 463    37: {
 464        'mass': 85.4678,
 465        'name': 'Rubidium',
 466        'symbol': 'Rb',
 467        'econfig': '[Ar] 3d10 4s2 | 4p6 5s1',
 468        'fleur_default_econfig': '[Ar] 3d10 | 4s2 4p6 5s1',
 469        'lo': '4s 4p',
 470        'rmt': 2.4,
 471        'lmax': '',
 472        'jri': 981
 473    },
 474    38: {
 475        'mass': 87.62,
 476        'name': 'Strontium',
 477        'symbol': 'Sr',
 478        'econfig': '[Ar] 3d10 4s2 | 4p6 5s2',
 479        'fleur_default_econfig': '[Ar] 3d10 | 4s2 4p6 5s2',
 480        'lo': '4s 4p',
 481        'rmt': 2.4,
 482        'lmax': '',
 483        'jri': 981
 484    },
 485    39: {
 486        'mass': 88.90585,
 487        'name': 'Yttrium',
 488        'symbol': 'Y',
 489        'econfig': '[Ar] 4s2 3d10 4p6 | 5s2 4d1',
 490        'fleur_default_econfig': '[Ar] 3d10 | 4s2 4p6 5s2 4d1',
 491        'lo': '4s 4p',
 492        'rmt': 2.4,
 493        'lmax': '',
 494        'jri': 981
 495    },
 496    40: {
 497        'mass': 91.224,
 498        'name': 'Zirconium',
 499        'symbol': 'Zr',
 500        'econfig': '[Ar] 4s2 3d10 4p6 | 5s2 4d2',
 501        'fleur_default_econfig': '[Ar] 3d10 | 4s2 4p6 5s2 4d2',
 502        'lo': '4s 4p',
 503        'rmt': 2.3,
 504        'lmax': '',
 505        'jri': 981
 506    },
 507    41: {
 508        'mass': 92.90638,
 509        'name': 'Niobium',
 510        'symbol': 'Nb',
 511        'econfig': '[Ar] 4s2 3d10 4p6 | 5s1 4d4',
 512        'fleur_default_econfig': '[Ar] 3d10 | 4s2 4p6 5s1 4d4',
 513        'lo': '4s 4p',
 514        'rmt': 2.1,
 515        'lmax': '',
 516        'jri': 981
 517    },
 518    42: {
 519        'mass': 95.96,
 520        'name': 'Molybdenum',
 521        'symbol': 'Mo',
 522        'econfig': '[Ar] 4s2 3d10 4p6 | 5s1 4d5',
 523        'fleur_default_econfig': '[Ar] 3d10 | 4s2 4p6 5s1 4d5',
 524        'lo': '4s 4p',
 525        'rmt': 2.0,
 526        'lmax': '',
 527        'jri': 981
 528    },
 529    43: {
 530        'mass': 98.0,
 531        'name': 'Technetium',
 532        'symbol': 'Tc',
 533        'econfig': '[Ar] 4s2 3d10 4p6 | 5s2 4d5',
 534        'fleur_default_econfig': '[Ar] 3d10 | 4s2 4p6 5s2 4d5',
 535        'lo': '4s 4p',
 536        'rmt': 2.1,
 537        'lmax': '',
 538        'jri': 981
 539    },
 540    44: {
 541        'mass': 101.07,
 542        'name': 'Ruthenium',
 543        'symbol': 'Ru',
 544        'econfig': '[Ar] 4s2 3d10 4p6 | 5s1 4d7',
 545        'fleur_default_econfig': '[Ar] 4s2 3d10 | 4p6 5s1 4d7',
 546        'lo': '4p',
 547        'rmt': 2.1,
 548        'lmax': '',
 549        'jri': 981
 550    },
 551    45: {
 552        'mass': 102.9055,
 553        'name': 'Rhodium',
 554        'symbol': 'Rh',
 555        'econfig': '[Ar] 4s2 3d10 4p6 | 5s1 4d8',
 556        'fleur_default_econfig': '[Ar] 4s2 3d10 | 4p6 5s1 4d8',
 557        'lo': '4p',
 558        'rmt': 2.1,
 559        'lmax': '',
 560        'jri': 981
 561    },
 562    46: {
 563        'mass': 106.42,
 564        'name': 'Palladium',
 565        'symbol': 'Pd',
 566        'econfig': '[Ar] 4s2 3d10 4p6 | 4d10',
 567        'fleur_default_econfig': '[Ar] 4s2 3d10 | 4p6 4d10',
 568        'lo': '4p',
 569        'rmt': 2.1,
 570        'lmax': '',
 571        'jri': 981
 572    },
 573    47: {
 574        'mass': 107.8682,
 575        'name': 'Silver',
 576        'symbol': 'Ag',
 577        'econfig': '[Ar] 4s2 3d10 4p6 | 5s1 4d10',
 578        'fleur_default_econfig': '[Ar] 3d10 | 4s2 4p6 5s1 4d10',
 579        'lo': '4s 4p',
 580        'rmt': 2.3,
 581        'lmax': '',
 582        'jri': 981
 583    },
 584    48: {
 585        'mass': 112.411,
 586        'name': 'Cadmium',
 587        'symbol': 'Cd',
 588        'econfig': '[Ar] 4s2 3d10 4p6 | 4d10 5s2',
 589        'fleur_default_econfig': '[Ar] 4s2 3d10 4p6 | 4d10 5s2',
 590        'lo': '4d',
 591        'rmt': 2.4,
 592        'lmax': '',
 593        'jri': 981
 594    },
 595    49: {
 596        'mass': 114.818,
 597        'name': 'Indium',
 598        'symbol': 'In',
 599        'econfig': '[Ar] 4s2 3d10 4p6 | 4d10 5s2 5p1',
 600        'fleur_default_econfig': '[Ar] 4s2 3d10 4p6 | 4d10 5s2 5p1',
 601        'lo': '4d',
 602        'rmt': 2.2,
 603        'lmax': '',
 604        'jri': 981
 605    },
 606    50: {
 607        'mass': 118.71,
 608        'name': 'Tin',
 609        'symbol': 'Sn',
 610        'econfig': '[Kr] 4d10 | 5s2 5p2',
 611        'fleur_default_econfig': '[Kr] | 4d10 5s2 5p2',
 612        'lo': '4d',
 613        'rmt': 2.3,
 614        'lmax': '',
 615        'jri': 981
 616    },
 617    51: {
 618        'mass': 121.76,
 619        'name': 'Antimony',
 620        'symbol': 'Sb',
 621        'econfig': '[Kr] 4d10 | 5s2 5p3',
 622        'fleur_default_econfig': '[Kr] | 4d10 5s2 5p3',
 623        'lo': '4d',
 624        'rmt': 2.3,
 625        'lmax': '',
 626        'jri': 981
 627    },
 628    52: {
 629        'mass': 127.6,
 630        'name': 'Tellurium',
 631        'symbol': 'Te',
 632        'econfig': '[Kr] 4d10 | 5s2 5p4',
 633        'fleur_default_econfig': '[Kr] | 4d10 5s2 5p4',
 634        'lo': '4d',
 635        'rmt': 2.3,
 636        'lmax': '',
 637        'jri': 981
 638    },
 639    53: {
 640        'mass': 126.90447,
 641        'name': 'Iodine',
 642        'symbol': 'I',
 643        'econfig': '[Kr] 4d10 | 5s2 5p5',
 644        'fleur_default_econfig': '[Kr] | 4d10 5s2 5p5',
 645        'lo': '4d',
 646        'rmt': 2.2,
 647        'lmax': '',
 648        'jri': 981
 649    },
 650    54: {
 651        'mass': 131.293,
 652        'name': 'Xenon',
 653        'symbol': 'Xe',
 654        'econfig': '[Kr] 4d10 | 5s2 5p6',
 655        'fleur_default_econfig': '[Kr] | 4d10 5s2 5p6',
 656        'lo': '4d',
 657        'rmt': 2.2,
 658        'lmax': '',
 659        'jri': 981
 660    },
 661    55: {
 662        'mass': 132.9054519,
 663        'name': 'Caesium',
 664        'symbol': 'Cs',
 665        'econfig': '[Kr] 4d10 5s2 | 5p6 6s1',
 666        'fleur_default_econfig': '[Kr] 4d10 | 5s2 5p6 6s1',
 667        'lo': '5s 5p',
 668        'rmt': 2.4,
 669        'lmax': '',
 670        'jri': 981
 671    },
 672    56: {
 673        'mass': 137.327,
 674        'name': 'Barium',
 675        'symbol': 'Ba',
 676        'econfig': '[Kr] 4d10 5s2 | 5p6 6s2',
 677        'fleur_default_econfig': '[Kr] 4d10 | 5s2 5p6 6s2',
 678        'lo': '5s 5p',
 679        'rmt': 2.4,
 680        'lmax': '',
 681        'jri': 981
 682    },
 683    57: {
 684        'mass': 138.90547,
 685        'name': 'Lanthanum',
 686        'symbol': 'La',
 687        'econfig': '[Kr] 4d10 5s2 | 5p6 6s2 5d1',
 688        'fleur_default_econfig': '[Kr] 4d10 | 5s2 5p6 6s2 5d1',
 689        'lo': '5s 5p',
 690        'rmt': 2.2,
 691        'lmax': '',
 692        'jri': 981
 693    },
 694    58: {
 695        'mass': 140.116,
 696        'name': 'Cerium',
 697        'symbol': 'Ce',
 698        'econfig': '[Kr] 4d10 5s2 5p6 | 6s2 4f1 5d1',
 699        'fleur_default_econfig': '[Kr] 4d10 | 5s2 5p6 6s2 4f1 5d1',
 700        'lo': '5s 5p',
 701        'rmt': 2.2,
 702        'lmax': '',
 703        'jri': 981
 704    },
 705    59: {
 706        'mass': 140.90765,
 707        'name': 'Praseodymium',
 708        'symbol': 'Pr',
 709        'econfig': '[Kr] 4d10 5s2 5p6 | 6s2 4f3',
 710        'fleur_default_econfig': '[Kr] 4d10 | 5s2 5p6  6s2 4f3',
 711        'lo': '5s 5p',
 712        'rmt': 2.4,
 713        'lmax': '',
 714        'jri': 981
 715    },
 716    60: {
 717        'mass': 144.242,
 718        'name': 'Neodymium',
 719        'symbol': 'Nd',
 720        'econfig': '[Kr] 4d10 5s2 5p6 | 6s2 4f4',
 721        'fleur_default_econfig': '[Kr] 4d10 | 5s2 5p6 6s2 4f4',
 722        'lo': '5s 5p',
 723        'rmt': 2.1,
 724        'lmax': '',
 725        'jri': 981
 726    },
 727    61: {
 728        'mass': 145.0,
 729        'name': 'Promethium',
 730        'symbol': 'Pm',
 731        'econfig': '[Kr] 4d10 5s2 5p6 | 6s2 4f5',
 732        'fleur_default_econfig': '[Kr] 4d10 | 5s2 5p6 6s2 4f5',
 733        'lo': '5s 5p',
 734        'rmt': 2.4,
 735        'lmax': '',
 736        'jri': 981
 737    },
 738    62: {
 739        'mass': 150.36,
 740        'name': 'Samarium',
 741        'symbol': 'Sm',
 742        'econfig': '[Kr] 4d10 5s2 5p6 | 6s2 4f6',
 743        'fleur_default_econfig': '[Kr] 4d10 | 5s2 5p6 6s2 4f6',
 744        'lo': '5s 5p',
 745        'rmt': 2.1,
 746        'lmax': '',
 747        'jri': 981
 748    },
 749    63: {
 750        'mass': 151.964,
 751        'name': 'Europium',
 752        'symbol': 'Eu',
 753        'econfig': '[Kr] 4d10 | 4f7 5s2 5p6 6s2',
 754        'fleur_default_econfig': '[Kr] 4d10 | 5s2 5p6 4f7 6s2',
 755        'lo': '5s 5p',
 756        'rmt': 2.4,
 757        'lmax': '',
 758        'jri': 981
 759    },
 760    64: {
 761        'mass': 157.25,
 762        'name': 'Gadolinium',
 763        'symbol': 'Gd',
 764        'econfig': '[Kr] 4d10 5s2 5p6 | 6s2 4f7 5d1',
 765        'fleur_default_econfig': '[Kr] 4d10 | 5s2 5p6 6s2 4f7 5d1',
 766        'lo': '5s 5p',
 767        'rmt': 2.2,
 768        'lmax': '',
 769        'jri': 981
 770    },
 771    65: {
 772        'mass': 158.92535,
 773        'name': 'Terbium',
 774        'symbol': 'Tb',
 775        'econfig': '[Kr] 4d10 5s2 5p6 | 6s2 4f9',
 776        'fleur_default_econfig': '[Kr] 4d10 | 5s2 5p6 6s2 4f8 5d1',
 777        'lo': '5s 5p',
 778        'rmt': 2.1,
 779        'lmax': '',
 780        'jri': 981
 781    },
 782    66: {
 783        'mass': 162.5,
 784        'name': 'Dysprosium',
 785        'symbol': 'Dy',
 786        'econfig': '[Kr] 4d10 5s2 5p6 | 6s2 4f10',
 787        'fleur_default_econfig': '[Kr] 4d10 | 5s2 5p6 6s2 4f9 5d1',
 788        'lo': '5s 5p',
 789        'rmt': 2.4,
 790        'lmax': '',
 791        'jri': 981
 792    },
 793    67: {
 794        'mass': 164.93032,
 795        'name': 'Holmium',
 796        'symbol': 'Ho',
 797        'econfig': '[Kr] 4d10 5s2 5p6 | 6s2 4f11',
 798        'fleur_default_econfig': '[Kr] 4d10 | 5s2 5p6 6s2 4f10 5d1',
 799        'lo': '5s 5p',
 800        'rmt': 2.4,
 801        'lmax': '',
 802        'jri': 981
 803    },
 804    68: {
 805        'mass': 167.259,
 806        'name': 'Erbium',
 807        'symbol': 'Er',
 808        'econfig': '[Kr] 4d10 5s2 5p6 | 6s2 4f12',
 809        'fleur_default_econfig': '[Kr] 4d10 | 5s2 5p6 6s2 4f11 5d1',
 810        'lo': '5s 5p',
 811        'rmt': 2.5,
 812        'lmax': '',
 813        'jri': 981
 814    },
 815    69: {
 816        'mass': 168.93421,
 817        'name': 'Thulium',
 818        'symbol': 'Tm',
 819        'econfig': '[Kr] 4d10 5s2 5p6 | 6s2 4f13',
 820        'fleur_default_econfig': '[Kr] 4d10 | 5s2 5p6 6s2 4f12 5d1',
 821        'lo': '5s 5p',
 822        'rmt': 2.4,
 823        'lmax': '',
 824        'jri': 981
 825    },
 826    70: {
 827        'mass': 173.054,
 828        'name': 'Ytterbium',
 829        'symbol': 'Yb',
 830        'econfig': '[Kr] 4d10 5s2 5p6 | 6s2 4f14',
 831        'fleur_default_econfig': '[Kr] 4d10 | 5s2 5p6 6s2 4f13 5d1',
 832        'lo': '5s 5p',
 833        'rmt': 2.6,
 834        'lmax': '',
 835        'jri': 981
 836    },
 837    71: {
 838        'mass': 174.9668,
 839        'name': 'Lutetium',
 840        'symbol': 'Lu',
 841        'econfig': '[Kr] 4d10 | 4f14 5s2 5p6 5d1 6s2',
 842        'fleur_default_econfig': '[Kr] 4d10 | 5s2 5p6 4f14 6s2 5d1',
 843        'lo': '5s 5p',
 844        'rmt': 2.5,
 845        'lmax': '',
 846        'jri': 981
 847    },
 848    72: {
 849        'mass': 178.49,
 850        'name': 'Hafnium',
 851        'symbol': 'Hf',
 852        'econfig': '[Kr] 4d10 | 4f14 5s2 5p6 5d2 6s2',
 853        'fleur_default_econfig': '[Kr] 4d10 4f14 | 5s2 5p6 6s2 5d2',
 854        'lo': '5s 5p',
 855        'rmt': 2.3,
 856        'lmax': '',
 857        'jri': 981
 858    },
 859    73: {
 860        'mass': 180.94788,
 861        'name': 'Tantalum',
 862        'symbol': 'Ta',
 863        'econfig': '[Kr] 4d10 4f14 | 5s2 5p6 5d3 6s2',
 864        'fleur_default_econfig': '[Kr] 4d10 4f14 | 5s2 5p6 6s2 5d3',
 865        'lo': '5s 5p',
 866        'rmt': 2.2,
 867        'lmax': '',
 868        'jri': 981
 869    },
 870    74: {
 871        'mass': 183.84,
 872        'name': 'Tungsten',
 873        'symbol': 'W',
 874        'econfig': '[Kr] 5s2 4d10 4f14 | 5p6 6s2 5d4',
 875        'fleur_default_econfig': '[Kr] 4d10 4f14 | 5s2 5p6 6s2 5d4',
 876        'lo': '5s 5p',
 877        'rmt': 2.1,
 878        'lmax': '',
 879        'jri': 981
 880    },
 881    75: {
 882        'mass': 186.207,
 883        'name': 'Rhenium',
 884        'symbol': 'Re',
 885        'econfig': '[Kr] 4d10 4f14 5p6 | 5s2 6s2 5d5',
 886        'fleur_default_econfig': '[Kr] 4d10 4f14 | 5s2 5p6 6s2 5d5',
 887        'lo': '5s 5p',
 888        'rmt': 2.1,
 889        'lmax': '',
 890        'jri': 981
 891    },
 892    76: {
 893        'mass': 190.23,
 894        'name': 'Osmium',
 895        'symbol': 'Os',
 896        'econfig': '[Kr] 4d10 4f14 5p6 | 5s2 6s2 5d6',
 897        'fleur_default_econfig': '[Kr] 5s2 4d10 4f14 | 5p6 6s2 5d6',
 898        'lo': '5p',
 899        'rmt': 2.1,
 900        'lmax': '',
 901        'jri': 981
 902    },
 903    77: {
 904        'mass': 192.217,
 905        'name': 'Iridium',
 906        'symbol': 'Ir',
 907        'econfig': '[Kr] 4d10 4f14 5p6 | 5s2 6s2 5d7',
 908        'fleur_default_econfig': '[Kr] 5s2 4d10 4f14 | 5p6 6s2 5d7',
 909        'lo': '5p',
 910        'rmt': 2.1,
 911        'lmax': '',
 912        'jri': 981
 913    },
 914    78: {
 915        'mass': 195.084,
 916        'name': 'Platinum',
 917        'symbol': 'Pt',
 918        'econfig': '[Kr] 4d10 4f14 5p6 | 5s2 6s2 5d8',
 919        'fleur_default_econfig': '[Kr] 5s2 4d10 4f14 | 5p6 6s2 5d8',
 920        'lo': '5p',
 921        'rmt': 2.1,
 922        'lmax': '',
 923        'jri': 981
 924    },
 925    79: {
 926        'mass': 196.966569,
 927        'name': 'Gold',
 928        'symbol': 'Au',
 929        'econfig': '[Kr] 4d10 4f14 5p6 | 5s2 6s2 5d9',
 930        'fleur_default_econfig': '[Kr] 4d10 4f14 | 5s2 5p6 6s2 5d9',
 931        'lo': '5s 5p',
 932        'rmt': 2.2,
 933        'lmax': '',
 934        'jri': 981
 935    },
 936    80: {
 937        'mass': 200.59,
 938        'name': 'Mercury',
 939        'symbol': 'Hg',
 940        'econfig': '[Kr] 5s2 4d10 4f14 | 5p6 5d10 6s2',
 941        'fleur_default_econfig': '[Kr] 5s2 4d10 4f14 5p6 | 5d10 6s2',
 942        'lo': '5d',
 943        'rmt': 2.4,
 944        'lmax': '',
 945        'jri': 981
 946    },
 947    81: {
 948        'mass': 204.3833,
 949        'name': 'Thallium',
 950        'symbol': 'Tl',
 951        'econfig': '[Xe] 4f14 | 5d10 6s2 6p1',
 952        'fleur_default_econfig': '[Xe] 4f14 | 5d10 6s2 6p1',
 953        'lo': '5d',
 954        'rmt': 2.4,
 955        'lmax': '',
 956        'jri': 981
 957    },
 958    82: {
 959        'mass': 207.2,
 960        'name': 'Lead',
 961        'symbol': 'Pb',
 962        'econfig': '[Xe] 4f14 | 5d10 6s2 6p2',
 963        'fleur_default_econfig': '[Xe] 4f14 | 5d10 6s2 6p2',
 964        'lo': '5d',
 965        'rmt': 2.4,
 966        'lmax': '',
 967        'jri': 981
 968    },
 969    83: {
 970        'mass': 208.9804,
 971        'name': 'Bismuth',
 972        'symbol': 'Bi',
 973        'econfig': '[Xe] 4f14 | 5d10 6s2 6p3',
 974        'fleur_default_econfig': '[Xe] 4f14 | 5d10 6s2 6p3',
 975        'lo': '5d',
 976        'rmt': 2.4,
 977        'lmax': '',
 978        'jri': 981
 979    },
 980    84: {
 981        'mass': 209.0,
 982        'name': 'Polonium',
 983        'symbol': 'Po',
 984        'econfig': '[Xe] 4f14 | 5d10 6s2 6p4',
 985        'fleur_default_econfig': '[Xe] 4f14 | 5d10 6s2 6p4',
 986        'lo': '5d',
 987        'rmt': 2.2,
 988        'lmax': '',
 989        'jri': 981
 990    },
 991    85: {
 992        'mass': 210.0,
 993        'name': 'Astatine',
 994        'symbol': 'At',
 995        'econfig': '[Xe] 4f14 | 5d10 6s2 6p5',
 996        'fleur_default_econfig': '[Xe] 4f14 | 5d10 6s2 6p5',
 997        'lo': '5d',
 998        'rmt': 2.2,
 999        'lmax': '',
1000        'jri': 981
1001    },
1002    86: {
1003        'mass': 222.0,
1004        'name': 'Radon',
1005        'symbol': 'Rn',
1006        'econfig': '[Xe] 4f14 | 5d10 6s2 6p6',
1007        'fleur_default_econfig': '[Xe] 4f14 | 5d10 6s2 6p6',
1008        'lo': '5d',
1009        'rmt': 2.2,
1010        'lmax': '',
1011        'jri': 981
1012    },  # TODO: after wards not rigth
1013    87: {
1014        'mass': 223.0,
1015        'name': 'Francium',
1016        'symbol': 'Fr',
1017        'econfig': '[Xe] 4f14 5d10 6s2 | 6p6 7s1',
1018        'fleur_default_econfig': '[Xe] 4f14 5d10 | 6s2 6p6 7s1',
1019        'lo': '6s 6p',
1020        'rmt': 2.2,
1021        'lmax': '',
1022        'jri': 981
1023    },
1024    88: {
1025        'mass': 226.0,
1026        'name': 'Radium',
1027        'symbol': 'Ra',
1028        'econfig': '[Xe] 4f14 5d10 6s2 | 6p6 7s2',
1029        'fleur_default_econfig': '[Xe] 4f14 5d10 | 6s2 6p6 7s2',
1030        'lo': '6s 6p',
1031        'rmt': 2.2,
1032        'lmax': '',
1033        'jri': 981
1034    },
1035    89: {
1036        'mass': 227.0,
1037        'name': 'Actinium',
1038        'symbol': 'Ac',
1039        'econfig': '[Xe] 4f14 5d10 6s2 | 6p6 7s2 6d1',
1040        'fleur_default_econfig': '[Xe] 4f14 5d10 | 6s2 6p6 7s2 6d1',
1041        'lo': '6s 6p',
1042        'rmt': 2.2,
1043        'lmax': '',
1044        'jri': 981
1045    },
1046    90: {
1047        'mass': 232.03806,
1048        'name': 'Thorium',
1049        'symbol': 'Th',
1050        'econfig': '[Xe] 4f14 5d10 6s2 | 6p6 7s2 6d1 5f1',
1051        'fleur_default_econfig': '[Xe] 4f14 5d10 | 6s2 6p6 7s2 6d1 5f1',
1052        'lo': '6s 6p',
1053        'rmt': 2.2,
1054        'lmax': '',
1055        'jri': 981
1056    },
1057    91: {
1058        'mass': 231.03588,
1059        'name': 'Protactinium',
1060        'symbol': 'Pa',
1061        'econfig': '[Xe] 4f14  5d10 6s2 | 6p6 7s2 6d1 5f2',
1062        'fleur_default_econfig': '[Xe] 4f14 5d10 | 6s2 6p6 7s2 6d1 5f2',
1063        'lo': '6s 6p',
1064        'rmt': 2.2,
1065        'lmax': '',
1066        'jri': 981
1067    },
1068    92: {
1069        'mass': 238.02891,
1070        'name': 'Uranium',
1071        'symbol': 'U',
1072        'econfig': '[Xe] 4f14 5d10 6s2 6p6| 7s2 5f4',
1073        'fleur_default_econfig': '[Xe] 4f14 5d10 | 6s2 6p6 7s2 5f4',
1074        'lo': '6s 6p',
1075        'rmt': 2.3,
1076        'lmax': '',
1077        'jri': 981
1078    },
1079    93: {
1080        'mass': 237.0,
1081        'name': 'Neptunium',
1082        'symbol': 'Np',
1083        'econfig': '[Xe] 4f14 5d10 6s2 6p6 | 7s2 5f5',
1084        'fleur_default_econfig': '[Xe] 4f14 5d10 | 6s2 6p6 7s2 5f5',
1085        'lo': '6s 6p',
1086        'rmt': 2.1,
1087        'lmax': '',
1088        'jri': 981
1089    },
1090    94: {
1091        'mass': 244.0,
1092        'name': 'Plutonium',
1093        'symbol': 'Pu',
1094        'econfig': '[Xe] 4f14 5d10 6s2 6p6 | 7s2 5f6',
1095        'fleur_default_econfig': '[Xe] 4f14 5d10 | 6s2 6p6 7s2 5f6',
1096        'lo': '6s 6p',
1097        'rmt': 2.2,
1098        'lmax': '',
1099        'jri': 981
1100    },
1101    95: {
1102        'mass': 243.0,
1103        'name': 'Americium',
1104        'symbol': 'Am',
1105        'econfig': '[Xe] 4f14 5d10 6s2 6p6 | 7s2 5f7',
1106        'fleur_default_econfig': '[Xe] 4f14 5d10 | 6s2 6p6 7s2 5f7',
1107        'lo': '6s 6p',
1108        'rmt': 2.4,
1109        'lmax': '',
1110        'jri': 981
1111    },
1112    96: {
1113        'mass': 247.0,
1114        'name': 'Curium',
1115        'symbol': 'Cm',
1116        'econfig': '[Xe] 4f14 5d10 6s2 6p6 | 7s2 5f8',
1117        'fleur_default_econfig': '[Xe] 4f14 5d10 | 6s2 6p6 7s2 5f8',
1118        'lo': '6s 6p',
1119        'rmt': 2.4,
1120        'lmax': '',
1121        'jri': 981
1122    },
1123    97: {
1124        'mass': 247.0,
1125        'name': 'Berkelium',
1126        'symbol': 'Bk',
1127        'econfig': '[Xe] 4f14 5d10 6s2 6p6 | 7s2 5f9',
1128        'fleur_default_econfig': '[Xe] 4f14 5d10 | 6s2 6p6 7s2 5f9',
1129        'lo': '6s 6p',
1130        'rmt': 2.4,
1131        'lmax': '',
1132        'jri': 981
1133    },
1134    98: {
1135        'mass': 251.0,
1136        'name': 'Californium',
1137        'symbol': 'Cf',
1138        'econfig': '[Xe] 4f14 5d10 6s2 6p6 | 7s2 5f10',
1139        'fleur_default_econfig': '[Xe] 4f14 5d10 | 6s2 6p6 7s2 5f10',
1140        'lo': '6s 6p',
1141        'rmt': 2.4,
1142        'lmax': '',
1143        'jri': 981
1144    },
1145    99: {
1146        'mass': 252.0,
1147        'name': 'Einsteinium',
1148        'symbol': 'Es',
1149        'econfig': '[Xe] 4f14 5d10 6s2 6p6 | 7s2 5f11',
1150        'fleur_default_econfig': '[Xe] 4f14 5d10 | 6s2 6p6 7s2 5f11',
1151        'lo': '6s 6p',
1152        'rmt': 2.4,
1153        'lmax': '',
1154        'jri': 981
1155    },
1156    100: {
1157        'mass': 257.0,
1158        'name': 'Fermium',
1159        'symbol': 'Fm',
1160        'econfig': '[Xe] 4f14 5d10 6s2 6p6 | 7s2 5f12',
1161        'fleur_default_econfig': '[Xe] 4f14 5d10 | 6s2 6p6 7s2 5f12',
1162        'lo': '6s 6p',
1163        'rmt': 2.4,
1164        'lmax': '',
1165        'jri': 981
1166    },
1167    101: {
1168        'mass': 258.0,
1169        'name': 'Mendelevium',
1170        'symbol': 'Md',
1171        'econfig': '[Xe] 4f14 5d10 6s2 6p6 | 7s2 5f13',
1172        'fleur_default_econfig': '[Xe] 4f14 5d10 | 6s2 6p6 7s2 5f13',
1173        'lo': '6s 6p',
1174        'rmt': 2.4,
1175        'lmax': '',
1176        'jri': 981
1177    },
1178    102: {
1179        'mass': 259.0,
1180        'name': 'Nobelium',
1181        'symbol': 'No',
1182        'econfig': '[Xe] 4f14 5d10 6s2 6p6 | 7s2 5f14',
1183        'fleur_default_econfig': '[Xe] 4f14 5d10 | 6s2 6p6 7s2 5f14',
1184        'lo': '6s 6p',
1185        'rmt': 2.4,
1186        'lmax': '',
1187        'jri': 981
1188    },
1189    103: {
1190        'mass': 262.0,
1191        'name': 'Lawrencium',
1192        'symbol': 'Lr',
1193        'econfig': '[Xe] 4f14 5d10 6s2 6p6 | 7s2 5f14 6d1',
1194        'fleur_default_econfig': '[Xe] 4f14 5d10 | 6s2 6p6 7s2 5f14 6d1',
1195        'lo': '6s 6p 5f',
1196        'rmt': 2.4,
1197        'lmax': '',
1198        'jri': 981
1199    },
1200    104: {
1201        'mass': 267.0,
1202        'name': 'Rutherfordium',
1203        'symbol': 'Rf',
1204        'econfig': '[Xe] 4f14 5d10 6s2 6p6 | 7s2 5f14 6d2',
1205        'fleur_default_econfig': '[Xe] 4f14 5d10 6s2 6p6 | 7s2 5f14 6d2',
1206        'lo': '6p 5f',
1207        'rmt': 2.4,
1208        'lmax': '',
1209        'jri': 981
1210    },
1211    105: {
1212        'mass': 268.0,
1213        'name': 'Dubnium',
1214        'symbol': 'Db',
1215        'econfig': '[Xe] 4f14 5d10 6s2 6p6 | 7s2 5f14 6d3',
1216        'fleur_default_econfig': '[Xe] 4f14 5d10 6s2 | 6p6 7s2 5f14 6d3',
1217        'lo': '6p 5f',
1218        'rmt': 2.4,
1219        'lmax': '',
1220        'jri': 981
1221    },
1222    106: {
1223        'mass': 271.0,
1224        'name': 'Seaborgium',
1225        'symbol': 'Sg',
1226        'econfig': '[Xe] 4f14 5d10 6s2 6p6 | 7s2 5f14 6d4',
1227        'fleur_default_econfig': '[Xe] 4f14 5d10 6s2 | 6p6 7s2 5f14 6d4',
1228        'lo': '6p 5f',
1229        'rmt': 2.4,
1230        'lmax': '',
1231        'jri': 981
1232    },
1233    107: {
1234        'mass': 272.0,
1235        'name': 'Bohrium',
1236        'symbol': 'Bh',
1237        'econfig': '[Rn] 7s2 5f14 | 6d5',
1238        'fleur_default_econfig': '[Xe] 4f14 5d10 6s2 6p6 5f14 | 7s2 6d5',
1239        'lo': '',
1240        'rmt': 2.4,
1241        'lmax': '',
1242        'jri': 981
1243    },
1244    108: {
1245        'mass': 270.0,
1246        'name': 'Hassium',
1247        'symbol': 'Hs',
1248        'econfig': '[Rn] 7s2 5f14 | 6d6',
1249        'fleur_default_econfig': '[Rn] 5f14 | 7s2 6d6',
1250        'lo': '',
1251        'rmt': 2.4,
1252        'lmax': '',
1253        'jri': 981
1254    },
1255    109: {
1256        'mass': 276.0,
1257        'name': 'Meitnerium',
1258        'symbol': 'Mt',
1259        'econfig': '[Rn] 7s2 5f14 | 6d7',
1260        'fleur_default_econfig': '[Rn] 5f14 | 7s2 6d7',
1261        'lo': '',
1262        'rmt': 2.4,
1263        'lmax': '',
1264        'jri': 981
1265    },
1266    110: {
1267        'mass': 281.0,
1268        'name': 'Darmstadtium',
1269        'symbol': 'Ds',
1270        'econfig': '[Rn] 7s2 5f14 | 6d8',
1271        'fleur_default_econfig': '[Rn] 5f14 | 7s2 6d8',
1272        'lo': '',
1273        'rmt': 2.4,
1274        'lmax': '',
1275        'jri': 981
1276    },
1277    111: {
1278        'mass': 280.0,
1279        'name': 'Roentgenium',
1280        'symbol': 'Rg',
1281        'econfig': '[Rn] 7s2 5f14 | 6d9',
1282        'fleur_default_econfig': '[Rn] 5f14 | 7s2 6d9',
1283        'lo': '',
1284        'rmt': 2.4,
1285        'lmax': '',
1286        'jri': 981
1287    },
1288    112: {
1289        'mass': 285.0,
1290        'name': 'Copernicium',
1291        'symbol': 'Cn',
1292        'econfig': '[Rn] 7s2 5f14 | 6d10',
1293        'fleur_default_econfig': '[Rn] 5f14 | 7s2 6d10',
1294        'lo': '6d',
1295        'rmt': 2.4,
1296        'lmax': '',
1297        'jri': 981
1298    },
1299    113: {
1300        'mass': 285.0,
1301        'name': 'Nihomium',
1302        'symbol': 'Nh',
1303        'econfig': '[Rn] 7s2 5f14 | 6d10 7p1',
1304        'fleur_default_econfig': '[Rn] 7s2 5f14 | 6d10 7p1',
1305        'lo': '6d',
1306        'rmt': 2.4,
1307        'lmax': '',
1308        'jri': 981
1309    },
1310    114: {
1311        'mass': 289.0,
1312        'name': 'Flerovium',
1313        'symbol': 'Fl',
1314        'econfig': '[Rn] 7s2 5f14 | 6d10 7p2',
1315        'fleur_default_econfig': '[Rn] 7s2 5f14 | 6d10 7p2',
1316        'lo': '6d',
1317        'rmt': 2.4,
1318        'lmax': '',
1319        'jri': 981
1320    },
1321    115: {
1322        'mass': 0.0,
1323        'name': 'Mascovium',
1324        'symbol': 'Mc',
1325        'econfig': '[Rn] 7s2 5f14 | 6d10 7p3',
1326        'fleur_default_econfig': '[Rn] 7s2 5f14 | 6d10 7p3',
1327        'lo': '6d',
1328        'rmt': 2.4,
1329        'lmax': '',
1330        'jri': 981
1331    },
1332    116: {
1333        'mass': 293.0,
1334        'name': 'Livermorium',
1335        'symbol': 'Lv',
1336        'econfig': '[Rn] 7s2 5f14 | 6d10 7p4',
1337        'fleur_default_econfig': '[Rn] 7s2 5f14 | 6d10 7p4',
1338        'lo': '6d',
1339        'rmt': 2.4,
1340        'lmax': '',
1341        'jri': 981
1342    },
1343    117: {
1344        'mass': 0.0,
1345        'name': 'Tennessine',
1346        'symbol': 'Ts',
1347        'econfig': '[Rn] 7s2 5f14 | 6d10 7p5',
1348        'fleur_default_econfig': '[Rn] 7s2 5f14 | 6d10 7p5',
1349        'lo': '6d',
1350        'rmt': 2.4,
1351        'lmax': '',
1352        'jri': 981
1353    },
1354    118: {
1355        'mass': 0.0,
1356        'name': 'Oganesson',
1357        'symbol': 'Og',
1358        'econfig': '[Rn] 7s2 5f14 | 6d10 7p6',
1359        'fleur_default_econfig': '[Rn] 7s2 5f14 | 6d10 7p6',
1360        'lo': '6d',
1361        'rmt': 2.4,
1362        'lmax': '',
1363        'jri': 981
1364    }
1365}