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

Placed wyckoff set variables inside a subsection.

parent c327b22f
Pipeline #69448 passed with stages
in 14 minutes and 49 seconds
......@@ -177,17 +177,17 @@ mail = NomadConfig(
normalize = NomadConfig(
# The system size limit for running the dimensionality analysis. For very
# large systems the dimensionality analysis will get too expensive.
system_classification_with_clusters_threshold=50,
system_classification_with_clusters_threshold=64,
# Symmetry tolerance controls the precision used by spglib in order to find
# symmetries. The atoms are allowed to move 1/2*symmetry_tolerance from
# their symmetry positions in order for spglib to still detect symmetries.
# The unit is angstroms. The value of 0.1 is used e.g. by Materials Project
# according to
# https://pymatgen.org/pymatgen.symmetry.analyzer.html#pymatgen.symmetry.analyzer.SpacegroupAnalyzer
symmetry_tolerance=0.2,
symmetry_tolerance=0.1,
# The symmetry tolerance used in aflow prototype matching. Should only be
# changed before re-running the prototype detection.
prototype_symmetry_tolerance=0.2,
prototype_symmetry_tolerance=0.1,
# Maximum number of atoms in the single cell of a 2D material for it to be
# considered valid.
max_2d_single_cell_size=7,
......
......@@ -3,18 +3,12 @@ from elasticsearch_dsl import InnerDoc
from nomad.metainfo import MSection, Section, SubSection, Quantity, MEnum, units
class WyckoffSet(MSection):
class WyckoffVariables(MSection):
m_def = Section(
a_flask=dict(skip_none=True),
a_elastic=dict(type=InnerDoc),
description="""
Section for storing Wyckoff set information.
"""
)
wyckoff_letter = Quantity(
type=str,
description="""
The Wyckoff letter for this set.
Contains the variables associated with this set.
"""
)
x = Quantity(
......@@ -35,6 +29,22 @@ class WyckoffSet(MSection):
The z variable if present.
"""
)
class WyckoffSet(MSection):
m_def = Section(
a_flask=dict(skip_none=True),
a_elastic=dict(type=InnerDoc),
description="""
Section for storing Wyckoff set information.
"""
)
wyckoff_letter = Quantity(
type=str,
description="""
The Wyckoff letter for this set.
"""
)
indices = Quantity(
type=np.dtype('i4'),
shape=["1..*"],
......@@ -48,6 +58,7 @@ class WyckoffSet(MSection):
Chemical element at this Wyckoff position.
"""
)
variables = SubSection(sub_section=WyckoffVariables.m_def, repeats=False)
class Material(MSection):
......
......@@ -28,7 +28,7 @@ import matid.geometry
from nomad.normalizing.normalizer import Normalizer, s_scc, s_system, s_method, s_frame_sequence, r_frame_sequence_to_sampling, s_sampling_method, r_frame_sequence_local_frames
from nomad.normalizing.settingsbasisset import SettingsBasisSet
from nomad.metainfo.encyclopedia import Encyclopedia, Material, Method, Properties, RunType, WyckoffSet
from nomad.metainfo.encyclopedia import Encyclopedia, Material, Method, Properties, RunType, WyckoffSet, WyckoffVariables
from nomad.normalizing import structure
from nomad.utils import hash
from nomad import config
......@@ -601,12 +601,14 @@ class MaterialBulkNormalizer(MaterialNormalizer):
def wyckoff_sets(self, material: Material, wyckoff_sets: Dict) -> None:
for group in wyckoff_sets:
wset = material.m_create(WyckoffSet)
if group.x is not None:
wset.x = float(group.x)
if group.y is not None:
wset.y = float(group.y)
if group.z is not None:
wset.z = float(group.z)
if group.x is not None or group.y is not None or group.z is not None:
variables = wset.m_create(WyckoffVariables)
if group.x is not None:
variables.x = float(group.x)
if group.y is not None:
variables.y = float(group.y)
if group.z is not None:
variables.z = float(group.z)
wset.indices = group.indices
wset.element = group.element
wset.wyckoff_letter = group.wyckoff_letter
......
......@@ -232,7 +232,7 @@ def test_2d_material_identification():
for _ in range(10):
graphene4 = graphene.copy()
pos = graphene4.get_positions()
pos += 0.1 * np.random.rand(pos.shape[0], pos.shape[1])
pos += 0.05 * np.random.rand(pos.shape[0], pos.shape[1])
graphene4.set_positions(pos)
backend = run_normalize_for_structure(graphene4)
enc = backend.get_mi2_section(Encyclopedia.m_def)
......@@ -331,7 +331,7 @@ def test_bulk_material_identification():
for _ in range(10):
wurtzite4 = wurtzite.copy()
pos = wurtzite4.get_positions()
pos += 0.1 * np.random.rand(pos.shape[0], pos.shape[1])
pos += 0.05 * np.random.rand(pos.shape[0], pos.shape[1])
wurtzite4.set_positions(pos)
backend = run_normalize_for_structure(wurtzite4)
enc = backend.get_mi2_section(Encyclopedia.m_def)
......
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