Python Materials Genomics (pymatgen) is a robust materials analysis code that defines classes for structures and molecules with support for many electronic structure codes. It powers the Materials Project.
Using float as dict keys can be prone to precision issues (especially when float is not rounded), a few functions operate on such dict[float, Any] (could be more not annotated):
Using
float
asdict
keys can be prone to precision issues (especially whenfloat
is not rounded), a few functions operate on suchdict[float, Any]
(could be more not annotated):core.bonds.obtain_all_bond_lengths
https://github.com/materialsproject/pymatgen/blob/bd9fba9ec62437b5b62fbd0b2c2c723216cc5a2c/src/pymatgen/core/bonds.py#L122-L137
core.lattice.Lattie
https://github.com/materialsproject/pymatgen/blob/bd9fba9ec62437b5b62fbd0b2c2c723216cc5a2c/src/pymatgen/core/lattice.py#L545-L557
diffraction patterns
https://github.com/materialsproject/pymatgen/blob/bd9fba9ec62437b5b62fbd0b2c2c723216cc5a2c/src/pymatgen/analysis/diffraction/neutron.py#L135 https://github.com/materialsproject/pymatgen/blob/bd9fba9ec62437b5b62fbd0b2c2c723216cc5a2c/src/pymatgen/analysis/diffraction/xrd.py#L199