materialsproject / emmet

Be a master builder of databases of material properties. Avoid the Kragle.
https://materialsproject.github.io/emmet/
Other
49 stars 63 forks source link

Add catch for when Structure.get_space_group_info fails #968

Closed esoteric-ephemera closed 3 months ago

esoteric-ephemera commented 3 months ago

Sometimes the default symprec and angle_tolerance used by pymatgen.core.Structure.get_space_group_info are too tight or loose to accurately determine the crystalline symmetry. In those cases, Structure.get_space_group_info throws an error 'NoneType' object is not subscriptable and building a ValidationDoc fails during both the kpoint and incar checks.*

This PR adds a new deprecation message for this by checking if get_space_group_info can be called on the input structure during validation, as well as a test for this behavior.

* Long explanation: in pymatgen, the Kpoints object checks the space group to see if a lattice is face-centered, because only Gamma-centered grids and not Monkhorst-Pack k-points grids should be used for face-centered lattices, per VASP. The symmetry check was added to pymatgen in PR #3245, and relies on get_space_group_info