-
Notifications
You must be signed in to change notification settings - Fork 918
AseAtomsAdaptor: Support arbitrary selective dynamics constraints #4229
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
AseAtomsAdaptor: Support arbitrary selective dynamics constraints #4229
Conversation
* src/pymatgen/io/ase.py (AseAtomsAdaptor.get_atoms): Use FixCartesian constraint instead of FixAtoms. FixCartesian can constrain individual coordinates and directly map selective dynamics settings. (AseAtomsAdaptor.get_structure): Add mapping from FixCartesian constraint to selective dynamics.
Hi @yantar92,
You can use this example here: Lines 186 to 203 in da607e8
Also can you detail how this is different than the existing |
I replaced
|
* src/pymatgen/io/ase.py (AseAtomsAdaptor.get_atoms): Make sure that old tests are not failing. Never create empty constraints. Prefer using FixAtoms when possible (as in the past).
* tests/io/test_ase.py (test_get_atoms_from_structure_dyn) (test_get_structure_dyn): Test mixed coordinate constraint.
I added new tests now. |
Thanks. |
Summary
Major changes:
Todos
If this is work in progress, what else needs to be done?
Checklist
ruff
.mypy
.duecredit
@due.dcite
decorators to reference relevant papers by DOI (example)Tip: Install
pre-commit
hooks to auto-check types and linting before every commit: