From 02e110d4221fc80144c89cce73918db8f7c65274 Mon Sep 17 00:00:00 2001 From: Theodore Chang Date: Fri, 12 Apr 2024 04:34:54 +0200 Subject: [PATCH] Label --- runschema/calculation.py | 11 ++++++----- runschema/method.py | 10 ++++++---- runschema/system.py | 3 ++- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/runschema/calculation.py b/runschema/calculation.py index 414556a..67251d8 100644 --- a/runschema/calculation.py +++ b/runschema/calculation.py @@ -37,6 +37,7 @@ MEnum, HDF5Reference, ) +from nomad.metainfo.data_type import m_int32, m_float64 from .method import Method, HoppingMatrix from .system import System, AtomsGroup @@ -161,7 +162,7 @@ class AtomicValues(ArchiveSection): ) atom_index = Quantity( - type=np.dtype(np.int32), + type=m_int32().no_type_check(), shape=[], description=""" Index of the atomic species corresponding to the atomic quantity. @@ -617,7 +618,7 @@ class Energy(MSection): ) highest_occupied = Quantity( - type=np.dtype(np.float64), + type=m_float64(dtype=np.float64).no_type_check(), unit='joule', shape=[], description=""" @@ -1017,7 +1018,7 @@ class BandEnergies(MSection): ) occupations = Quantity( - type=np.dtype(np.float64), + type=m_float64(dtype=np.float64).no_shape_check(), shape=['n_spin_channels', 'n_kpoints', 'n_bands'], description=""" Values of the occupations of the bands. @@ -1412,7 +1413,7 @@ class MultipolesEntry(Atomic): ) value = Quantity( - type=np.dtype(np.float64), + type=m_float64(dtype=np.float64).no_shape_check(), shape=['n_atoms', 'n_multipoles'], description=""" Value of the multipoles projected unto the atoms. @@ -1420,7 +1421,7 @@ class MultipolesEntry(Atomic): ) total = Quantity( - type=np.dtype(np.float64), + type=m_float64(dtype=np.float64).no_shape_check(), shape=['n_multipoles'], description=""" Total value of the multipoles. diff --git a/runschema/method.py b/runschema/method.py index d036716..d927dea 100644 --- a/runschema/method.py +++ b/runschema/method.py @@ -33,6 +33,7 @@ Reference, MEnum, ) +from nomad.metainfo.data_type import m_complex128, m_str from nomad.quantum_states import RussellSaundersState m_package = Package() @@ -88,7 +89,8 @@ class Mesh(MSection): 'Logarithmic', 'Tan', 'Gauss-Legendre', - 'Gauss-Laguerre' 'Clenshaw-Curtis', + 'Gauss-Laguerre', + 'Clenshaw-Curtis', 'Newton-Cotes', 'Gauss-Hermite', ), @@ -141,7 +143,7 @@ class Mesh(MSection): ) points = Quantity( - type=np.complex128, + type=m_complex128(dtype=np.complex128).no_shape_check(), shape=['*', 'dimensionality'], description=""" List of all the points in the mesh. @@ -1140,7 +1142,7 @@ class OrbitalAPW(MSection): energy_parameter = Quantity( type=np.float64, - shape=['*'], + shape=[], unit='joule', description=""" Reference energy parameter for the augmented plane wave (APW) basis set. @@ -1472,7 +1474,7 @@ class Interaction(MSection): ) atom_labels = Quantity( - type=np.dtype(str), + type=m_str().no_shape_check(), shape=['n_interactions', 'n_atoms'], description=""" Labels of the atoms described by the interaction. Can be a list of lists for interaction groupings. diff --git a/runschema/system.py b/runschema/system.py index 5e0b711..adb63a7 100644 --- a/runschema/system.py +++ b/runschema/system.py @@ -31,6 +31,7 @@ SectionProxy, Reference, ) +from nomad.metainfo.data_type import m_str from nomad.units import ureg m_package = Package() @@ -775,7 +776,7 @@ class System(ArchiveSection): atoms_group = SubSection(sub_section=AtomsGroup.m_def, repeats=True) chemical_composition = Quantity( - type=str, + type=m_str().no_type_check(), shape=[], description=""" The full chemical composition of the system, based on atom species.