Planned maintenance on Wednesday, 2021-01-20, 17:00-18:00. Expect some interruptions during that time

Commit 4e36caa1 authored by Daria M. Tomecka's avatar Daria M. Tomecka

add to the normalizer new section "prototype" and two aflow metadata (id and url)

parent 9545b727
......@@ -227,7 +227,9 @@ def classify_by_norm_wyckoff(sectionSystem):
#else:
#proto = '%d-%s' % (spg_nr, protoDict)
proto = '%d-%s-%s' % (spg_nr, protoDict.get("Prototype","-"),protoDict.get("Pearsons Symbol","-"))
return proto
aflow_prototype_id = protoDict.get("aflow_prototype_id","-")
aflow_prototype_url = protoDict.get("aflow_prototype_url","-")
return {"prototype_label":proto, "prototype_aflow_id":aflow_prototype_id, "prototype_aflow_url":aflow_prototype_url}
except:
#logging.exception("failure while computing for %r",json_file_name)
logging.exception("failure while computing for that example")
......@@ -261,11 +263,24 @@ def main():
sectSys = dictReader.readNextDict()
if sectSys is None:
break
try:
label = classify_by_norm_wyckoff(sectSys)
if label:
labels = classify_by_norm_wyckoff(sectSys)
if labels:
backend.openContext(sectSys['uri'])
backend.addValue("prototype_label", label)
pSect = backend.openSection("section_prototype")
backend.addValue("prototype_assignement_method", "normalized-wyckoff")
backend.addValue("prototype_label", labels['prototype_label'])
backend.addValue("prototype_aflow_id", labels["prototype_aflow_id"])
backend.addValue("prototype_aflow_url", labels["prototype_aflow_url"])
backend.closeSection("section_prototype", pSect)
# backend.addValue("prototype_aflow_id", aflow_prototype_id)
# backend.addValue("prototype_aflow_url", aflow_prototype_url)
# if "aflow_prototype_url" in sectSys:
# backend.addValue("prototype_aflow_url",sectSys["aflow_prototype_url"])
backend.closeContext(sectSys['uri'])
sys.stdout.flush()
except:
......
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