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

bug fix in SpacegroupAnalyzer #2123

Merged
merged 3 commits into from May 6, 2021
Merged

Conversation

gpetretto
Copy link
Contributor

There is a problem in the get_conventional_standard_structure method of the SpacegroupAnalyzer.

The code below demonstrates the issue:

from pymatgen.symmetry.analyzer import SpacegroupAnalyzer
from pymatgen.analysis.structure_matcher import StructureMatcher
from pymatgen.ext.matproj import MPRester

s = MPRester().get_structure_by_material_id("mp-761986")

sm = StructureMatcher(ltol=0.0001, stol=0.0001, angle_tol=0.1, primitive_cell=False, scale=False)

spga = SpacegroupAnalyzer(s)
sc = spga.get_conventional_standard_structure()
s_ref = spga.get_refined_structure()

print(sm.fit(s, s_ref))
print(sm.fit(s, sc))

Output:

True
False

This comes from the fact that in the triclinic case the reference structure can be modified by the call to struct.get_reduced_structure("LLL"), but the lattice object is not updated accordingly.

@coveralls
Copy link

coveralls commented Apr 28, 2021

Coverage Status

Coverage decreased (-0.6%) to 83.011% when pulling 381b843 on gpetretto:bugfix into ce2fb4e on materialsproject:master.

@mkhorton
Copy link
Member

mkhorton commented May 3, 2021

Thanks for fixing @gpetretto -- would it be possible to add a quick test case to catch this too? Thank you

@shyuep shyuep merged commit a51bd9e into materialsproject:master May 6, 2021
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

Successfully merging this pull request may close these issues.

None yet

4 participants