poscarDiff#

pyprocar.pyposcar.poscarDiff(poscar1: Poscar | str, poscar2: Poscar | str, tolerance: float = 0.01) dict[source]#

It compares two different Poscar objects. Small numerical errors up to tolerance are ignored.

Return: a dictionary with the differences found. If the files are the same, it returns an empty dictionary (i.e. a False value)

The comparison does: -comparison between elements -comparison between lattices (distances and angles) -comparison of the relative distances between atoms

Parameters:
  • poscar1 (Poscar | str) – the first Poscar filename or object

  • poscar2 (Poscar | str) – the first Poscar filename or object

  • tolerance (float) – numerical difference to consider both files equal. Default 0.01

Returns:

dict – the differences are stored with keys ‘Elements’, ‘lattices’, ‘distances’. If no differences are found an empty dict is returned