-
Notifications
You must be signed in to change notification settings - Fork 200
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
StructureData kind names are not preserved when getting pymatgen structure #1028
Comments
This is not accurate. E.g. when running this
the output of
and the output of
so the kind names are preserved, when assigned in this way (and the masses are the same, and the kind name is the element name followed by an integer, and probably a few more requirements...). I think the only proper way to do it is, when exporting, to use the new functions that me and @sphuber implemented here https://github.com/aiidateam/aiida_core/blob/develop/aiida/tools/data/structure/__init__.py The issue is that it is not obvious how to properly deal with this for each external library. E.g. AFAIK in ASE the only additional thing one can use is an integer (the 'tag'). AiiDA tries to use it so that at least in simple cases one can do a round trip and obtain back the same kinds, but unfortunately this cannot work in all cases because of the different way things are stored (in AiiDA, there are kinds with a label and, e.g., a mass; in ASE there are atoms, each of them has a tag and an mass; and there is no easy way that always works to map one on the other). If there is a specific example that we can try, where the conversion does not work as expected, and also the code that shows what instead it would be the expected behaviour (or how to obtain it with a specific external library), please post it here for discussion and to then include it in AiiDA. This is also very related to the discussion to #853 |
I would suggest that either we get a specific example that does not work from Chiara, or we close the issue for the time being. |
The problem with ASE arises only if you do not use numbers but letters to distinguish the sites (Nia instead of Ni1).
The output is:
The output is: The problem is always there with pymatgen:
Output: |
Indeed, the issue is there (and should be fixed) for pymatgen. |
For pymatgen, I have a fix (PR to come soon). |
Issue is fixed by #1285 |
Courtesy of @ChRicca
If a
StructureData
specifies sites with kinds that have suffixes to the elemental type, for exampleNi1
andNi2
, when getting the ASE or pymatgen structure, the kind names are not preserved. If possible and supported by these other libraries, the original kind names should be kept, such that no information is lossed when toggling between data structures.The text was updated successfully, but these errors were encountered: