Open mbercx opened 1 year ago
Seems to be an ASE problem:
In [1]: from ase import io
In [2]: at = io.read('As-2D.xyz')
In [3]: at.pbc
Out[3]: array([ True, True, True])
Opened a PR:
https://gitlab.com/ase/ase/-/merge_requests/2876
With those changes it seems to work fine:
(aiida-core) mbercx@theospc46:~/envs/aiida-core/data/structures$ verdi data core.structure import ase As-2D.xyz
Successfully imported structure As2 (PK = 1549)
(aiida-core) mbercx@theospc46:~/envs/aiida-core/data/structures$ verdi shell
Python 3.9.16 (main, Dec 7 2022, 01:11:58)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.34.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: load_node(1549).pbc
Out[1]: (True, True, False)
Once they merge and release we can update our dependencies and close this issue.
Note that in case the pbc
if differently (properly?) formatted:
Lattice="3.6086769266 0.0 0.0 -1.8043384633 3.1252058924 0.0 0.0 0.0 21.3114930844" pbc="T T F"
i.e. pbc="True True False"
instead of pbc="T T F"
, the ase
parsing works fine. So perhaps it's we who are to blame after all:
Also see https://gitlab.com/ase/ase/-/merge_requests/2876#note_1355561967
Note: Seems the extxyz format should accept True
/False
as well for booleans, so nothing wrong with our exporter:
My PR into ASE got merged, just waiting for a release now. Then we can update the version specifier and we should be good to go. 🚀
Describe the bug
When trying to import an e.g. 2D structure from an
.xyz
file that correctly specifies the periodic boundary conditions (pbc
),verdi data core.structure import ase
does not respectpbc
.Steps to reproduce
Expected behavior
The periodic boundary conditions should be respected, i.e. I'd expect:
Your environment
Additional context
Possibly related to https://github.com/aiidateam/aiida-core/issues/3476 Encountered while testing https://github.com/aiidateam/aiida-quantumespresso/pull/907