Commit ee66ea18 authored by Lauri Himanen's avatar Lauri Himanen
Browse files

Fixed hash overlap issue, fixed inconsistency in representative calculation...

Fixed hash overlap issue, fixed inconsistency in representative calculation selection, updated enc gui image to latest version.
parent 7f7ecf4f
Pipeline #78616 failed with stages
in 24 minutes and 1 second
Subproject commit 7c273bcf8d8f86604e430abdbe30e93daa29d4d4
Subproject commit 1f6cce2588f049e791983739624d9a56e18b16d0
......@@ -830,7 +830,9 @@ class EncCalculationsResource(Resource):
def calc_score(entry):
"""Custom scoring function used to sort results by their
"quality". Currently built to mimic the scoring that was used
in the old Encyclopedia GUI.
in the old Encyclopedia GUI. Primarily sorts by quality measure,
ties are broken by alphabetic sorting of entry_id in order to
return consistent results.
"""
score = 0
functional_score = {
......@@ -850,7 +852,7 @@ class EncCalculationsResource(Resource):
if has_dos and has_bs:
score += 10
return score
return (score, entry["calc_id"])
# The calculations are first sorted by "quality"
sorted_calc = sorted(response, key=lambda x: calc_score(x), reverse=True)
......
......@@ -422,6 +422,14 @@ class MaterialBulkNormalizer(MaterialNormalizer):
class Material2DNormalizer(MaterialNormalizer):
"""Processes structure related metainfo for Encyclopedia 2D structures.
"""
def material_id(self, material: Material, spg_number: int, wyckoff_sets: List[WyckoffSet]) -> None:
# The hash is based on the symmetry analysis of the structure when it
# is treated as a 3D structure. Due to this the hash may overlap with
# real 3D structures unless we include a distinguishing label for 2D
# structures in the hash seed.
norm_hash_string = "2D " + atomutils.get_symmetry_string(spg_number, wyckoff_sets)
material.material_id = hash(norm_hash_string)
def lattice_vectors(self, ideal: IdealizedStructure, std_atoms: Atoms) -> None:
cell_normalized = std_atoms.get_cell()
cell_normalized *= 1e-10
......
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