From 9e4005995920ace541432e558d70cc733d493319 Mon Sep 17 00:00:00 2001
From: Joseph Weston <joseph@weston.cloud>
Date: Fri, 18 Oct 2019 15:52:35 +0200
Subject: [PATCH] provide "shape" and "format" to empty Qsymm models as
 required by 1.2

Not providing these is now deprecated.
Close #325.
---
 kwant/qsymm.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kwant/qsymm.py b/kwant/qsymm.py
index 728dd2b7..fef2fd64 100644
--- a/kwant/qsymm.py
+++ b/kwant/qsymm.py
@@ -68,8 +68,8 @@ def builder_to_model(syst, momenta=None, real_space=True,
     is used in finalized kwant systems.
     """
     def term_to_model(d, par, matrix):
-        if np.allclose(matrix, 0):
-            result = BlochModel({})
+        if allclose(matrix, 0):
+            result = BlochModel({}, shape=matrix.shape, format=np.ndarray)
         else:
             result = BlochModel({BlochCoeff(d, qsymm.sympify(par)): matrix},
                                 momenta=momenta)
-- 
GitLab