Commit 335008d7 authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Merge branch 'v0.10.4' into 'master'

Merge for release

See merge request !357
parents 0bde4980 6919ccf6
Pipeline #103569 passed with stage
in 4 minutes and 55 seconds
......@@ -117,6 +117,12 @@ class User(Author):
from nomad import infrastructure
return infrastructure.keycloak.get_user(*args, **kwargs) # type: ignore
def full_user(self) -> 'User':
''' Returns a User object with all attributes loaded from the user management system. '''
from nomad import infrastructure
assert self.user_id is not None
return infrastructure.keycloak.get_user(user_id=self.user_id) # type: ignore
class UserReference(metainfo.Reference):
'''
......
......@@ -18,8 +18,7 @@
import sys
from nomad.metainfo import Environment
from nomad.metainfo.legacy import LegacyMetainfoEnvironment
import nomad.datamodel.metainfo.common_dft
m_env = LegacyMetainfoEnvironment()
m_env = Environment()
m_env.m_add_sub_section(Environment.packages, sys.modules['nomad.datamodel.metainfo.common_dft'].m_package) # type: ignore
......@@ -9,7 +9,7 @@ from nomad.metainfo.search_extension import Search
m_package = Package(
name='nomad.datamodel.metainfo.public_old',
name='nomad.datamodel.metainfo.public',
description='None',
a_legacy=LegacyDefinition(name='public.nomadmetainfo.json'))
......@@ -1118,8 +1118,8 @@ class BasisSet(MSection):
dependent to the simulated cell as a whole).
Basis sets used in this section_single_configuration_calculation, belonging to either
class, are defined in the dedicated section: [section_basis_set_cell_dependent
](section_basis_set_cell_dependent) or section_basis_set_atom_centered. The
class, are defined in the dedicated section: section_basis_set_cell_dependent or
section_basis_set_atom_centered. The
correspondence between the basis sets listed in this section and the definition given
in the dedicated sessions is given by the two concrete metadata:
mapping_section_basis_set_cell_dependent and mapping_section_basis_set_atom_centered.
......@@ -1961,9 +1961,8 @@ class FrameSequenceUserQuantity(MSection):
Dedicated metadata monitored along a sequence of frames are created for the
conserved energy-like quantity (frame_sequence_conserved_quantity), the kinetic
and potential energies ([frame_sequence_kinetic_energy and
frame_sequence_potential_energy](frame_sequence_kinetic_energy and
frame_sequence_potential_energy)), the instantaneous temperature
and potential energies (frame_sequence_kinetic_energy and
frame_sequence_potential_energy), the instantaneous temperature
(frame_sequence_temperature) and the pressure (frame_sequence_pressure).
''',
categories=[Unused],
......@@ -3821,8 +3820,7 @@ class Run(MSection):
'''
Every section_run represents a single call of a program. What exactly is contained in
a run depends on the run type (see for example section_method and
section_single_configuration_calculation) and the program (see [program_info
](program_info)).
section_single_configuration_calculation) and the program (see ProgramInfo).
'''
m_def = Section(
......@@ -6658,6 +6656,16 @@ class GeometryOptimization(MSection):
categories=[Unused],
a_legacy=LegacyDefinition(name='input_force_maximum_tolerance'))
input_displacement_maximum_tolerance = Quantity(
type=np.dtype(np.float64),
shape=[],
unit='meter',
description='''
The input maximum displacement tolerance criterion.
''',
categories=[Unused],
a_legacy=LegacyDefinition(name='input_displacement_maximum_tolerance'))
final_energy_difference = Quantity(
type=np.dtype(np.float64),
shape=[],
......@@ -6677,6 +6685,15 @@ class GeometryOptimization(MSection):
''',
a_legacy=LegacyDefinition(name='final_force_maximum'))
final_displacement_maximum = Quantity(
type=np.dtype(np.float64),
shape=[],
unit='meter',
description='''
The maximum displacement in the last optimization step with respect to previous.
''',
a_legacy=LegacyDefinition(name='final_displacement_maximum'))
optimization_steps = Quantity(
type=int,
shape=[],
......@@ -6685,6 +6702,14 @@ class GeometryOptimization(MSection):
''',
a_legacy=LegacyDefinition(name='optimization_steps'))
is_converged_geometry = Quantity(
type=bool,
shape=[],
description='''
Indicates if the geometry convergence criteria were fulfilled.
''',
a_legacy=LegacyDefinition(name='is_converged_geometry'))
class Phonon(MSection):
'''
......@@ -7832,7 +7857,7 @@ class Topology(MSection):
description='''
A unique string idenfiying the force field defined in this section. Strategies to
define it are discussed in the
[topology\\_force\\_field\\_name](https://gitlab.mpcdf.mpg.de/nomad-lab/nomad-meta-
[topology_force_field_name](https://gitlab.mpcdf.mpg.de/nomad-lab/nomad-meta-
info/wikis/metainfo/topology-force-field-name).
''',
a_legacy=LegacyDefinition(name='topology_force_field_name'))
......
#
# Copyright The NOMAD Authors.
#
# This file is part of NOMAD. See https://nomad-lab.eu for further info.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
import numpy as np # pylint: disable=unused-import
import typing # pylint: disable=unused-import
from nomad.metainfo import ( # pylint: disable=unused-import
MSection, MCategory, Category, Package, Quantity, Section, SubSection, SectionProxy,
Reference
)
from nomad.metainfo.legacy import LegacyDefinition
from nomad.datamodel.metainfo import public_old as public
m_package = Package(
name='common_nomadmetainfo_json',
description='None',
a_legacy=LegacyDefinition(name='common.nomadmetainfo.json'))
class settings_atom_in_molecule(MCategory):
'''
Parameters of an atom within a molecule.
'''
m_def = Category(
a_legacy=LegacyDefinition(name='settings_atom_in_molecule'))
class settings_constraint(MCategory):
'''
Some parameters that describe a constraint
'''
m_def = Category(
a_legacy=LegacyDefinition(name='settings_constraint'))
class settings_interaction(MCategory):
'''
Some parameters that describe a bonded interaction.
'''
m_def = Category(
a_legacy=LegacyDefinition(name='settings_interaction'))
class soap_parameter(MCategory):
'''
A soap parameter
'''
m_def = Category(
a_legacy=LegacyDefinition(name='soap_parameter'))
class response_context(MSection):
'''
The top level context containing the reponse to an api query, when using jsonAPI they
are tipically in the meta part
'''
m_def = Section(validate=False, a_legacy=LegacyDefinition(name='response_context'))
shortened_meta_info = Quantity(
type=str,
shape=[],
description='''
A meta info whose corresponding data has been shortened
''',
a_legacy=LegacyDefinition(name='shortened_meta_info'))
section_response_message = SubSection(
sub_section=SectionProxy('section_response_message'),
repeats=True,
a_legacy=LegacyDefinition(name='section_response_message'))
class section_atom_type(MSection):
'''
Section describing a type of atom in the system.
'''
m_def = Section(validate=False, a_legacy=LegacyDefinition(name='section_atom_type'))
atom_type_charge = Quantity(
type=np.dtype(np.float64),
shape=[],
unit='coulomb',
description='''
Charge of the atom type.
''',
a_legacy=LegacyDefinition(name='atom_type_charge'))
atom_type_mass = Quantity(
type=np.dtype(np.float64),
shape=[],
unit='kilogram',
description='''
Mass of the atom type.
''',
a_legacy=LegacyDefinition(name='atom_type_mass'))
atom_type_name = Quantity(
type=str,
shape=[],
description='''
Name (label) of the atom type.
''',
a_legacy=LegacyDefinition(name='atom_type_name'))
class section_constraint(MSection):
'''
Section describing a constraint between arbitrary atoms.
'''
m_def = Section(validate=False, a_legacy=LegacyDefinition(name='section_constraint'))
constraint_atoms = Quantity(
type=np.dtype(np.int32),
shape=['number_of_constraints', 'number_of_atoms_per_constraint'],
description='''
List of the indexes involved in this constraint. The fist atom has index 1, the
last number_of_topology_atoms.
''',
a_legacy=LegacyDefinition(name='constraint_atoms'))
constraint_kind = Quantity(
type=str,
shape=[],
description='''
Short and unique name for this constraint type. Valid names are described in the
[constraint\\_kind wiki page](https://gitlab.mpcdf.mpg.de/nomad-lab/nomad-meta-
info/wikis/metainfo/constraint-kind).
''',
a_legacy=LegacyDefinition(name='constraint_kind'))
constraint_parameters = Quantity(
type=typing.Any,
shape=[],
description='''
Explicit constraint parameters for this kind of constraint (depending on the
constraint type, some might be given implicitly through other means).
''',
a_legacy=LegacyDefinition(name='constraint_parameters'))
number_of_atoms_per_constraint = Quantity(
type=int,
shape=[],
description='''
Number of atoms involved in this constraint.
''',
a_legacy=LegacyDefinition(name='number_of_atoms_per_constraint'))
number_of_constraints = Quantity(
type=int,
shape=[],
description='''
Number of constraints of this type.
''',
a_legacy=LegacyDefinition(name='number_of_constraints'))
class section_dft_plus_u_orbital(MSection):
'''
Section for DFT+U-settings of a single orbital
'''
m_def = Section(validate=False, a_legacy=LegacyDefinition(name='section_dft_plus_u_orbital'))
dft_plus_u_orbital_atom = Quantity(
type=np.dtype(np.int32),
shape=[],
description='''
DFT+U-orbital setting: atom index (references index of atom_labels/atom_positions)
''',
a_legacy=LegacyDefinition(name='dft_plus_u_orbital_atom'))
dft_plus_u_orbital_J = Quantity(
type=np.dtype(np.float64),
shape=[],
description='''
DFT+U-orbital setting: value J (exchange interaction)
''',
categories=[public.energy_value],
a_legacy=LegacyDefinition(name='dft_plus_u_orbital_J'))
dft_plus_u_orbital_label = Quantity(
type=str,
shape=[],
description='''
DFT+U-orbital setting: orbital label (normally (n,l)), notation: '3d', '4f', ...
''',
a_legacy=LegacyDefinition(name='dft_plus_u_orbital_label'))
dft_plus_u_orbital_U_effective = Quantity(
type=np.dtype(np.float64),
shape=[],
description='''
DFT+U-orbital setting: value U_{effective} (U-J), if implementation uses it
''',
categories=[public.energy_value],
a_legacy=LegacyDefinition(name='dft_plus_u_orbital_U_effective'))
dft_plus_u_orbital_U = Quantity(
type=np.dtype(np.float64),
shape=[],
description='''
DFT+U-orbital setting: value U (on-site Coulomb interaction)
''',
categories=[public.energy_value],
a_legacy=LegacyDefinition(name='dft_plus_u_orbital_U'))
class section_excited_states(MSection):
'''
Excited states properties.
'''
m_def = Section(validate=False, a_legacy=LegacyDefinition(name='section_excited_states'))
excitation_energies = Quantity(
type=np.dtype(np.float64),
shape=['number_of_excited_states'],
description='''
Excitation energies.
''',
categories=[public.energy_value],
a_legacy=LegacyDefinition(name='excitation_energies'))
number_of_excited_states = Quantity(
type=int,
shape=[],
description='''
Number of excited states.
''',
a_legacy=LegacyDefinition(name='number_of_excited_states'))
oscillator_strengths = Quantity(
type=np.dtype(np.float64),
shape=['number_of_excited_states'],
description='''
Excited states oscillator strengths.
''',
a_legacy=LegacyDefinition(name='oscillator_strengths'))
transition_dipole_moments = Quantity(
type=np.dtype(np.float64),
shape=['number_of_excited_states', 3],
description='''
Transition dipole moments.
''',
a_legacy=LegacyDefinition(name='transition_dipole_moments'))
class section_interaction(MSection):
'''
Section containing the description of a bonded interaction between arbitrary atoms.
'''
m_def = Section(validate=False, a_legacy=LegacyDefinition(name='section_interaction'))
interaction_atoms = Quantity(
type=np.dtype(np.int32),
shape=['number_of_interactions', 'number_of_atoms_per_interaction'],
description='''
List of the indexes involved in this interaction. The fist atom has index 1, the
last atom index number_of_topology_atoms.
''',
a_legacy=LegacyDefinition(name='interaction_atoms'))
interaction_kind = Quantity(
type=str,
shape=[],
description='''
Short and unique name for this interaction type. Valid names are described in the
[interaction\\_kind wiki page](https://gitlab.mpcdf.mpg.de/nomad-lab/nomad-meta-
info/wikis/metainfo/interaction-kind).
''',
a_legacy=LegacyDefinition(name='interaction_kind'))
interaction_parameters = Quantity(
type=typing.Any,
shape=[],
description='''
Explicit interaction parameters for this kind of interaction (depending on the
interaction_kind some might be given implicitly through other means).
''',
a_legacy=LegacyDefinition(name='interaction_parameters'))
number_of_atoms_per_interaction = Quantity(
type=int,
shape=[],
description='''
Number of atoms involved in this interaction.
''',
a_legacy=LegacyDefinition(name='number_of_atoms_per_interaction'))
number_of_interactions = Quantity(
type=int,
shape=[],
description='''
Number of interactions of this type.
''',
a_legacy=LegacyDefinition(name='number_of_interactions'))
class section_method_basis_set(MSection):
'''
This section contains the definition of the basis sets that are defined independently
of the atomic configuration.
'''
m_def = Section(validate=False, a_legacy=LegacyDefinition(name='section_method_basis_set'))
mapping_section_method_basis_set_atom_centered = Quantity(
type=np.dtype(np.int64),
shape=['number_of_basis_sets_atom_centered', 2],
description='''
Reference to an atom-centered basis set defined in section_basis_set_atom_centered
and to the atom kind as defined in section_method_atom_kind.
''',
a_legacy=LegacyDefinition(name='mapping_section_method_basis_set_atom_centered'))
mapping_section_method_basis_set_cell_associated = Quantity(
type=public.section_basis_set_cell_dependent,
shape=[],
description='''
Reference to a cell-associated basis set.
''',
a_legacy=LegacyDefinition(name='mapping_section_method_basis_set_cell_associated'))
method_basis_set_kind = Quantity(
type=str,
shape=[],
description='''
String describing the use of the basis set, i.e, if it used for expanding a
wavefunction or an electron density. Allowed values are listed in the
[basis\\_set\\_kind wiki page](https://gitlab.mpcdf.mpg.de/nomad-lab/nomad-meta-
info/wikis/metainfo/basis-set-kind).
''',
a_legacy=LegacyDefinition(name='method_basis_set_kind'))
number_of_basis_sets_atom_centered = Quantity(
type=int,
shape=[],
description='''
String describing the use of the basis set, i.e, if it used for expanding a
wavefunction or an electron density. Allowed values are listed in the
[basis\\_set\\_kind wiki page](https://gitlab.mpcdf.mpg.de/nomad-lab/nomad-meta-
info/wikis/metainfo/basis-set-kind).
''',
a_legacy=LegacyDefinition(name='number_of_basis_sets_atom_centered'))
class section_molecule_constraint(MSection):
'''
Section describing a constraint between atoms within a molecule.
'''
m_def = Section(validate=False, a_legacy=LegacyDefinition(name='section_molecule_constraint'))
molecule_constraint_atoms = Quantity(
type=np.dtype(np.int32),
shape=['number_of_molecule_constraints', 'number_of_atoms_per_molecule_constraint'],
description='''
List of the indexes involved in this constraint. The fist atom has index 1, the
last index is number_of_atoms_in_molecule.
''',
a_legacy=LegacyDefinition(name='molecule_constraint_atoms'))
molecule_constraint_kind = Quantity(
type=str,
shape=[],
description='''
Short and unique name for this constraint type. Valid names are described in the
[constraint\\_kind wiki page](https://gitlab.mpcdf.mpg.de/nomad-lab/nomad-meta-
info/wikis/metainfo/constraint-kind).
''',
a_legacy=LegacyDefinition(name='molecule_constraint_kind'))
molecule_constraint_parameters = Quantity(
type=typing.Any,
shape=[],
description='''
Explicit constraint parameters for this kind of constraint (depending on the
constraint type some might be given implicitly through other means).
''',
a_legacy=LegacyDefinition(name='molecule_constraint_parameters'))
number_of_atoms_per_molecule_constraint = Quantity(
type=int,
shape=[],
description='''
Number of atoms, in this molecule, involved in this constraint.
''',
a_legacy=LegacyDefinition(name='number_of_atoms_per_molecule_constraint'))
number_of_molecule_constraints = Quantity(
type=int,
shape=[],
description='''
Number of constraints of this type.
''',
a_legacy=LegacyDefinition(name='number_of_molecule_constraints'))
class section_molecule_interaction(MSection):
'''
Section describing a bonded interaction between atoms within a molecule.
'''
m_def = Section(validate=False, a_legacy=LegacyDefinition(name='section_molecule_interaction'))
molecule_interaction_atoms = Quantity(
type=np.dtype(np.int32),
shape=['number_of_molecule_interactions', 'number_of_atoms_per_molecule_interaction'],
description='''
List of the indexes involved in this bonded interaction within a molecule. The
first atom has index 1, the last index is number_of_atoms_in_.
''',
a_legacy=LegacyDefinition(name='molecule_interaction_atoms'))
molecule_interaction_kind = Quantity(
type=str,
shape=[],
description='''
Short and unique name for this interaction type, used for bonded interactions for
atoms in a molecule. Valid names are described in the [interaction\\_kind wiki
page](https://gitlab.mpcdf.mpg.de/nomad-lab/nomad-meta-
info/wikis/metainfo/interaction-kind).
''',
a_legacy=LegacyDefinition(name='molecule_interaction_kind'))
molecule_interaction_parameters = Quantity(
type=typing.Any,
shape=[],
description='''
Explicit interaction parameters for this kind of interaction (depending on the
interaction type some might be given implicitly through other means), used for
bonded interactions for atoms in a molecule.
''',
a_legacy=LegacyDefinition(name='molecule_interaction_parameters'))
number_of_atoms_per_molecule_interaction = Quantity(
type=int,
shape=[],
description='''
Number of atoms, in this molecule, involved in this interaction.
''',
a_legacy=LegacyDefinition(name='number_of_atoms_per_molecule_interaction'))
number_of_molecule_interactions = Quantity(
type=int,
shape=[],
description='''
Number of bonded interactions of this type.
''',
a_legacy=LegacyDefinition(name='number_of_molecule_interactions'))
class section_molecule_type(MSection):
'''
Section describing a type of molecule in the system.
'''
m_def = Section(validate=False, a_legacy=LegacyDefinition(name='section_molecule_type'))
atom_in_molecule_charge = Quantity(
type=np.dtype(np.float64),
shape=['number_of_atoms_in_molecule'],
unit='coulomb',
description='''
Charge of each atom in the molecule.