Commit 8eea4f80 authored by Daria M. Tomecka's avatar Daria M. Tomecka
Browse files

update normalizer

parent bd6e8e14
...@@ -40,7 +40,7 @@ from nomadcore.parser_backend import JsonParseEventsWriterBackend ...@@ -40,7 +40,7 @@ from nomadcore.parser_backend import JsonParseEventsWriterBackend
import sys import sys
#print(sys.path) #print(sys.path)
sys.path.append('/home/beaker/py3k/lib/python3.5/') #sys.path.append('/home/beaker/py3k/lib/python3.5/')
import spglib import spglib
import logging import logging
...@@ -190,7 +190,7 @@ def updatePrototypesWyckoff(protos): ...@@ -190,7 +190,7 @@ def updatePrototypesWyckoff(protos):
wy = protoNormalizeWycoff(protoDict) wy = protoNormalizeWycoff(protoDict)
protoDict['normalized_wyckoff_spg'] = wy protoDict['normalized_wyckoff_spg'] = wy
except: 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): def systemToSpg(cell, atomSpecies, atomPos):
"""uses spg to calculate the symmetry of the given system""" """uses spg to calculate the symmetry of the given system"""
...@@ -279,15 +279,15 @@ def main(): ...@@ -279,15 +279,15 @@ def main():
dictReader = ParseStreamedDicts(sys.stdin) dictReader = ParseStreamedDicts(sys.stdin)
while True: while True:
sectSys = dictReader.readNextDict() sectSys = dictReader.readNextDict()
if sectSys is None:
break
try: try:
if sectSys is None: label = classify_by_norm_wyckoff(sectSys)
break if label:
label = classify_by_norm_wyckoff(sectSys) backend.openContext(sectSys['uri'])
if label: backend.addValue("prototype_label", label)
backend.openContext(sectSys['uri']) backend.closeContext(sectSys['uri'])
backend.addValue("prototype_label", label) sys.stdout.flush()
backend.closeContext(sectSys['uri'])
sys.stdout.flush()
except: except:
logging.exception("exception trying to calculate prototype for %s",sectSys) logging.exception("exception trying to calculate prototype for %s",sectSys)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment