From 456281988c253ac1aadd436c4726e8a8546db356 Mon Sep 17 00:00:00 2001 From: richardtran415 Date: Sun, 2 May 2021 15:27:09 -0400 Subject: [PATCH] i guess pylint doesnt like elif --- pymatgen/core/surface.py | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/pymatgen/core/surface.py b/pymatgen/core/surface.py index 9f23ce6adb5..4e6a39f6c4e 100644 --- a/pymatgen/core/surface.py +++ b/pymatgen/core/surface.py @@ -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): """