-
Notifications
You must be signed in to change notification settings - Fork 189
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
Fix 1028 structure to pymagen #1285
Merged
giovannipizzi
merged 17 commits into
aiidateam:develop
from
nmounet:fix_1028_structure_to_pymagen
Mar 15, 2018
Merged
Fix 1028 structure to pymagen #1285
giovannipizzi
merged 17 commits into
aiidateam:develop
from
nmounet:fix_1028_structure_to_pymagen
Mar 15, 2018
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…reData (with tags/kind names)
…eData, including one with spins
…r the case with partial occupancies
…gen is impossible when both spins and partial occupancies are used
… when structures with both spins and partial occupancies are tentatively converted
…o ensure correct transferring back-and-forth of kind names
…to all pymatgen sites, whenever there are customized kind names
…en sites, are now converted to StructureData kind names
…sing the additional kwarg add_spin; fix the corresponding tests
…28_structure_to_pymagen
Awesome! For the failing test, it's a known issue and @szoupanos is going to commit a fix in develop, so merging develop in after his PR should solve the problem. |
giovannipizzi
previously approved these changes
Mar 15, 2018
giovannipizzi
approved these changes
Mar 15, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fix for #1028 (for pymatgen).
Now StructureData -> pymatgen -> StructureData roundtrip works with all kinds of kind names, using the 'properties' of pymatgen structure sites. It works even with letters and strings (and not only with ordinals appended to the symbol, as for ASE)
In addition, a number of tests have been added (including for ASE), to test in particular roundtrip behaviour, or conversion to/from pymatgen structure with partial occupancies.
Finally, StructureData -> pymatgen conversion (and vice-versa) now supports spins (only for structure, not for molecule), using the rule that kind names ending with 1 indicate spin +1, and kind name ending with 2 are for spin -1.
To trigger the conversion to a pymatgen structure with spin, one simply needs to do
structure.get_pymatgen(add_spin=True)
Note that partial occupancies plus spin and not supported for these conversions; tests have been created to check than an exception is raised when the user tries to do such a conversion.