From 51275c772d5411324e47ae963802d569a5fbfafa Mon Sep 17 00:00:00 2001 From: Hermann Ulrich Schnait Date: Tue, 4 Jun 2019 16:48:23 +0200 Subject: [PATCH] Bugfix in Blockstructure Test --- python/block_structure.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/python/block_structure.py b/python/block_structure.py index fd34c48a..7563c224 100644 --- a/python/block_structure.py +++ b/python/block_structure.py @@ -439,8 +439,8 @@ class BlockStructure(object): # adapt deg_shells if self.deg_shells is not None: for degsh in self.deg_shells[ish]: - for key in degsh.keys(): - if isinstance(degsh, dict): + if isinstance(degsh, dict): + for key in degsh.keys(): if not key in gf_struct: del degsh[key] continue @@ -450,7 +450,8 @@ class BlockStructure(object): v[gf_struct[key], :][:, gf_struct[key]] warn( 'Removing shells from degenerate shell {}. Cannot guarantee that they continue to be equivalent.') - else: + else: # degshell is list + for key in degsh: if not key in gf_struct: degsh.remove(key) continue