-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve error handling in SymmetryData
#1118
Conversation
Awesome, thanks @mkhorton. Is there a reason for the minimum pymatgen version? And if you can fix the linting that would be great. And apologies for the failing workflows for the tests., we haven't configured the enum generation workflow to be compatible with forks. I've ran the tests locally with your patch and everything looks good. |
No worries about the tests from my side, I did test this myself also. For the minimum pymatgen version, this is because |
Sounds good, just wanted to be sure there's a reason if we're asked in the future. |
Just ran through |
All good, pre-commit complains a lot. You happy with this? Can merge whenever you're ready |
I'm happy with this, thanks Tyler! |
Hi everyone, just a small PR:
The
SymmetryData
model currently hasoptional
fields, and therefore can be constructed even if symmetry information is unknown, e.g. if spglib fails.This PR improves error handling in
.from_structure
to gracefully handle cases where spglib cannot determine the symmetry of a structure. A common use case where this might be encountered is if an otherwise validStructureMeta
(or a subclass ofStructureMeta
) is instantiated, but with symmetry information unknown.The PR also improves handling of
angle_tolerance
to ensure that this is picked up fromEmmetSettings
instead of assuming the default value, and records this alongsidesymprec
in the document model. This is also an optional field so as not to break backwards compatibility.It might be better to make these fields non-optional, but that would be a breaking change and I don't want to suggest it in this PR.