Commit 8444bcd6 authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Merge branch 'v0.7.5' into 'master'

V0.7.5

See merge request !92
parents e7d1571a 183dc381
Pipeline #69147 passed with stage
in 18 seconds
Subproject commit 5bfbdf09cbd0e9a2934467bdeca569296952ee06
Subproject commit b50054a10b28efddb82554051d797b44f2b1067e
Subproject commit 76e5c29e3ed8d1d1167c03b138020498831ef896
Subproject commit 15d0110cbeda05aaea05e4d30ba3aeb0874dafef
Subproject commit fe15759f080e8176d88af91447949243608b0d7e
Subproject commit b39569c5fa69254c90f91ec430d28a0941efbe95
# This file will be overridden during build.
# The values here are just placeholder
log = "git commit msg placeholder"
ref = "git ref placeholder"
version = "git version placeholder"
commit = "git commit sha placeholder"
log, ref, version, commit = "a65b8510 Now the symemtry analysis is only performed for bulk systems. Also the prototype data is only included if the prototype is matched. Removed the symmetry related information from DFT domain data.", "heads/symmetry_update", "v0.6.4-397-ga65b8510", "a65b8510"
......@@ -479,35 +479,28 @@ class SystemNormalizer(SystemBasedNormalizer):
if (class_test or comp_test) is False:
self.logger.warning('Mismatch in Springer classification or compounds')
def prototypes(self, atomSpecies, wyckoffs, spg_nr):
try:
norm_wyckoff = structure.get_normalized_wyckoff(atomSpecies, wyckoffs)
protoDict = structure.search_aflow_prototype(spg_nr, norm_wyckoff)
def prototypes(self, atom_species: np.array, wyckoffs: np.array, spg_number: int) -> None:
"""Tries to match the material to an entry in the AFLOW prototype data.
If a match is found, a section_prototype is added to section_system.
if protoDict is None:
proto = "%d-_" % spg_nr
labels = dict(prototype_label=proto)
else:
proto = '%d-%s-%s' % (spg_nr, protoDict.get("Prototype", "-"),
protoDict.get("Pearsons Symbol", "-"))
aflow_prototype_id = protoDict.get("aflow_prototype_id", "-")
aflow_prototype_url = protoDict.get("aflow_prototype_url", "-")
labels = dict(
prototype_label=proto,
prototype_aflow_id=aflow_prototype_id,
prototype_aflow_url=aflow_prototype_url)
except Exception as e:
self.logger.error("cannot create AFLOW prototype", exc_info=e)
return
pSect = self._backend.openSection("section_prototype")
self._backend.addValue(
"prototype_assignement_method", "normalized-wyckoff")
self._backend.addValue("prototype_label", labels['prototype_label'])
aid = labels.get("prototype_aflow_id")
if aid:
self._backend.addValue("prototype_aflow_id", aid)
aurl = labels.get("prototype_aflow_url")
if aurl:
self._backend.addValue("prototype_aflow_url", aurl)
self._backend.closeSection("section_prototype", pSect)
Args:
atomic_numbers: Array of atomic numbers.
wyckoff_letters: Array of Wyckoff letters as strings.
spg_number: Space group number.
"""
norm_wyckoff = structure.get_normalized_wyckoff(atom_species, wyckoffs)
protoDict = structure.search_aflow_prototype(spg_number, norm_wyckoff)
if protoDict is not None:
aflow_prototype_id = protoDict["aflow_prototype_id"]
aflow_prototype_url = protoDict["aflow_prototype_url"]
prototype_label = '%d-%s-%s' % (
spg_number,
protoDict.get("Prototype", "-"),
protoDict.get("Pearsons Symbol", "-")
)
pSect = self._backend.openSection("section_prototype")
self._backend.addValue("prototype_label", prototype_label)
self._backend.addValue("prototype_aflow_id", aflow_prototype_id)
self._backend.addValue("prototype_aflow_url", aflow_prototype_url)
self._backend.addValue("prototype_assignment_method", "normalized-wyckoff")
self._backend.closeSection("section_prototype", pSect)
......@@ -31,4 +31,4 @@ ADD ./registration_form_action/target/form-extension-1.0-SNAPSHOT.jar /opt/jboss
# Additing a bcrypt password hashing algorithm to reuse old repo users
ADD ./jbcrypt-0.4.jar /tmp/jbcrypt-0.4.jar
RUN /opt/jboss/keycloak/bin/jboss-cli.sh --command="module add --name=org.mindrot.jbcrypt --resources=/tmp/jbcrypt-0.4.jar"
ADD ./keycloak-bcrypt-1.1.0.jar /opt/jboss/keycloak/standalone/deployments/keycloak-bcrypt-1.1.0.jar
\ No newline at end of file
ADD ./keycloak-bcrypt-1.1.0.jar /opt/jboss/keycloak/standalone/deployments/keycloak-bcrypt-1.1.0.jar
......@@ -361,41 +361,64 @@ def test_vasp_incar_system():
def test_aflow_prototypes():
"""Tests that some basis structures are matched with the correct AFLOW prototypes
"""
# No prototype info for non-bulk structures
backend = run_normalize_for_structure(ase.build.molecule("H2O"))
assert len(backend["section_prototype"]) == 0
# No prototype info for bulk structure without match
rattled = ase.build.bulk("C", crystalstructure="diamond", a=3.57, cubic=True)
rattled.rattle(stdev=2, seed=42)
rattled.wrap()
backend = run_normalize_for_structure(rattled)
assert len(backend["section_prototype"]) == 0
# Diamond
diamond = ase.build.bulk("C", crystalstructure="diamond", a=3.57)
backend = run_normalize_for_structure(diamond)
prototype_aflow_id = backend.get_value("prototype_aflow_id")
prototype_label = backend.get_value("prototype_label")
assert prototype_aflow_id == "A_cF8_227_a"
assert prototype_label == "227-C-cF8"
# BCC
bcc = ase.build.bulk("Fe", crystalstructure="bcc", a=2.856)
backend = run_normalize_for_structure(bcc)
prototype_aflow_id = backend.get_value("prototype_aflow_id")
prototype_label = backend.get_value("prototype_label")
assert prototype_aflow_id == "A_cI2_229_a"
assert prototype_label == "229-W-cI2"
# FCC
fcc = ase.build.bulk("Ge", crystalstructure="fcc", a=5.658)
backend = run_normalize_for_structure(fcc)
prototype_aflow_id = backend.get_value("prototype_aflow_id")
prototype_label = backend.get_value("prototype_label")
assert prototype_aflow_id == "A_cF4_225_a"
assert prototype_label == "225-Cu-cF4"
# Rocksalt
rocksalt = ase.build.bulk("NaCl", crystalstructure="rocksalt", a=5.64)
backend = run_normalize_for_structure(rocksalt)
prototype_aflow_id = backend.get_value("prototype_aflow_id")
prototype_label = backend.get_value("prototype_label")
assert prototype_aflow_id == "AB_cF8_225_a_b"
assert prototype_label == "225-ClNa-cF8"
# Zincblende
zincblende = ase.build.bulk("ZnS", crystalstructure="zincblende", a=5.42, cubic=True)
backend = run_normalize_for_structure(zincblende)
prototype_aflow_id = backend.get_value("prototype_aflow_id")
prototype_label = backend.get_value("prototype_label")
assert prototype_aflow_id == "AB_cF8_216_c_a"
assert prototype_label == "216-SZn-cF8"
# Wurtzite
wurtzite = ase.build.bulk("SiC", crystalstructure="wurtzite", a=3.086, c=10.053)
backend = run_normalize_for_structure(wurtzite)
prototype_aflow_id = backend.get_value("prototype_aflow_id")
prototype_label = backend.get_value("prototype_label")
assert prototype_aflow_id == "AB_hP4_186_b_b"
assert prototype_label == "186-SZn-hP4"
def test_springer_normalizer():
......
Supports Markdown
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