Skip to content
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

Problem dealing with occupancies including error bar? #7

Closed
errhernandez opened this issue Jun 28, 2021 · 5 comments
Closed

Problem dealing with occupancies including error bar? #7

errhernandez opened this issue Jun 28, 2021 · 5 comments

Comments

@errhernandez
Copy link

Dear Laurent,

Thank you for this excellent facility. I have come across a little problem when reading certain .cif files that include errors in parenthesis in occupancies for atoms in the cell using Crystal.from_cif(). I attach one such example. The error I get is this:

crystal = Crystal.from_cif( filename.cif ) # filename.cif = file in the attachment
filename.cif.gz

~/opt/anaconda3/lib/python3.8/site-packages/crystals/crystal.py in from_cif(cls, path, **kwargs)
126 return cls(
127 unitcell=symmetry_expansion(
--> 128 parser.atoms(), parser.symmetry_operators()
129 ),
130 lattice_vectors=parser.lattice_vectors(),

~/opt/anaconda3/lib/python3.8/site-packages/crystals/parsers.py in atoms(self)
702
703 atoms = list()
--> 704 for e, x, y, z, occ in zip(elements, xs, ys, zs, occupancies):
705 coords = np.array(
706 [

ValueError: could not convert string to float: '0.707(2)'

I thought you might like to know about this and I think it should be easy to correct.

Thank you!

Eduardo

@LaurentRDC
Copy link
Owner

Thank you for your report! I have fixed it and included your CIF file as a test case to ensure this never happens again.

Look out for version 1.3.2, which will include this bug-fix. It will be released today.

@errhernandez
Copy link
Author

Thank you for your speedy response. I look forward to the release. Best wishes.

@LaurentRDC
Copy link
Owner

Release 1.3.2 is live. Please let me know if it works for you

@errhernandez
Copy link
Author

errhernandez commented Jun 28, 2021 via email

@LaurentRDC
Copy link
Owner

I'll close this for now but don't hesitate to reopen if the problem persists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants