Skip to content

Commit

Permalink
i guess pylint doesnt like elif
Browse files Browse the repository at this point in the history
  • Loading branch information
richardtran415 committed May 2, 2021
1 parent 921e779 commit 4562819
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions pymatgen/core/surface.py
Expand Up @@ -313,19 +313,15 @@ def is_symmetric(self, symprec=0.1):
sg = SpacegroupAnalyzer(self, symprec=symprec)
symmops = sg.get_point_group_operations()

if sg.is_laue():
# check for inversion symmetry
return True
elif any([np.alltrue(op.rotation_matrix[2] == np.array([0,0,-1])) for op in symmops]):
# Because the two surfaces of our slabs are always parallel to the (hkl) plane,
if sg.is_laue() or any([op.translation_vector[2] != 0 for op in symmops]) or \
any([np.alltrue(op.rotation_matrix[2] == np.array([0,0,-1])) for op in symmops]):
# Check for inversion symmetry. Or if sites from surface (a) can be translated
# to surface (b) along the [hkl]-axis, surfaces are symmetric. Or because the
# two surfaces of our slabs are always parallel to the (hkl) plane,
# any operation where theres an (hkl) mirror plane has surface symmetry
return True
elif any([op.translation_vector[2] != 0 for op in symmops]):
# if sites from surface (a) can be translated to
# surface (b) along the [hkl]-axis, surfaces are symmetric
return True

return False
return True
else:
return False

def get_sorted_structure(self, key=None, reverse=False):
"""
Expand Down

0 comments on commit 4562819

Please sign in to comment.