From f8605dc6df5efaf6bd27088681fa18ca1a39ae78 Mon Sep 17 00:00:00 2001
From: Christoph Groth <christoph.groth@cea.fr>
Date: Thu, 27 Apr 2017 16:20:31 +0200
Subject: [PATCH] small logic simplification

---
 kwant/lattice.py | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/kwant/lattice.py b/kwant/lattice.py
index 21869c41..8bd91dea 100644
--- a/kwant/lattice.py
+++ b/kwant/lattice.py
@@ -568,11 +568,8 @@ class TranslationalSymmetry(builder.Symmetry):
         factors = np.dot(other.periods, inv)
         # Absolute tolerance is correct in the following since we want an error
         # relative to the closest integer.
-        if not (np.allclose(factors, np.round(factors), rtol=0, atol=1e-8) and
-                np.allclose(ta.dot(factors, self.periods), other.periods)):
-            return False
-        else:
-            return True
+        return (np.allclose(factors, np.round(factors), rtol=0, atol=1e-8) and
+                np.allclose(ta.dot(factors, self.periods), other.periods))
 
     def add_site_family(self, fam, other_vectors=None):
         """
-- 
GitLab