Closed zbwang closed 8 years ago
I fixed for all the ICSD files. I cannot fix the abinit version because the abinit version has serious problems. First, the symmetry positions is not properly preceded with a _. Second, the atomic positions reported are already replicated for symmetrically equivalent sites but the symm ops is not P1. This results in each site having a site occupancy of 4, which is ridiculous. The ABINIT people @gmatteo should fix their CIF format.
I am also encountering this issue with cifs from the CSD. Can you please elaborate on how to fix it?
Pls post an example CIF that cannot be parsed.
Here is an example file. I'm trying to parse it using pymatgen and I get the following error:
The line that calls the parser: 74 # Read the coordinates from the cif file using pymatgen 75 f1=CifParser(cif_file_name) 76 struct=f1.get_structures()[0]
The error:
Traceback (most recent call last):
File "../../SRC/myscript.py", line 76, in
There is a warning that tells you that the CIF file has occupancies greater than 1. In your file, tehre are overlapping atoms. For example, Ba1 and Ba1 are the same fractional coordinates. I am not sure of the format of the CSD files. Are you supposed to ignore the labels with a ?
In any case, you can also get around the problem by setting a high occupancy tolerance. E.g.,
from pymatgen.io.cif import CifParser
s = CifParser("ABACUF.MOF_subset.cif", occupancy_tolerance=100).get_structures()[0]
print(s)
The occupancy tolerance allows the occupancy to take a value from 1 to the tolerance value, but will rescale every occupancy to 1.
I am unsure about the asterisk issue, but I will look into. Meanwhile the tolerance work-around appears to be working. Thanks for your help.
System
Summary
Sometimes, Pymatgen failed to read cif files directly downloaded from ICSD-Desktop. The format of these cif files is slightly different from the standard one.
Pymatgen also failed to deal with cif files written by Abinit (prtcif=1). This cif file might not have the exact standard ICSD format.
Example code
Error message
Suggested solution (if any)
Files (if any)
cifs.zip