From 8eea4f8049f94c7695a5c16a0a78f45b9ddcd036 Mon Sep 17 00:00:00 2001
From: "Daria M. Tomecka" <tomecka@fhi-berlin.mpg.de>
Date: Thu, 10 Aug 2017 15:45:05 +0200
Subject: [PATCH] update normalizer

---
 .../classify4me_prototypes.py                 | 20 +++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/normalizer/normalizer-prototypes/classify4me_prototypes.py b/normalizer/normalizer-prototypes/classify4me_prototypes.py
index 5605f33..cacb6ca 100644
--- a/normalizer/normalizer-prototypes/classify4me_prototypes.py
+++ b/normalizer/normalizer-prototypes/classify4me_prototypes.py
@@ -40,7 +40,7 @@ from nomadcore.parser_backend import JsonParseEventsWriterBackend
 
 import sys
 #print(sys.path)
-sys.path.append('/home/beaker/py3k/lib/python3.5/')
+#sys.path.append('/home/beaker/py3k/lib/python3.5/')
 import spglib
 
 import logging
@@ -190,7 +190,7 @@ def updatePrototypesWyckoff(protos):
                 wy = protoNormalizeWycoff(protoDict)
                 protoDict['normalized_wyckoff_spg'] = wy
             except:
-                logging.exception("Failed to compute normalized wyckoffs for %s", protoDict)
+                logging.exception("Failed to compute normalized wyckoffs for %s", json.dumps(protoDict))
 
 def systemToSpg(cell, atomSpecies, atomPos):
     """uses spg to calculate the symmetry of the given system"""
@@ -279,15 +279,15 @@ def main():
     dictReader = ParseStreamedDicts(sys.stdin)
     while True:
         sectSys = dictReader.readNextDict()
+        if sectSys is None:
+            break
         try:
-            if sectSys is None:
-                break
-                label = classify_by_norm_wyckoff(sectSys)
-                if label:
-                    backend.openContext(sectSys['uri'])
-                    backend.addValue("prototype_label", label)
-                    backend.closeContext(sectSys['uri'])
-                    sys.stdout.flush()
+            label = classify_by_norm_wyckoff(sectSys)
+            if label:
+                backend.openContext(sectSys['uri'])
+                backend.addValue("prototype_label", label)
+                backend.closeContext(sectSys['uri'])
+                sys.stdout.flush()
         except:
             logging.exception("exception trying to calculate prototype for %s",sectSys)
 
-- 
GitLab