Add catch for when Structure.get_space_group_info fails #968
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Sometimes the default
symprec
andangle_tolerance
used bypymatgen.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