From f437c7555074c94d9c7a893af859bd4d1b962abf Mon Sep 17 00:00:00 2001
From: Dennis Heffels <d.heffels@fz-juelich.de>
Date: Wed, 20 Nov 2019 17:23:17 +0100
Subject: [PATCH] small corrections

---
 kwant/builder.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kwant/builder.py b/kwant/builder.py
index 96cfec3b..01fbc078 100644
--- a/kwant/builder.py
+++ b/kwant/builder.py
@@ -1,4 +1,3 @@
-
 # Copyright 2011-2019 Kwant authors.
 #
 # This file is part of Kwant.  It is subject to the license terms in the file
@@ -1870,7 +1869,8 @@ def add_peierls_phase(syst, peierls_parameter='phi', fix_gauge=True):
         @wraps(gauge)
         def f(*args, **kwargs):
             phases = gauge(*args, **kwargs)
-            if not isinstance(phases, tuple):
+            # When there are no leads 'gauge' returns a single callable
+            if not syst.leads:
                 phases = (phases,)
             return dict(zip(phase_names, phases))
 
-- 
GitLab