From 7e2734de71cef61f6511955245606abdce6b78ad Mon Sep 17 00:00:00 2001 From: ladinesa <67910858+ladinesa@users.noreply.github.com> Date: Thu, 16 May 2024 14:58:46 +0200 Subject: [PATCH] Fix quantity types (#106) * Fix amber * Fix asap * Fix bopfox * Fix dftbplus * Fix dlpoly * Fix gromos * Fix gulp * Fix h5md * Fix libatoms * Fix namd * Fix tinker * Fix xtb * Fix gromacs * Fix lammps * More fixes * Linting fix * debugging * resolved indexing issues * removed prints * fix for inhomogeneous labels --------- Co-authored-by: jrudz Co-authored-by: Joseph Rudzinski --- atomisticparsers/amber/metainfo/amber.py | 350 ++-- atomisticparsers/asap/metainfo/asap.py | 45 +- atomisticparsers/asap/parser.py | 7 +- atomisticparsers/bopfox/metainfo/bopfox.py | 131 +- atomisticparsers/bopfox/parser.py | 6 +- .../dftbplus/metainfo/dftbplus.py | 133 +- atomisticparsers/dlpoly/metainfo/dl_poly.py | 243 +-- atomisticparsers/dlpoly/parser.py | 35 +- atomisticparsers/gromacs/metainfo/gromacs.py | 1633 ++++++++++------- atomisticparsers/gromacs/parser.py | 16 +- atomisticparsers/gromos/metainfo/gromos.py | 1301 +++++++------ atomisticparsers/gulp/metainfo/gulp.py | 988 +++++----- atomisticparsers/gulp/parser.py | 2 +- atomisticparsers/h5md/metainfo/h5md.py | 4 +- atomisticparsers/h5md/parser.py | 52 +- atomisticparsers/lammps/metainfo/lammps.py | 886 +++++---- atomisticparsers/lammps/parser.py | 17 +- .../libatoms/metainfo/lib_atoms.py | 181 +- atomisticparsers/namd/metainfo/namd.py | 1070 ++++++----- atomisticparsers/tinker/metainfo/tinker.py | 922 ++++++---- atomisticparsers/tinker/parser.py | 2 + atomisticparsers/utils/mdanalysis.py | 18 +- atomisticparsers/utils/parsers.py | 74 +- atomisticparsers/xtb/metainfo/xtb.py | 200 +- tests/test_gromacsparser.py | 7 +- tests/test_gulpparser.py | 120 +- tests/test_lammpsparser.py | 231 ++- 27 files changed, 5106 insertions(+), 3568 deletions(-) diff --git a/atomisticparsers/amber/metainfo/amber.py b/atomisticparsers/amber/metainfo/amber.py index 7a7acf1e..230a5f70 100644 --- a/atomisticparsers/amber/metainfo/amber.py +++ b/atomisticparsers/amber/metainfo/amber.py @@ -16,11 +16,18 @@ # 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 +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 + MSection, + MCategory, + Category, + Package, + Quantity, + Section, + SubSection, + SectionProxy, + Reference, ) import runschema.run # pylint: disable=unused-import import runschema.calculation # pylint: disable=unused-import @@ -33,411 +40,456 @@ class x_amber_mdin_method(MCategory): - ''' + """ Parameters of mdin belonging to section method. - ''' + """ m_def = Category() class x_amber_mdout_single_configuration_calculation(MCategory): - ''' + """ Parameters of mdout belonging to section_single_configuration_calculation. - ''' + """ m_def = Category() class x_amber_mdout_method(MCategory): - ''' + """ Parameters of mdin belonging to section method. - ''' + """ m_def = Category() class x_amber_mdout_run(MCategory): - ''' + """ Parameters of mdin belonging to settings run. - ''' + """ m_def = Category() class x_amber_mdin_run(MCategory): - ''' + """ Parameters of mdin belonging to settings run. - ''' + """ m_def = Category() class x_amber_section_input_output_files(MSection): - ''' + """ Temperory variable to store input and output file keywords - ''' + """ m_def = Section(validate=False) class x_amber_section_single_configuration_calculation(MSection): - ''' + """ section for gathering values for MD steps - ''' + """ m_def = Section(validate=False) class System(runschema.system.System): - m_def = Section(validate=False, extends_base_section=True) x_amber_atom_positions_image_index = Quantity( - type=np.dtype(np.int32), - shape=['number_of_atoms', 3], - unit='dimensionless', - description=''' + type=np.int32, + shape=["number_of_atoms", 3], + unit="dimensionless", + description=""" PBC image flag index. - ''') + """, + ) x_amber_atom_positions_scaled = Quantity( - type=np.dtype(np.float64), - shape=['number_of_atoms', 3], - unit='dimensionless', - description=''' + type=np.float64, + shape=["number_of_atoms", 3], + unit="dimensionless", + description=""" Position of the atoms in a scaled format [0, 1]. - ''') + """, + ) x_amber_atom_positions_wrapped = Quantity( - type=np.dtype(np.float64), - shape=['number_of_atoms', 3], - unit='meter', - description=''' + type=np.float64, + shape=["number_of_atoms", 3], + unit="meter", + description=""" Position of the atoms wrapped back to the periodic box. - ''') + """, + ) x_amber_dummy = Quantity( type=str, shape=[], - description=''' + description=""" dummy - ''') + """, + ) x_amber_mdin_finline = Quantity( type=str, shape=[], - description=''' + description=""" finline in mdin - ''') + """, + ) x_amber_traj_timestep_store = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_amber_traj_number_of_atoms_store = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_amber_traj_box_bound_store = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_amber_traj_box_bounds_store = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_amber_traj_variables_store = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_amber_traj_atoms_store = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) class MolecularDynamics(simulationworkflowschema.MolecularDynamics): - m_def = Section(validate=False, extends_base_section=True) x_amber_barostat_target_pressure = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='pascal', - description=''' + unit="pascal", + description=""" MD barostat target pressure. - ''') + """, + ) x_amber_barostat_tau = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='second', - description=''' + unit="second", + description=""" MD barostat relaxation time. - ''') + """, + ) x_amber_barostat_type = Quantity( type=str, shape=[], - description=''' + description=""" MD barostat type, valid values are defined in the barostat_type wiki page. - ''') + """, + ) x_amber_integrator_dt = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='second', - description=''' + unit="second", + description=""" MD integration time step. - ''') + """, + ) x_amber_integrator_type = Quantity( type=str, shape=[], - description=''' + description=""" MD integrator type, valid values are defined in the integrator_type wiki page. - ''') + """, + ) x_amber_periodicity_type = Quantity( type=str, shape=[], - description=''' + description=""" Periodic boundary condition type in the sampling (non-PBC or PBC). - ''') + """, + ) x_amber_langevin_gamma = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='second', - description=''' + unit="second", + description=""" Langevin thermostat damping factor. - ''') + """, + ) x_amber_number_of_steps_requested = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" Number of requested MD integration time steps. - ''') + """, + ) x_amber_thermostat_level = Quantity( type=str, shape=[], - description=''' + description=""" MD thermostat level (see wiki: single, multiple, regional). - ''') + """, + ) x_amber_thermostat_target_temperature = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='kelvin', - description=''' + unit="kelvin", + description=""" MD thermostat target temperature. - ''') + """, + ) x_amber_thermostat_tau = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='second', - description=''' + unit="second", + description=""" MD thermostat relaxation time. - ''') + """, + ) x_amber_thermostat_type = Quantity( type=str, shape=[], - description=''' + description=""" MD thermostat type, valid values are defined in the thermostat_type wiki page. - ''') + """, + ) class AtomParameters(runschema.method.AtomParameters): - m_def = Section(validate=False, extends_base_section=True) x_amber_atom_type_element = Quantity( type=str, shape=[], - description=''' + description=""" Element symbol of an atom type. - ''') + """, + ) x_amber_atom_type_radius = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" van der Waals radius of an atom type. - ''') + """, + ) class Interaction(runschema.method.Interaction): - m_def = Section(validate=False, extends_base_section=True) x_amber_interaction_atom_to_atom_type_ref = Quantity( type=runschema.method.AtomParameters, - shape=['number_of_atoms_per_interaction'], - description=''' + shape=["number_of_atoms_per_interaction"], + description=""" Reference to the atom type of each interaction atoms. - ''') + """, + ) x_amber_number_of_defined_pair_interactions = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' + description=""" Number of defined pair interactions (L-J pairs). - ''') + """, + ) x_amber_pair_interaction_atom_type_ref = Quantity( type=runschema.method.AtomParameters, - shape=['x_amber_number_of_defined_pair_interactions', 'number_of_atoms_per_interaction'], - description=''' + shape=[ + "x_amber_number_of_defined_pair_interactions", + "number_of_atoms_per_interaction", + ], + description=""" Reference to the atom type for pair interactions. - ''') + """, + ) x_amber_pair_interaction_parameters = Quantity( - type=np.dtype(np.float64), - shape=['x_amber_number_of_defined_pair_interactions', 2], - description=''' + type=np.float64, + shape=["x_amber_number_of_defined_pair_interactions", 2], + description=""" Pair interactions parameters. - ''') + """, + ) x_amber_molecule_interaction_atom_to_atom_type_ref = Quantity( type=runschema.method.AtomParameters, - shape=['number_of_atoms_per_interaction'], - description=''' + shape=["number_of_atoms_per_interaction"], + description=""" Reference to the atom type of each molecule interaction atoms. - ''') + """, + ) x_amber_number_of_defined_molecule_pair_interactions = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' + description=""" Number of defined pair interactions within a molecule (L-J pairs). - ''') + """, + ) x_amber_pair_molecule_interaction_parameters = Quantity( - type=np.dtype(np.float64), - shape=['number_of_defined_molecule_pair_interactions', 2], - description=''' + type=np.float64, + shape=["number_of_defined_molecule_pair_interactions", 2], + description=""" Molecule pair interactions parameters. - ''') + """, + ) x_amber_pair_molecule_interaction_to_atom_type_ref = Quantity( type=runschema.method.AtomParameters, - shape=['x_amber_number_of_defined_pair_interactions', 'number_of_atoms_per_interaction'], - description=''' + shape=[ + "x_amber_number_of_defined_pair_interactions", + "number_of_atoms_per_interaction", + ], + description=""" Reference to the atom type for pair interactions within a molecule. - ''') + """, + ) class Run(runschema.run.Run): - m_def = Section(validate=False, extends_base_section=True) x_amber_program_version_date = Quantity( type=str, shape=[], - description=''' + description=""" Program version date. - ''') + """, + ) x_amber_xlo_xhi = Quantity( type=str, shape=[], - description=''' + description=""" test - ''') + """, + ) x_amber_data_file_store = Quantity( type=str, shape=[], - description=''' + description=""" Filename of data file - ''') + """, + ) x_amber_program_working_path = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_amber_program_execution_host = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_amber_program_execution_path = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_amber_program_module = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_amber_program_execution_date = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_amber_program_execution_time = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_amber_mdin_header = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_amber_mdin_wt = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_amber_section_input_output_files = SubSection( - sub_section=SectionProxy('x_amber_section_input_output_files'), - repeats=False) + sub_section=SectionProxy("x_amber_section_input_output_files"), repeats=False + ) class Calculation(runschema.calculation.Calculation): - m_def = Section(validate=False, extends_base_section=True) x_amber_section_single_configuration_calculation = SubSection( - sub_section=SectionProxy('x_amber_section_single_configuration_calculation'), - repeats=True) + sub_section=SectionProxy("x_amber_section_single_configuration_calculation"), + repeats=True, + ) diff --git a/atomisticparsers/asap/metainfo/asap.py b/atomisticparsers/asap/metainfo/asap.py index dbe3369f..d6468be0 100644 --- a/atomisticparsers/asap/metainfo/asap.py +++ b/atomisticparsers/asap/metainfo/asap.py @@ -16,11 +16,18 @@ # 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 +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 + MSection, + MCategory, + Category, + Package, + Quantity, + Section, + SubSection, + SectionProxy, + Reference, ) import simulationworkflowschema @@ -29,38 +36,40 @@ class MolecularDynamics(simulationworkflowschema.MolecularDynamics): - m_def = Section(validate=False, extends_base_section=True) x_asap_langevin_friction = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" Friction coeffient used in Langevin dynamics - ''') + """, + ) x_asap_temperature = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" Temperature used in molecular-dynamics - ''') + """, + ) x_asap_timestep = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" Timestep in molecular dynamics - ''') + """, + ) class GeometryOptimization(simulationworkflowschema.GeometryOptimization): - m_def = Section(validate=False, extends_base_section=True) x_asap_maxstep = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" Maxstep in Angstrom for geometry optimization - ''') + """, + ) diff --git a/atomisticparsers/asap/parser.py b/atomisticparsers/asap/parser.py index 8913c8c7..3a59a1ef 100644 --- a/atomisticparsers/asap/parser.py +++ b/atomisticparsers/asap/parser.py @@ -154,9 +154,14 @@ def index(): for constraint in traj.constraints: as_dict = constraint.todict() indices = as_dict["kwargs"].get("a", as_dict["kwargs"].get("indices")) + indices = ( + indices + if isinstance(indices, (np.ndarray, list)) + else [int(indices)] + ) constraints.append( dict( - atom_indices=np.asarray(indices), + atom_indices=[np.asarray(indices)], kind=get_constraint_name(as_dict), ) ) diff --git a/atomisticparsers/bopfox/metainfo/bopfox.py b/atomisticparsers/bopfox/metainfo/bopfox.py index 089cc201..368e78c8 100644 --- a/atomisticparsers/bopfox/metainfo/bopfox.py +++ b/atomisticparsers/bopfox/metainfo/bopfox.py @@ -16,11 +16,19 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import numpy as np # pylint: disable=unused-import +import numpy as np # pylint: disable=unused-import from nomad.metainfo import ( # pylint: disable=unused-import - MSection, MCategory, Category, Package, Quantity, Section, SubSection, SectionProxy, - Reference, JSON + MSection, + MCategory, + Category, + Package, + Quantity, + Section, + SubSection, + SectionProxy, + Reference, + JSON, ) import runschema.run # pylint: disable=unused-import import runschema.calculation # pylint: disable=unused-import @@ -32,173 +40,186 @@ class Method(runschema.calculation.Method): - m_def = Section(validate=False, extends_base_section=True) x_bopfox_simulation_parameters = Quantity( type=JSON, shape=[], - description=''' - ''') + description=""" + """, + ) class Energy(runschema.calculation.Energy): - m_def = Section(validate=False, extends_base_section=True) x_bopfox_bond = SubSection( sub_section=runschema.calculation.EnergyEntry.m_def, - description=''' + description=""" Contains the value and information regarding the bond energy. - ''') + """, + ) x_bopfox_prom = SubSection( sub_section=runschema.calculation.EnergyEntry.m_def, - description=''' + description=""" Contains the value and information regarding the promotion energy. - ''') + """, + ) x_bopfox_rep1 = SubSection( sub_section=runschema.calculation.EnergyEntry.m_def, - description=''' + description=""" Contains the value and information regarding the first repulsion energy. - ''') + """, + ) x_bopfox_rep2 = SubSection( sub_section=runschema.calculation.EnergyEntry.m_def, - description=''' + description=""" Contains the value and information regarding the second repulsion energy. - ''') + """, + ) x_bopfox_rep3 = SubSection( sub_section=runschema.calculation.EnergyEntry.m_def, - description=''' + description=""" Contains the value and information regarding the third repulsion energy. - ''') + """, + ) class Forces(runschema.calculation.Forces): - m_def = Section(validate=False, extends_base_section=True) x_bopfox_analytic = SubSection( sub_section=runschema.calculation.ForcesEntry.m_def, - description=''' + description=""" Contains the value and information regarding the analytic forces. - ''') + """, + ) x_bopfox_rep1 = SubSection( sub_section=runschema.calculation.ForcesEntry.m_def, - description=''' + description=""" Contains the value and information regarding the first analytic forces. - ''') + """, + ) x_bopfox_rep2 = SubSection( sub_section=runschema.calculation.ForcesEntry.m_def, - description=''' + description=""" Contains the value and information regarding the second analytic forces. - ''') + """, + ) x_bopfox_rep3 = SubSection( sub_section=runschema.calculation.ForcesEntry.m_def, - description=''' + description=""" Contains the value and information regarding the third analytic forces. - ''') + """, + ) class x_bopfox_onsite_levels_value(runschema.calculation.AtomicValues): - m_def = Section(validate=False) value = Quantity( type=np.dtype(np.float64), shape=[], - description=''' + description=""" Value of the onsite level projected on orbital and spin channel. - ''') + """, + ) class x_bopfox_onsite_levels(runschema.calculation.Atomic): - m_def = Section(validate=False) - orbital_projected = SubSection(sub_section=x_bopfox_onsite_levels_value.m_def, repeats=True) + orbital_projected = SubSection( + sub_section=x_bopfox_onsite_levels_value.m_def, repeats=True + ) class Calculation(runschema.calculation.Calculation): - m_def = Section(validate=False, extends_base_section=True) - x_bopfox_onsite_levels = SubSection(sub_section=x_bopfox_onsite_levels.m_def, repeats=True) + x_bopfox_onsite_levels = SubSection( + sub_section=x_bopfox_onsite_levels.m_def, repeats=True + ) class Interaction(runschema.method.Interaction): - m_def = Section(validate=False, extends_base_section=True) x_bopfox_valence = Quantity( type=str, - shape=['n_atoms'], - description=''' + shape=["n_atoms"], + description=""" Valence of the atoms described by the interaction. - ''') + """, + ) x_bopfox_chargetransfer = Quantity( type=np.dtype(np.float64), - shape=[], - description=''' + shape=["*"], + description=""" Charge transfer parameters. - ''') + """, + ) x_bopfox_cutoff = Quantity( type=np.dtype(np.float64), shape=[], - description=''' + description=""" Cutoff distance for the interaction. - ''') + """, + ) x_bopfox_dcutoff = Quantity( type=np.dtype(np.float64), shape=[], - description=''' + description=""" Distance from cutoff where the cutoff function is applied. - ''') + """, + ) class Model(runschema.method.Model): - m_def = Section(validate=False, extends_base_section=True) x_bopfox_parameters = Quantity( type=JSON, shape=[], - description=''' - ''') + description=""" + """, + ) class xTB(runschema.method.xTB): - m_def = Section(validate=False, extends_base_section=True) x_bopfox_parameters = Quantity( type=JSON, shape=[], - description=''' - ''') + description=""" + """, + ) class AtomParameters(runschema.method.AtomParameters): - m_def = Section(validate=False, extends_base_section=True) x_bopfox_valenceorbitals = Quantity( type=np.dtype(np.int32), shape=[], - description=''' - ''') + description=""" + """, + ) x_bopfox_stonerintegral = Quantity( type=np.dtype(np.float64), shape=[3], - description=''' - ''') + description=""" + """, + ) diff --git a/atomisticparsers/bopfox/parser.py b/atomisticparsers/bopfox/parser.py index f022b7ed..238876f1 100644 --- a/atomisticparsers/bopfox/parser.py +++ b/atomisticparsers/bopfox/parser.py @@ -469,7 +469,7 @@ def write_to_archive(self) -> None: name=key, functional_form=val[0], parameters=val[1:], - atom_labels=bond.get("bond"), + atom_labels=[bond.get("bond")], x_bopfox_valence=bond.get("valence"), x_bopfox_cutoff=bond.get("rcut"), x_bopfox_dcutoff=bond.get("dcut"), @@ -496,7 +496,7 @@ def write_to_archive(self) -> None: name=key, functional_form=val[0], parameters=val[1:], - atom_labels=bond.get("bond"), + atom_labels=[bond.get("bond")], x_bopfox_cutoff=bond.get("r2cut"), x_bopfox_dcutoff=bond.get("d2cut"), ) @@ -508,7 +508,7 @@ def write_to_archive(self) -> None: name=key, functional_form=val[0], parameters=val[1:], - atom_labels=bond.get("bond"), + atom_labels=[bond.get("bond")], x_bopfox_cutoff=bond.get("r2cut"), x_bopfox_dcutoff=bond.get("d2cut"), ) diff --git a/atomisticparsers/dftbplus/metainfo/dftbplus.py b/atomisticparsers/dftbplus/metainfo/dftbplus.py index 40453bb2..3a5ea533 100644 --- a/atomisticparsers/dftbplus/metainfo/dftbplus.py +++ b/atomisticparsers/dftbplus/metainfo/dftbplus.py @@ -16,10 +16,14 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import numpy as np # pylint: disable=unused-import +import numpy as np # pylint: disable=unused-import from nomad.metainfo import ( # pylint: disable=unused-import - Package, Quantity, Section, SubSection, JSON + Package, + Quantity, + Section, + SubSection, + JSON, ) import runschema.run # pylint: disable=unused-import import runschema.calculation # pylint: disable=unused-import @@ -31,111 +35,118 @@ class AtomParameters(runschema.method.AtomParameters): - m_def = Section(validate=False, extends_base_section=True) atom = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' + description=""" - - ''') + """, + ) x_dftbp_charge = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" - - ''') + """, + ) class System(runschema.system.System): - m_def = Section(validate=False, extends_base_section=True) x_dftbp_atom_positions_X = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" - - ''') + """, + ) x_dftbp_atom_positions_Y = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" - - ''') + """, + ) x_dftbp_atom_positions_Z = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" - - ''') + """, + ) class BandEnergies(runschema.calculation.BandEnergies): - m_def = Section(validate=False, extends_base_section=True) x_dftbp_eigenvalues_values = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" - - ''') + """, + ) x_dftbp_eigenvalues_occupation = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" - - ''') + """, + ) class Calculation(runschema.calculation.Calculation): - m_def = Section(validate=False, extends_base_section=True) x_dftbp_atom_forces_X = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" - - ''') + """, + ) x_dftbp_atom_forces_Y = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" - - ''') + """, + ) x_dftbp_atom_forces_Z = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" - - ''') + """, + ) x_dftbp_force_max = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" - - ''') + """, + ) x_dftbp_force_max_mov = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" - - ''') + """, + ) class Energy(runschema.calculation.Energy): - m_def = Section(validate=False, extends_base_section=True) x_dftbp_total_mermin = SubSection(runschema.calculation.EnergyEntry.m_def) @@ -156,47 +167,51 @@ class Energy(runschema.calculation.Energy): class TB(runschema.method.TB): - m_def = Section(validate=False, extends_base_section=True) x_dftbp_input_parameters = Quantity( type=JSON, shape=[], - description=''' + description=""" - - ''') + """, + ) x_dftbp_n_sk_files = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' - ''') + description=""" + """, + ) x_dftbp_sk_files = Quantity( type=str, - shape=['x_dftbp_n_sk_files'], - description=''' - ''') + shape=["x_dftbp_n_sk_files"], + description=""" + """, + ) class Run(runschema.run.Run): - m_def = Section(validate=False, extends_base_section=True) x_dftbp_input_file = Quantity( type=str, shape=[], - description=''' - ''') + description=""" + """, + ) x_dftbp_processed_input_file = Quantity( type=str, shape=[], - description=''' - ''') + description=""" + """, + ) x_dftbp_parser_version = Quantity( type=str, shape=[], - description=''' - ''') + description=""" + """, + ) diff --git a/atomisticparsers/dlpoly/metainfo/dl_poly.py b/atomisticparsers/dlpoly/metainfo/dl_poly.py index 11e3e2be..b1a99294 100644 --- a/atomisticparsers/dlpoly/metainfo/dl_poly.py +++ b/atomisticparsers/dlpoly/metainfo/dl_poly.py @@ -16,11 +16,19 @@ # 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 +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, JSON + MSection, + MCategory, + Category, + Package, + Quantity, + Section, + SubSection, + SectionProxy, + Reference, + JSON, ) import runschema.run # pylint: disable=unused-import import runschema.calculation # pylint: disable=unused-import @@ -33,249 +41,272 @@ class x_dl_poly_section_md_molecule_type(MSection): - ''' + """ Section to store molecule type information - ''' + """ m_def = Section(validate=False) x_dl_poly_md_molecule_type_id = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' + description=""" Molecule type id - ''') + """, + ) x_dl_poly_md_molecule_type_name = Quantity( type=str, shape=[], - description=''' + description=""" Molecule type name - ''') + """, + ) class x_dl_poly_section_md_topology(MSection): - ''' + """ Section modelling the MD topology - ''' + """ m_def = Section(validate=False) x_dl_poly_md_molecular_types = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' + description=""" Number of molecular types in topology - ''') + """, + ) x_dl_poly_section_md_molecule_type = SubSection( - sub_section=SectionProxy('x_dl_poly_section_md_molecule_type'), - repeats=True) + sub_section=SectionProxy("x_dl_poly_section_md_molecule_type"), repeats=True + ) class MolecularDynamics(simulationworkflowschema.MolecularDynamics): - m_def = Section(validate=False, extends_base_section=True) x_dl_poly_barostat_target_pressure = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='pascal', - description=''' + unit="pascal", + description=""" MD barostat target pressure. - ''') + """, + ) x_dl_poly_barostat_tau = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='second', - description=''' + unit="second", + description=""" MD barostat relaxation time. - ''') + """, + ) x_dl_poly_integrator_dt = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='second', - description=''' + unit="second", + description=""" MD integration time step. - ''') + """, + ) x_dl_poly_integrator_type = Quantity( type=str, shape=[], - description=''' + description=""" MD integrator type, valid values are defined in the integrator_type wiki page. - ''') + """, + ) x_dl_poly_number_of_steps_requested = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" Number of requested MD integration time steps. - ''') + """, + ) x_dl_poly_thermostat_target_temperature = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='kelvin', - description=''' + unit="kelvin", + description=""" MD thermostat target temperature. - ''') + """, + ) x_dl_poly_thermostat_tau = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='second', - description=''' + unit="second", + description=""" MD thermostat relaxation time. - ''') + """, + ) class Run(runschema.run.Run): - m_def = Section(validate=False, extends_base_section=True) x_dl_poly_program_version_date = Quantity( type=str, shape=[], - description=''' + description=""" Program version date - ''') + """, + ) x_dl_poly_system_description = Quantity( type=str, shape=[], - description=''' + description=""" Simulation run title - ''') + """, + ) class System(runschema.system.System): - m_def = Section(validate=False, extends_base_section=True) x_dl_poly_section_md_topology = SubSection( - sub_section=SectionProxy('x_dl_poly_section_md_topology'), - repeats=True) + sub_section=SectionProxy("x_dl_poly_section_md_topology"), repeats=True + ) class Method(runschema.method.Method): - m_def = Section(validate=False, extends_base_section=True) x_dl_poly_step_number_equilibration = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' + description=""" MD equilibration step number - ''') + """, + ) x_dl_poly_step_number = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' + description=""" MD total step number - ''') + """, + ) x_dl_poly_thermostat_temperature = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" Thermostat coupling temperature - ''') + """, + ) x_dl_poly_control_parameters = Quantity( type=JSON, shape=[], - description=''' - ''') + description=""" + """, + ) class AtomParameters(runschema.method.AtomParameters): - m_def = Section(validate=False, extends_base_section=True) x_dl_poly_nrept = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' - ''') + description=""" + """, + ) x_dl_poly_ifrz = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' - ''') + description=""" + """, + ) x_dl_poly_igrp = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' - ''') + description=""" + """, + ) class Calculation(runschema.calculation.Calculation): - m_def = Section(validate=False, extends_base_section=True) x_dl_poly_virial_configurational = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' - ''') + description=""" + """, + ) x_dl_poly_virial_short_range = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' - ''') + description=""" + """, + ) x_dl_poly_virial_coulomb = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' - ''') + description=""" + """, + ) x_dl_poly_virial_bond = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' - ''') + description=""" + """, + ) x_dl_poly_virial_angle = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' - ''') + description=""" + """, + ) x_dl_poly_virial_constraint = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' - ''') + description=""" + """, + ) x_dl_poly_virial_tethering = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' - ''') + description=""" + """, + ) x_dl_poly_volume = Quantity( - type=np.dtype(np.float64), - unit='m ** 3', + type=np.float64, + unit="m ** 3", shape=[], - description=''' - ''') + description=""" + """, + ) x_dl_poly_core_shell = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' - ''') + description=""" + """, + ) x_dl_poly_virial_potential_mean_force = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' - ''') + description=""" + """, + ) diff --git a/atomisticparsers/dlpoly/parser.py b/atomisticparsers/dlpoly/parser.py index 6239edc1..2d8f6958 100644 --- a/atomisticparsers/dlpoly/parser.py +++ b/atomisticparsers/dlpoly/parser.py @@ -153,7 +153,7 @@ def to_bonds(val_in): dict( functional_form=potentials.get(val_n[0], val_n[0]), # atom index starts from 1 - atom_indices=[int(n) - 1 for n in val_n[1:3]], + atom_indices=[[int(n) - 1 for n in val_n[1:3]]], parameters=[float(v) for v in val_n[3:]], ) ) @@ -180,7 +180,7 @@ def to_angles(val_in): interactions.append( dict( functional_form=potentials.get(val_n[0], val_n[0]), - atom_indices=[int(n) - 1 for n in val_n[1:4]], + atom_indices=[[int(n) - 1 for n in val_n[1:4]]], parameters=[float(v) for v in val_n[4:]], ) ) @@ -202,7 +202,7 @@ def to_dihedrals(val_in): interactions.append( dict( functional_form=potentials.get(val_n[0], val_n[0]), - atom_indices=[int(n) - 1 for n in val_n[1:5]], + atom_indices=[[int(n) - 1 for n in val_n[1:5]]], parameters=[float(v) for v in val_n[5:]], ) ) @@ -221,7 +221,7 @@ def to_inversions(val_in): interactions.append( dict( functional_form=potentials.get(val_n[0], val_n[0]), - atom_indices=[int(n) - 1 for n in val_n[1:5]], + atom_indices=[[int(n) - 1 for n in val_n[1:5]]], parameters=[float(v) for v in val_n[5:]], ) ) @@ -235,7 +235,7 @@ def to_teth(val_in): interactions.append( dict( functional_form=potentials.get(val_n[0], val_n[0]), - atom_indices=[int(n) - 1 for n in val_n[1:2]], + atom_indices=[[int(n) - 1 for n in val_n[1:2]]], parameters=[float(v) for v in val_n[2:]], ) ) @@ -264,7 +264,7 @@ def to_vdw(val_in): interactions.append( dict( functional_form=potentials.get(val_n[2], val_n[2]), - atom_labels=val_n[:2], + atom_labels=[val_n[:2]], parameters=[float(v) for v in val_n[3:]], ) ) @@ -284,7 +284,7 @@ def to_tbp(val_in): interactions.append( dict( functional_form=potentials.get(val_n[3], val_n[3]), - atom_labels=val_n[:3], + atom_labels=[val_n[:3]], parameters=[float(v) for v in val_n[4:]], ) ) @@ -302,7 +302,7 @@ def to_fbp(val_in): interactions.append( dict( functional_form=potentials.get(val_n[4], val_n[4]), - atom_labels=val_n[:4], + atom_labels=[val_n[:4]], parameters=[float(v) for v in val_n[5:]], ) ) @@ -321,7 +321,7 @@ def to_metal(val_in): interactions.append( dict( functional_form=potentials.get(val_n[2], val_n[2]), - atom_labels=val_n[:2], + atom_labels=[val_n[:2]], parameters=[float(v) for v in val_n[3:]], ) ) @@ -377,7 +377,7 @@ def to_metal(val_in): convert=False, str_operation=lambda x: [ dict( - atom_indices=[int(v) - 1 for v in val[:2]], + atom_indices=[[int(v) - 1 for v in val[:2]]], parameters=[float(v) for v in val[2:3]], ) for val in [v.split() for v in x.strip().splitlines()] @@ -587,7 +587,10 @@ def write_to_archive(self) -> None: def get_system_data(frame_index): frame = self.traj_parser.get("frame")[frame_index] - labels = [atom.get("label") for atom in frame.get("atoms", [])] + labels = [ + atom.get("label") if atom.get("label") else "X" + for atom in frame.get("atoms", []) + ] lattice_vectors = frame.get("lattice_vectors") * ureg.angstrom array = np.transpose( [atom.get("array") for atom in frame.get("atoms", [])], axes=(1, 0, 2) @@ -646,7 +649,9 @@ def get_system_data(frame_index): sec_interaction = Interaction() sec_model.contributions.append(sec_interaction) for key, val in interaction.items(): - setattr(sec_interaction, key, val) + sec_interaction.m_set( + sec_interaction.m_get_quantity_definition(key), val + ) # add constraints to initial system constraint_data = [] for constraint in molecule.get("constraints", []): @@ -659,7 +664,7 @@ def get_system_data(frame_index): ) # rigid atoms for rigid in molecule.get("rigid", []): - constraint_data.append(dict(kind="static atoms", atom_indices=rigid)) + constraint_data.append(dict(kind="static atoms", atom_indices=[rigid])) self.parse_section(dict(constraint=constraint_data), sec_run.system[0]) # TODO add atom groups in system @@ -669,7 +674,9 @@ def get_system_data(frame_index): sec_interaction = Interaction() sec_model.contributions.append(sec_interaction) for key, val in interaction.items(): - setattr(sec_interaction, key, val) + quantity_def = sec_interaction.m_def.all_quantities.get(key) + if quantity_def: + sec_interaction.m_set(quantity_def, val) system_spec = self.mainfile_parser.get("system_specification", {}) n_atoms = len(sec_run.system[-1].atoms.positions) diff --git a/atomisticparsers/gromacs/metainfo/gromacs.py b/atomisticparsers/gromacs/metainfo/gromacs.py index 4d8fdd5c..2651556b 100644 --- a/atomisticparsers/gromacs/metainfo/gromacs.py +++ b/atomisticparsers/gromacs/metainfo/gromacs.py @@ -16,10 +16,17 @@ # 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 +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 + MSection, + MCategory, + Category, + Package, + Quantity, + Section, + SubSection, + SectionProxy, ) import runschema.run # pylint: disable=unused-import import runschema.calculation # pylint: disable=unused-import @@ -32,2048 +39,2350 @@ class x_gromacs_mdin_input_output_files(MCategory): - ''' + """ Parameters of mdin belonging to x_gromacs_section_control_parameters. - ''' + """ m_def = Category() class x_gromacs_mdin_control_parameters(MCategory): - ''' + """ Parameters of mdin belonging to x_gromacs_section_control_parameters. - ''' + """ m_def = Category() class x_gromacs_mdin_method(MCategory): - ''' + """ Parameters of mdin belonging to section method. - ''' + """ m_def = Category() class x_gromacs_mdout_single_configuration_calculation(MCategory): - ''' + """ Parameters of mdout belonging to section_single_configuration_calculation. - ''' + """ m_def = Category() class x_gromacs_mdout_method(MCategory): - ''' + """ Parameters of mdin belonging to section method. - ''' + """ m_def = Category() class x_gromacs_mdout_run(MCategory): - ''' + """ Parameters of mdin belonging to settings run. - ''' + """ m_def = Category() class x_gromacs_mdin_run(MCategory): - ''' + """ Parameters of mdin belonging to settings run. - ''' + """ m_def = Category() class x_gromacs_section_input_output_files(MSection): - ''' + """ Section to store input and output file names - ''' + """ - m_def = Section(validate=False,) + m_def = Section( + validate=False, + ) x_gromacs_inout_file_topoltpr = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs input topology file. - ''',) + """, + ) x_gromacs_inout_file_trajtrr = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs input trajectory file. - ''',) + """, + ) x_gromacs_inout_file_trajcompxtc = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs input compressed trajectory file. - ''',) + """, + ) x_gromacs_inout_file_statecpt = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs input coordinates and state file. - ''',) + """, + ) x_gromacs_inout_file_confoutgro = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs output configuration file. - ''',) + """, + ) x_gromacs_inout_file_eneredr = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs output energies file. - ''',) + """, + ) class x_gromacs_section_control_parameters(MSection): - ''' + """ Section to store the input and output control parameters - ''' + """ - m_def = Section(validate=False,) + m_def = Section( + validate=False, + ) x_gromacs_inout_control_gromacs_version = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_precision = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_memory_model = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_mpi_library = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_openmp_support = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_gpu_support = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_opencl_support = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_invsqrt_routine = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_simd_instructions = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_fft_library = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_rdtscp_usage = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_cxx11_compilation = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_tng_support = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_tracing_support = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_built_on = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_built_by = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_build_osarch = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_build_cpu_vendor = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_build_cpu_brand = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_build_cpu_family = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_build_cpu_features = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_c_compiler = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_c_compiler_flags = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_cxx_compiler = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_cxx_compiler_flags = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_boost_version = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_integrator = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_tinit = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_dt = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_nsteps = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_initstep = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_simulationpart = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_commmode = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_nstcomm = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_bdfric = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_ldseed = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_emtol = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_emstep = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_niter = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_fcstep = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_nstcgsteep = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_nbfgscorr = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_rtpi = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_nstxout = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_nstvout = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_nstfout = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_nstlog = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_nstcalcenergy = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_nstenergy = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_nstxoutcompressed = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_compressedxprecision = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_cutoffscheme = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_nstlist = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_nstype = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_pbc = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_periodicmolecules = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_verletbuffertolerance = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_rlist = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_rlistlong = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_nstcalclr = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_coulombtype = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_coulombmodifier = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_rcoulombswitch = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_rcoulomb = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_epsilonr = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_epsilonrf = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_vdwtype = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_vdwmodifier = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_rvdwswitch = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_rvdw = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_dispcorr = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_tableextension = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_fourierspacing = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_fouriernx = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_fourierny = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_fouriernz = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_pmeorder = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_ewaldrtol = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_ewaldrtollj = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_ljpmecombrule = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_ewaldgeometry = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_epsilonsurface = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_implicitsolvent = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_gbalgorithm = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_nstgbradii = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_rgbradii = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_gbepsilonsolvent = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_gbsaltconc = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_gbobcalpha = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_gbobcbeta = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_gbobcgamma = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_gbdielectricoffset = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_saalgorithm = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_sasurfacetension = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_tcoupl = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_nsttcouple = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_nhchainlength = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_printnosehooverchainvariables = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_pcoupl = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_pcoupltype = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_nstpcouple = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_taup = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_compressibility = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[3, 3], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_compressibility0 = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[3], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_compressibility1 = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[3], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_compressibility2 = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[3], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_refp = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[3, 3], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_refp0 = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[3], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_refp1 = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[3], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_refp2 = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[3], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_refcoordscaling = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_posrescom = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[3], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_posrescom0 = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_posrescom1 = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_posrescom2 = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_posrescomb = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[3], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_posrescomb0 = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_posrescomb1 = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_posrescomb2 = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_qmmm = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_qmconstraints = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_qmmmscheme = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_mmchargescalefactor = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_ngqm = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_constraintalgorithm = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_continuation = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_shakesor = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_shaketol = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_lincsorder = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_lincsiter = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_lincswarnangle = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_nwall = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_walltype = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_wallrlinpot = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_wallatomtype = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[2], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_wallatomtype0 = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_wallatomtype1 = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_walldensity = Quantity( - type=np.dtype(np.float64), - shape=[], - description=''' + type=np.float64, + shape=["*"], + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_walldensity0 = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_walldensity1 = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_wallewaldzfac = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_pull = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_rotation = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_interactivemd = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_disre = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_disreweighting = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_disremixed = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_drfc = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_drtau = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_nstdisreout = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_orirefc = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_oriretau = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_nstorireout = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_freeenergy = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_cosacceleration = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_deform = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[3, 3], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_deform0 = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[3], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_deform1 = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[3], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_deform2 = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[3], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_simulatedtempering = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_ex = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_ext = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_ey = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_eyt = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_ez = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_ezt = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_swapcoords = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_adress = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_userint1 = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_userint2 = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_userint3 = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_userint4 = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_userreal1 = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_userreal2 = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_userreal3 = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_userreal4 = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_nrdf = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_reft = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_taut = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_annealing = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_annealingnpoints = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_acc = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_nfreeze = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_energygrpflags = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[3, 2], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_energygrpflags0 = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_energygrpflags1 = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) x_gromacs_inout_control_energygrpflags2 = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs running environment and control parameters. - ''',) + """, + ) class x_gromacs_section_atom_to_atom_type_ref(MSection): - ''' + """ Section to store atom label to atom type definition list - ''' + """ - m_def = Section(validate=False,) + m_def = Section( + validate=False, + ) x_gromacs_atom_to_atom_type_ref = Quantity( - type=np.dtype(np.int64), - shape=['number_of_atoms_per_type'], - description=''' + type=np.int64, + shape=["number_of_atoms_per_type"], + description=""" Reference to the atoms of each atom type. - ''',) + """, + ) class x_gromacs_section_single_configuration_calculation(MSection): - ''' + """ section for gathering values for MD steps - ''' + """ - m_def = Section(validate=False,) + m_def = Section( + validate=False, + ) class System(runschema.system.System): - - m_def = Section(validate=False, extends_base_section=True,) + m_def = Section( + validate=False, + extends_base_section=True, + ) x_gromacs_atom_positions_image_index = Quantity( - type=np.dtype(np.int32), - shape=['number_of_atoms', 3], - unit='dimensionless', - description=''' + type=np.int32, + shape=["number_of_atoms", 3], + unit="dimensionless", + description=""" PBC image flag index. - ''',) + """, + ) x_gromacs_atom_positions_scaled = Quantity( - type=np.dtype(np.float64), - shape=['number_of_atoms', 3], - unit='dimensionless', - description=''' + type=np.float64, + shape=["number_of_atoms", 3], + unit="dimensionless", + description=""" Position of the atoms in a scaled format [0, 1]. - ''',) + """, + ) x_gromacs_atom_positions_wrapped = Quantity( - type=np.dtype(np.float64), - shape=['number_of_atoms', 3], - unit='meter', - description=''' + type=np.float64, + shape=["number_of_atoms", 3], + unit="meter", + description=""" Position of the atoms wrapped back to the periodic box. - ''',) + """, + ) x_gromacs_lattice_lengths = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[3], - description=''' + description=""" Lattice dimensions in a vector. Vector includes [a, b, c] lengths. - ''') + """, + ) x_gromacs_lattice_angles = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[3], - description=''' + description=""" Angles of lattice vectors. Vector includes [alpha, beta, gamma] in degrees. - ''') + """, + ) x_gromacs_dummy = Quantity( type=str, shape=[], - description=''' + description=""" dummy - ''',) + """, + ) x_gromacs_mdin_finline = Quantity( type=str, shape=[], - description=''' + description=""" finline in mdin - ''',) + """, + ) x_gromacs_traj_timestep_store = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''',) + """, + ) x_gromacs_traj_number_of_atoms_store = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''',) + """, + ) x_gromacs_traj_box_bound_store = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''',) + """, + ) x_gromacs_traj_box_bounds_store = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''',) + """, + ) x_gromacs_traj_variables_store = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''',) + """, + ) x_gromacs_traj_atoms_store = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''',) + """, + ) class MolecularDynamics(simulationworkflowschema.MolecularDynamics): - - m_def = Section(validate=False, extends_base_section=True,) + m_def = Section( + validate=False, + extends_base_section=True, + ) x_gromacs_barostat_target_pressure = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='pascal', - description=''' + unit="pascal", + description=""" MD barostat target pressure. - ''') + """, + ) x_gromacs_barostat_tau = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='second', - description=''' + unit="second", + description=""" MD barostat relaxation time. - ''') + """, + ) x_gromacs_barostat_type = Quantity( type=str, shape=[], - description=''' + description=""" MD barostat type, valid values are defined in the barostat_type wiki page. - ''') + """, + ) x_gromacs_integrator_dt = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='second', - description=''' + unit="second", + description=""" MD integration time step. - ''') + """, + ) x_gromacs_integrator_type = Quantity( type=str, shape=[], - description=''' + description=""" MD integrator type, valid values are defined in the integrator_type wiki page. - ''') + """, + ) x_gromacs_periodicity_type = Quantity( type=str, shape=[], - description=''' + description=""" Periodic boundary condition type in the sampling (non-PBC or PBC). - ''') + """, + ) x_gromacs_langevin_gamma = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='second', - description=''' + unit="second", + description=""" Langevin thermostat damping factor. - ''') + """, + ) x_gromacs_number_of_steps_requested = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" Number of requested MD integration time steps. - ''') + """, + ) x_gromacs_thermostat_level = Quantity( type=str, shape=[], - description=''' + description=""" MD thermostat level (see wiki: single, multiple, regional). - ''') + """, + ) x_gromacs_thermostat_target_temperature = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='kelvin', - description=''' + unit="kelvin", + description=""" MD thermostat target temperature. - ''') + """, + ) x_gromacs_thermostat_tau = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='second', - description=''' + unit="second", + description=""" MD thermostat relaxation time. - ''') + """, + ) x_gromacs_thermostat_type = Quantity( type=str, shape=[], - description=''' + description=""" MD thermostat type, valid values are defined in the thermostat_type wiki page. - ''') + """, + ) class AtomParameters(runschema.method.AtomParameters): - - m_def = Section(validate=False, extends_base_section=True,) + m_def = Section( + validate=False, + extends_base_section=True, + ) x_gromacs_atom_name = Quantity( type=str, shape=[], - description=''' + description=""" Atom name of an atom in topology definition. - ''',) + """, + ) x_gromacs_atom_type = Quantity( type=str, shape=[], - description=''' + description=""" Atom type of an atom in topology definition. - ''',) + """, + ) x_gromacs_atom_element = Quantity( type=str, shape=[], - description=''' + description=""" Atom type of an atom in topology definition. - ''',) + """, + ) x_gromacs_atom_type_element = Quantity( type=str, shape=[], - description=''' + description=""" Element symbol of an atom type. - ''',) + """, + ) x_gromacs_atom_type_radius = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" van der Waals radius of an atom type. - ''',) + """, + ) number_of_atoms_per_type = Quantity( type=int, shape=[], - description=''' + description=""" Number of atoms involved in this type. - ''',) + """, + ) x_gromacs_atom_resid = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' - ''',) + description=""" + """, + ) x_gromacs_atom_resname = Quantity( type=str, shape=[], - description=''' - ''',) + description=""" + """, + ) x_gromacs_atom_molnum = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' - ''',) + description=""" + """, + ) x_gromacs_atom_moltype = Quantity( type=str, shape=[], - description=''' - ''',) + description=""" + """, + ) class Interaction(runschema.method.Interaction): - - m_def = Section(validate=False, extends_base_section=True,) + m_def = Section( + validate=False, + extends_base_section=True, + ) x_gromacs_interaction_atom_to_atom_type_ref = Quantity( type=runschema.method.AtomParameters, - shape=['number_of_atoms_per_interaction'], - description=''' + shape=["number_of_atoms_per_interaction"], + description=""" Reference to the atom type of each interaction atoms. - ''',) + """, + ) x_gromacs_number_of_defined_pair_interactions = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' + description=""" Number of defined pair interactions (L-J pairs). - ''',) + """, + ) x_gromacs_pair_interaction_atom_type_ref = Quantity( type=runschema.method.AtomParameters, - shape=['x_gromacs_number_of_defined_pair_interactions', 'number_of_atoms_per_interaction'], - description=''' + shape=[ + "x_gromacs_number_of_defined_pair_interactions", + "number_of_atoms_per_interaction", + ], + description=""" Reference to the atom type for pair interactions. - ''',) + """, + ) x_gromacs_pair_interaction_parameters = Quantity( - type=np.dtype(np.float64), - shape=['x_gromacs_number_of_defined_pair_interactions', 2], - description=''' + type=np.float64, + shape=["x_gromacs_number_of_defined_pair_interactions", 2], + description=""" Pair interactions parameters. - ''',) + """, + ) x_gromacs_molecule_interaction_atom_to_atom_type_ref = Quantity( type=runschema.method.AtomParameters, - shape=['number_of_atoms_per_interaction'], - description=''' + shape=["number_of_atoms_per_interaction"], + description=""" Reference to the atom type of each molecule interaction atoms. - ''',) + """, + ) x_gromacs_number_of_defined_molecule_pair_interactions = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' + description=""" Number of defined pair interactions within a molecule (L-J pairs). - ''',) + """, + ) x_gromacs_pair_molecule_interaction_parameters = Quantity( - type=np.dtype(np.float64), - shape=['number_of_defined_molecule_pair_interactions', 2], - description=''' + type=np.float64, + shape=["number_of_defined_molecule_pair_interactions", 2], + description=""" Molecule pair interactions parameters. - ''',) + """, + ) x_gromacs_pair_molecule_interaction_to_atom_type_ref = Quantity( type=runschema.method.AtomParameters, - shape=['x_gromacs_number_of_defined_pair_interactions', 'number_of_atoms_per_interaction'], - description=''' + shape=[ + "x_gromacs_number_of_defined_pair_interactions", + "number_of_atoms_per_interaction", + ], + description=""" Reference to the atom type for pair interactions within a molecule. - ''',) + """, + ) class Run(runschema.run.Run): - - m_def = Section(validate=False, extends_base_section=True,) + m_def = Section( + validate=False, + extends_base_section=True, + ) x_gromacs_program_version_date = Quantity( type=str, shape=[], - description=''' + description=""" Program version date. - ''',) + """, + ) x_gromacs_parallel_task_nr = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" Program task no. - ''',) + """, + ) x_gromacs_number_of_tasks = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" Number of tasks in parallel program (MPI). - ''',) + """, + ) x_gromacs_program_module_version = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs program module (gmx) version. - ''',) + """, + ) x_gromacs_program_license = Quantity( type=str, shape=[], - description=''' + description=""" Gromacs program license. - ''',) + """, + ) x_gromacs_xlo_xhi = Quantity( type=str, shape=[], - description=''' + description=""" test - ''',) + """, + ) x_gromacs_data_file_store = Quantity( type=str, shape=[], - description=''' + description=""" Filename of data file - ''',) + """, + ) x_gromacs_program_working_path = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''',) + """, + ) x_gromacs_program_execution_host = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''',) + """, + ) x_gromacs_program_execution_path = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''',) + """, + ) x_gromacs_program_module = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''',) + """, + ) x_gromacs_program_execution_date = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''',) + """, + ) x_gromacs_program_execution_time = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''',) + """, + ) x_gromacs_mdin_header = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''',) + """, + ) x_gromacs_mdin_wt = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''',) + """, + ) x_gromacs_section_input_output_files = SubSection( - sub_section=SectionProxy('x_gromacs_section_input_output_files'), - repeats=False) + sub_section=SectionProxy("x_gromacs_section_input_output_files"), repeats=False + ) x_gromacs_section_control_parameters = SubSection( - sub_section=SectionProxy('x_gromacs_section_control_parameters'), - repeats=False) + sub_section=SectionProxy("x_gromacs_section_control_parameters"), repeats=False + ) class Constraint(runschema.system.Constraint): - - m_def = Section(validate=False, extends_base_section=True,) + m_def = Section( + validate=False, + extends_base_section=True, + ) x_gromacs_input_units_store = Quantity( type=str, shape=[], - description=''' + description=""" It determines the units of all quantities specified in the input script and data file, as well as quantities output to the screen, log file, and dump files. - ''',) + """, + ) x_gromacs_data_bond_types_store = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' + description=""" store temporarly - ''',) + """, + ) x_gromacs_data_bond_count_store = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' + description=""" store temporarly - ''',) + """, + ) x_gromacs_data_angle_count_store = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' + description=""" store temporarly - ''',) + """, + ) x_gromacs_data_atom_types_store = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' + description=""" store temporarly - ''',) + """, + ) x_gromacs_data_dihedral_count_store = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' + description=""" store temporarly - ''',) + """, + ) x_gromacs_data_angles_store = Quantity( type=str, shape=[], - description=''' + description=""" store temporarly - ''',) + """, + ) x_gromacs_data_angle_list_store = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''',) + """, + ) x_gromacs_data_bond_list_store = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''',) + """, + ) x_gromacs_data_dihedral_list_store = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''',) + """, + ) x_gromacs_data_dihedral_coeff_list_store = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''',) + """, + ) x_gromacs_masses_store = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''',) + """, + ) x_gromacs_data_topo_list_store = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''',) + """, + ) x_gromacs_section_atom_to_atom_type_ref = SubSection( - sub_section=SectionProxy('x_gromacs_section_atom_to_atom_type_ref'), - repeats=True,) + sub_section=SectionProxy("x_gromacs_section_atom_to_atom_type_ref"), + repeats=True, + ) class CalcEntry(MSection): - ''' + """ Section describing a general type of calculation. - ''' + """ m_def = Section(validate=False) kind = Quantity( type=str, shape=[], - description=''' + description=""" Kind of the quantity. - ''') + """, + ) value = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" Value of this contribution. - ''') + """, + ) unit = Quantity( type=str, shape=[], - description=''' + description=""" Unit of the parameter as a string. - ''') + """, + ) class Calculation(runschema.calculation.Calculation): - - m_def = Section(validate=False, extends_base_section=True,) + m_def = Section( + validate=False, + extends_base_section=True, + ) x_gromacs_section_single_configuration_calculation = SubSection( - sub_section=SectionProxy('x_gromacs_section_single_configuration_calculation'), - repeats=True,) + sub_section=SectionProxy("x_gromacs_section_single_configuration_calculation"), + repeats=True, + ) x_gromacs_thermodynamics_contributions = SubSection( sub_section=CalcEntry.m_def, - description=''' + description=""" Contains other gromacs-specific thermodynamic and energy contributions that are not already defined. - ''', - repeats=True) + """, + repeats=True, + ) class Energy(runschema.calculation.Energy): - - m_def = Section(validate=False, extends_base_section=True,) + m_def = Section( + validate=False, + extends_base_section=True, + ) x_gromacs_energy_contributions = SubSection( sub_section=runschema.calculation.EnergyEntry.m_def, - description=''' + description=""" Contains other gromacs-specific energy contributions that are not already defined. - ''', - repeats=True) + """, + repeats=True, + ) diff --git a/atomisticparsers/gromacs/parser.py b/atomisticparsers/gromacs/parser.py index 56faf077..d9c9c79d 100644 --- a/atomisticparsers/gromacs/parser.py +++ b/atomisticparsers/gromacs/parser.py @@ -914,7 +914,7 @@ def get_composition(children_names): "labels": atom_labels, "positions": positions, "velocities": self.traj_parser.get_velocities(n), - "bond_list": bond_list, + "bond_list": bond_list if bond_list else None, } } ) @@ -1278,9 +1278,9 @@ def get_free_energy_calculation_parameters(self): couple_intramolecular = self.input_parameters.get( "couple-intramol", "on" ).lower() - free_energy_parameters["final_state_bonded"] = "on" + free_energy_parameters["final_state_bonded"] = True free_energy_parameters["initial_state_bonded"] = ( - "off" if couple_intramolecular == "yes" else "on" + couple_intramolecular != "yes" ) return free_energy_parameters @@ -1484,9 +1484,13 @@ def parse_input(self): "x_gromacs_inout_control_%s" % key.replace("-", "").replace(" ", "_").lower() ) - if hasattr(sec_control_parameters, key): - val = str(val) if not isinstance(val, np.ndarray) else val - setattr(sec_control_parameters, key, val) + quantity_def = sec_control_parameters.m_def.all_quantities.get(key) + if quantity_def: + try: + val = str(val) if not isinstance(val, np.ndarray) else val + sec_control_parameters.m_set(quantity_def, val) + except Exception: + self.logger.error("Error setting metainfo.", data={"key": key}) def write_to_archive(self): self._maindir = os.path.dirname(self.mainfile) diff --git a/atomisticparsers/gromos/metainfo/gromos.py b/atomisticparsers/gromos/metainfo/gromos.py index 9798cc0d..20afb4bb 100644 --- a/atomisticparsers/gromos/metainfo/gromos.py +++ b/atomisticparsers/gromos/metainfo/gromos.py @@ -16,11 +16,18 @@ # 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 +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 + MSection, + MCategory, + Category, + Package, + Quantity, + Section, + SubSection, + SectionProxy, + Reference, ) import runschema.run # pylint: disable=unused-import import runschema.calculation # pylint: disable=unused-import @@ -33,1728 +40,1956 @@ class x_gromos_mdin_input_output_files(MCategory): - ''' + """ Parameters of mdin belonging to x_gromos_section_control_parameters. - ''' + """ m_def = Category() class x_gromos_mdin_control_parameters(MCategory): - ''' + """ Parameters of mdin belonging to x_gromos_section_control_parameters. - ''' + """ m_def = Category() class x_gromos_mdin_method(MCategory): - ''' + """ Parameters of mdin belonging to section method. - ''' + """ m_def = Category() class x_gromos_mdout_single_configuration_calculation(MCategory): - ''' + """ Parameters of mdout belonging to section_single_configuration_calculation. - ''' + """ m_def = Category() class x_gromos_mdout_method(MCategory): - ''' + """ Parameters of mdin belonging to section method. - ''' + """ m_def = Category() class x_gromos_mdout_run(MCategory): - ''' + """ Parameters of mdin belonging to settings run. - ''' + """ m_def = Category() class x_gromos_mdin_run(MCategory): - ''' + """ Parameters of mdin belonging to settings run. - ''' + """ m_def = Category() class x_gromos_section_input_output_files(MSection): - ''' + """ Section to store input and output file names - ''' + """ m_def = Section(validate=False) class x_gromos_section_control_parameters(MSection): - ''' + """ Section to store the input and output control parameters - ''' + """ m_def = Section(validate=False) x_gromos_inout_file_structure = Quantity( type=str, shape=[], - description=''' + description=""" gromos input topology file. - ''') + """, + ) x_gromos_inout_file_trajectory = Quantity( type=str, shape=[], - description=''' + description=""" gromos output trajectory file. - ''') + """, + ) x_gromos_inout_file_traj_coord = Quantity( type=str, shape=[], - description=''' + description=""" gromos output trajectory file. - ''') + """, + ) x_gromos_inout_file_traj_vel = Quantity( type=str, shape=[], - description=''' + description=""" gromos output file for velocities in the trajectory. - ''') + """, + ) x_gromos_inout_file_traj_force = Quantity( type=str, shape=[], - description=''' + description=""" gromos output file for forces in the trajectory. - ''') + """, + ) x_gromos_inout_file_output_coord = Quantity( type=str, shape=[], - description=''' + description=""" gromos output coordinates file. - ''') + """, + ) x_gromos_inout_file_output_vel = Quantity( type=str, shape=[], - description=''' + description=""" gromos output velocities file. - ''') + """, + ) x_gromos_inout_file_output_force = Quantity( type=str, shape=[], - description=''' + description=""" gromos output forces file. - ''') + """, + ) x_gromos_inout_file_input_coord = Quantity( type=str, shape=[], - description=''' + description=""" gromos input coordinates file. - ''') + """, + ) x_gromos_inout_file_input_vel = Quantity( type=str, shape=[], - description=''' + description=""" gromos input velocities file. - ''') + """, + ) x_gromos_inout_file_restart_coord = Quantity( type=str, shape=[], - description=''' + description=""" gromos restart coordinates file. - ''') + """, + ) x_gromos_inout_file_restart_vel = Quantity( type=str, shape=[], - description=''' + description=""" gromos restart velocities file. - ''') + """, + ) x_gromos_inout_file_output_log = Quantity( type=str, shape=[], - description=''' + description=""" gromos MD output log file. - ''') + """, + ) x_gromos_inout_control_number_of_steps = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_steps_per_cycle = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_initial_temperature = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_dielectric = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_minimization = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_verlet_integrator = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_topology_parameters = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_topology_type = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_resname = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_number_of_atom_types = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_number_of_atoms_solute = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_lennard_jones_exceptions = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_number_of_h_bonds_at_constraint = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_number_of_bonds_at_constraint = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_bondangles_containing_hydrogens = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_bondangles_not_containing_hydrogens = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_improper_dihedrals_not_containing_hydrogens = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_improper_dihedrals_containing_hydrogens = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_dihedrals_not_containing_hydrogens = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_dihedrals_containing_hydrogens = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_crossdihedrals_not_containing_hydrogens = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_crossdihedrals_containing_hydrogens = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_number_of_solvent_atoms = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_number_of_solvent_constraints = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_number_of_solvents_added = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_number_of_molecules_in_solute = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_number_of_temperature_groups_for_solute = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_number_of_pressure_groups_for_solute = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_bond_angle_interaction_in_force_field = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_improper_dihedral_interaction_in_force_field = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_dihedral_interaction_in_force_field = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_nonbonded_definitions_in_force_field = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_pairlist_algorithm = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_periodic_boundary_conditions = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_virial = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_cutoff_type = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_shortrange_cutoff = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_longrange_cutoff = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_pairlist_update_step_frequency = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_reactionfield_cutoff = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_force_field_epsilon = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_reactionfield_epsilon = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_force_field_kappa = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_force_field_perturbation = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_title = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_emin_ntem = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_emin_ncyc = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_emin_dele = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_emin_dx0 = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_emin_dxm = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_emin_nmin = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_emin_flim = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_sys_npm = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_sys_nsm = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_init_ntivel = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_init_ntishk = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_init_ntinht = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_init_ntinhb = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_init_ntishi = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_init_ntirtc = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_init_nticom = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_init_ntisti = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_init_ig = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_init_tempi = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_step_nstlim = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_step_t = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_step_dt = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_bcnd_ntb = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_bcnd_ndfmin = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_bath_alg = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_bath_num = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_bath_nbaths = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_bath_temp = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_bath_tau = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_bath_dofset = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_bath_last = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_bath_combath = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_bath_irbath = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_pres_couple = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_pres_scale = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_pres_comp = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_pres_taup = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_pres_virial = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_pres_aniso = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_pres_init0 = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_covf_ntbbh = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_covf_ntbah = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_covf_ntbdn = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_solm_nspm = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_solm_nsp = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_comt_nscm = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_prnt_ntpr = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_prnt_ntpp = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_writ_ntwx = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_writ_ntwse = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_writ_ntwv = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_writ_ntwf = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_writ_ntwe = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_writ_ntwg = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_writ_ntwb = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_cnst_ntc = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_cnst_ntcp = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_cnst_ntcp0 = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_cnst_ntcs = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_cnst_ntcs0 = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_forc_bonds = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_forc_angs = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_forc_imps = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_forc_dihs = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_forc_elec = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_forc_vdw = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_forc_negr = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_forc_nre = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_pair_alg = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_pair_nsnb = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_pair_rcutp = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_pair_rcutl = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_pair_size = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_pair_type = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_nonb_nlrele = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_nonb_appak = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_nonb_rcrf = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_nonb_epsrf = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_nonb_nslfexcl = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_nonb_nshape = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_nonb_ashape = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_nonb_na2clc = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_nonb_tola2 = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_nonb_epsls = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_nonb_nkx = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_nonb_nky = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_nonb_nkz = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_nonb_kcut = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_nonb_ngx = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_nonb_ngy = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_nonb_ngz = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_nonb_nasord = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_nonb_nfdord = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_nonb_nalias = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_nonb_nspord = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_nonb_nqeval = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_nonb_faccur = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_nonb_nrdgrd = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_nonb_nwrgrd = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_nonb_nlrlj = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_nonb_slvdns = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_structure_file = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_parameter_file = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_input_file = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_topology_file = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_configuration_file = Quantity( type=str, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_number_of_parameters = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_inout_control_parameters = Quantity( type=str, - shape=['x_gromos_inout_control_number_of_parameters'], - description=''' + shape=["x_gromos_inout_control_number_of_parameters"], + description=""" gromos running environment and control parameters. - ''') + """, + ) x_gromos_section_input_output_files = SubSection( - sub_section=SectionProxy('x_gromos_section_input_output_files'), - repeats=True) + sub_section=SectionProxy("x_gromos_section_input_output_files"), repeats=True + ) class x_gromos_section_atom_to_atom_type_ref(MSection): - ''' + """ Section to store atom label to atom type definition list - ''' + """ m_def = Section(validate=False) x_gromos_atom_to_atom_type_ref = Quantity( - type=np.dtype(np.int64), - shape=['number_of_atoms_per_type'], - description=''' + type=np.int64, + shape=["number_of_atoms_per_type"], + description=""" Reference to the atoms of each atom type. - ''') + """, + ) class x_gromos_section_single_configuration_calculation(MSection): - ''' + """ section for gathering values for MD steps - ''' + """ m_def = Section(validate=False) class System(runschema.system.System): - m_def = Section(validate=False, extends_base_section=True) x_gromos_atom_positions_image_index = Quantity( - type=np.dtype(np.int32), - shape=['number_of_atoms', 3], - unit='dimensionless', - description=''' + type=np.int32, + shape=["number_of_atoms", 3], + unit="dimensionless", + description=""" PBC image flag index. - ''') + """, + ) x_gromos_atom_positions_scaled = Quantity( - type=np.dtype(np.float64), - shape=['number_of_atoms', 3], - unit='dimensionless', - description=''' + type=np.float64, + shape=["number_of_atoms", 3], + unit="dimensionless", + description=""" Position of the atoms in a scaled format [0, 1]. - ''') + """, + ) x_gromos_atom_positions_wrapped = Quantity( - type=np.dtype(np.float64), - shape=['number_of_atoms', 3], - unit='meter', - description=''' + type=np.float64, + shape=["number_of_atoms", 3], + unit="meter", + description=""" Position of the atoms wrapped back to the periodic box. - ''') + """, + ) x_gromos_lattice_lengths = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[3], - description=''' + description=""" Lattice dimensions in a vector. Vector includes [a, b, c] lengths. - ''') + """, + ) x_gromos_lattice_angles = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[3], - description=''' + description=""" Angles of lattice vectors. Vector includes [alpha, beta, gamma] in degrees. - ''') + """, + ) x_gromos_dummy = Quantity( type=str, shape=[], - description=''' + description=""" dummy - ''') + """, + ) x_gromos_mdin_finline = Quantity( type=str, shape=[], - description=''' + description=""" finline in mdin - ''') + """, + ) x_gromos_traj_timestep_store = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_gromos_traj_number_of_atoms_store = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_gromos_traj_box_bound_store = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_gromos_traj_box_bounds_store = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_gromos_traj_variables_store = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_gromos_traj_atoms_store = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) class MolecularDynamics(simulationworkflowschema.MolecularDynamics): - m_def = Section(validate=False, extends_base_section=True) x_gromos_barostat_target_pressure = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='pascal', - description=''' + unit="pascal", + description=""" MD barostat target pressure. - ''') + """, + ) x_gromos_barostat_tau = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='second', - description=''' + unit="second", + description=""" MD barostat relaxation time. - ''') + """, + ) x_gromos_barostat_type = Quantity( type=str, shape=[], - description=''' + description=""" MD barostat type, valid values are defined in the barostat_type wiki page. - ''') + """, + ) x_gromos_integrator_dt = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='second', - description=''' + unit="second", + description=""" MD integration time step. - ''') + """, + ) x_gromos_integrator_type = Quantity( type=str, shape=[], - description=''' + description=""" MD integrator type, valid values are defined in the integrator_type wiki page. - ''') + """, + ) x_gromos_periodicity_type = Quantity( type=str, shape=[], - description=''' + description=""" Periodic boundary condition type in the sampling (non-PBC or PBC). - ''') + """, + ) x_gromos_langevin_gamma = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='second', - description=''' + unit="second", + description=""" Langevin thermostat damping factor. - ''') + """, + ) x_gromos_number_of_steps_requested = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" Number of requested MD integration time steps. - ''') + """, + ) x_gromos_thermostat_level = Quantity( type=str, shape=[], - description=''' + description=""" MD thermostat level (see wiki: single, multiple, regional). - ''') + """, + ) x_gromos_thermostat_target_temperature = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='kelvin', - description=''' + unit="kelvin", + description=""" MD thermostat target temperature. - ''') + """, + ) x_gromos_thermostat_tau = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='second', - description=''' + unit="second", + description=""" MD thermostat relaxation time. - ''') + """, + ) x_gromos_thermostat_type = Quantity( type=str, shape=[], - description=''' + description=""" MD thermostat type, valid values are defined in the thermostat_type wiki page. - ''') + """, + ) class AtomParameters(runschema.method.AtomParameters): - m_def = Section(validate=False, extends_base_section=True) x_gromos_atom_name = Quantity( type=str, shape=[], - description=''' + description=""" Atom name of an atom in topology definition. - ''') + """, + ) x_gromos_atom_type = Quantity( type=str, shape=[], - description=''' + description=""" Atom type of an atom in topology definition. - ''') + """, + ) x_gromos_atom_element = Quantity( type=str, shape=[], - description=''' + description=""" Atom type of an atom in topology definition. - ''') + """, + ) x_gromos_atom_type_element = Quantity( type=str, shape=[], - description=''' + description=""" Element symbol of an atom type. - ''') + """, + ) x_gromos_atom_type_radius = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" van der Waals radius of an atom type. - ''') + """, + ) number_of_atoms_per_type = Quantity( type=int, shape=[], - description=''' + description=""" Number of atoms involved in this type. - ''') + """, + ) class Interaction(runschema.method.Interaction): - m_def = Section(validate=False, extends_base_section=True) x_gromos_interaction_atom_to_atom_type_ref = Quantity( type=runschema.method.AtomParameters, - shape=['number_of_atoms_per_interaction'], - description=''' + shape=["number_of_atoms_per_interaction"], + description=""" Reference to the atom type of each interaction atoms. - ''') + """, + ) x_gromos_number_of_defined_pair_interactions = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' + description=""" Number of defined pair interactions (L-J pairs). - ''') + """, + ) x_gromos_pair_interaction_atom_type_ref = Quantity( type=runschema.method.AtomParameters, - shape=['x_gromos_number_of_defined_pair_interactions', 'number_of_atoms_per_interaction'], - description=''' + shape=[ + "x_gromos_number_of_defined_pair_interactions", + "number_of_atoms_per_interaction", + ], + description=""" Reference to the atom type for pair interactions. - ''') + """, + ) x_gromos_pair_interaction_parameters = Quantity( - type=np.dtype(np.float64), - shape=['x_gromos_number_of_defined_pair_interactions', 2], - description=''' + type=np.float64, + shape=["x_gromos_number_of_defined_pair_interactions", 2], + description=""" Pair interactions parameters. - ''') + """, + ) x_gromos_molecule_interaction_atom_to_atom_type_ref = Quantity( type=runschema.method.AtomParameters, - shape=['number_of_atoms_per_interaction'], - description=''' + shape=["number_of_atoms_per_interaction"], + description=""" Reference to the atom type of each molecule interaction atoms. - ''') + """, + ) x_gromos_number_of_defined_molecule_pair_interactions = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' + description=""" Number of defined pair interactions within a molecule (L-J pairs). - ''') + """, + ) x_gromos_pair_molecule_interaction_parameters = Quantity( - type=np.dtype(np.float64), - shape=['number_of_defined_molecule_pair_interactions', 2], - description=''' + type=np.float64, + shape=["number_of_defined_molecule_pair_interactions", 2], + description=""" Molecule pair interactions parameters. - ''') + """, + ) x_gromos_pair_molecule_interaction_to_atom_type_ref = Quantity( type=runschema.method.AtomParameters, - shape=['x_gromos_number_of_defined_pair_interactions', 'number_of_atoms_per_interaction'], - description=''' + shape=[ + "x_gromos_number_of_defined_pair_interactions", + "number_of_atoms_per_interaction", + ], + description=""" Reference to the atom type for pair interactions within a molecule. - ''') + """, + ) class Run(runschema.run.Run): - m_def = Section(validate=False, extends_base_section=True) x_gromos_program_version_date = Quantity( type=str, shape=[], - description=''' + description=""" Program version date. - ''') + """, + ) x_gromos_parallel_task_nr = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" Program task no. - ''') + """, + ) x_gromos_build_osarch = Quantity( type=str, shape=[], - description=''' + description=""" Program Build OS/ARCH - ''') + """, + ) x_gromos_output_created_by_user = Quantity( type=str, shape=[], - description=''' + description=""" Output file creator - ''') + """, + ) x_gromos_most_severe_warning_level = Quantity( type=str, shape=[], - description=''' + description=""" Highest gromos warning level in the run. - ''') + """, + ) x_gromos_program_build_date = Quantity( type=str, shape=[], - description=''' + description=""" Program Build date - ''') + """, + ) x_gromos_program_citation = Quantity( type=str, shape=[], - description=''' + description=""" Program citations - ''') + """, + ) x_gromos_program_copyright = Quantity( type=str, shape=[], - description=''' + description=""" Program copyright - ''') + """, + ) x_gromos_number_of_tasks = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" Number of tasks in parallel program (MPI). - ''') + """, + ) x_gromos_program_module_version = Quantity( type=str, shape=[], - description=''' + description=""" gromos program module version. - ''') + """, + ) x_gromos_program_license = Quantity( type=str, shape=[], - description=''' + description=""" gromos program license. - ''') + """, + ) x_gromos_xlo_xhi = Quantity( type=str, shape=[], - description=''' + description=""" test - ''') + """, + ) x_gromos_data_file_store = Quantity( type=str, shape=[], - description=''' + description=""" Filename of data file - ''') + """, + ) x_gromos_program_working_path = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_gromos_program_execution_host = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_gromos_program_execution_path = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_gromos_program_module = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_gromos_program_execution_date = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_gromos_program_execution_time = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_gromos_mdin_header = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_gromos_mdin_wt = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_gromos_section_control_parameters = SubSection( - sub_section=SectionProxy('x_gromos_section_control_parameters'), - repeats=True) + sub_section=SectionProxy("x_gromos_section_control_parameters"), repeats=True + ) class Calculation(runschema.calculation.Calculation): - m_def = Section(validate=False, extends_base_section=True) x_gromos_section_single_configuration_calculation = SubSection( - sub_section=SectionProxy('x_gromos_section_single_configuration_calculation'), - repeats=True) + sub_section=SectionProxy("x_gromos_section_single_configuration_calculation"), + repeats=True, + ) diff --git a/atomisticparsers/gulp/metainfo/gulp.py b/atomisticparsers/gulp/metainfo/gulp.py index ffd54b0b..55dfc6be 100644 --- a/atomisticparsers/gulp/metainfo/gulp.py +++ b/atomisticparsers/gulp/metainfo/gulp.py @@ -16,11 +16,18 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import numpy as np # pylint: disable=unused-import +import numpy as np # pylint: disable=unused-import from nomad.metainfo import ( # pylint: disable=unused-import - MSection, MCategory, Category, Package, Quantity, Section, SubSection, SectionProxy, - Reference + MSection, + MCategory, + Category, + Package, + Quantity, + Section, + SubSection, + SectionProxy, + Reference, ) import runschema.run # pylint: disable=unused-import import runschema.calculation # pylint: disable=unused-import @@ -33,959 +40,1078 @@ class x_gulp_section_main_keyword(MSection): - ''' + """ Section for GULP calculation mode input variable - ''' + """ m_def = Section(validate=False) x_gulp_main_keyword = Quantity( type=str, shape=[], - description=''' + description=""" GULP calculation mode input variable - ''') + """, + ) class x_gulp_section_forcefield(MSection): - ''' + """ Section for GULP force field specification - ''' + """ m_def = Section(validate=False) x_gulp_forcefield_species_1 = Quantity( type=str, shape=[], - description=''' + description=""" GULP force field species 1 - ''') + """, + ) x_gulp_forcefield_species_2 = Quantity( type=str, shape=[], - description=''' + description=""" GULP force field species 2 - ''') + """, + ) x_gulp_forcefield_species_3 = Quantity( type=str, shape=[], - description=''' + description=""" GULP force field species 3 - ''') + """, + ) x_gulp_forcefield_species_4 = Quantity( type=str, shape=[], - description=''' + description=""" GULP force field species 4 - ''') + """, + ) x_gulp_forcefield_speciestype_1 = Quantity( type=str, shape=[], - description=''' + description=""" GULP force field speciestype 1 - ''') + """, + ) x_gulp_forcefield_speciestype_2 = Quantity( type=str, shape=[], - description=''' + description=""" GULP force field speciestype 2 - ''') + """, + ) x_gulp_forcefield_speciestype_3 = Quantity( type=str, shape=[], - description=''' + description=""" GULP force field speciestype 3 - ''') + """, + ) x_gulp_forcefield_speciestype_4 = Quantity( type=str, shape=[], - description=''' + description=""" GULP force field speciestype 4 - ''') + """, + ) x_gulp_forcefield_potential_name = Quantity( type=str, shape=[], - description=''' + description=""" GULP force field potential name - ''') + """, + ) x_gulp_forcefield_parameter_a = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" GULP force field parameter A - ''') + """, + ) x_gulp_forcefield_parameter_b = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" GULP force field parameter B - ''') + """, + ) x_gulp_forcefield_parameter_c = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" GULP force field parameter C - ''') + """, + ) x_gulp_forcefield_parameter_d = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" GULP force field parameter D - ''') + """, + ) x_gulp_forcefield_cutoff_min = Quantity( type=str, shape=[], - description=''' + description=""" GULP force field cutoff min (can also be a string like 3Bond for some reason) - ''') + """, + ) x_gulp_forcefield_cutoff_max = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" GULP force field cutoff max - ''') + """, + ) x_gulp_forcefield_threebody_1 = Quantity( type=str, shape=[], - description=''' + description=""" GULP 3-body force field parameter 1 - ''') + """, + ) x_gulp_forcefield_threebody_2 = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" GULP 3-body force field parameter 2 - ''') + """, + ) x_gulp_forcefield_threebody_3 = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" GULP 3-body force field parameter 3 - ''') + """, + ) x_gulp_forcefield_threebody_theta = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" GULP 3-body force field parameter theta - ''') + """, + ) x_gulp_forcefield_fourbody_force_constant = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" GULP 4-body force field parameter force constant - ''') + """, + ) x_gulp_forcefield_fourbody_sign = Quantity( type=str, shape=[], - description=''' + description=""" GULP 4-body force field parameter sign - ''') + """, + ) x_gulp_forcefield_fourbody_phase = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" GULP 4-body force field parameter phase - ''') + """, + ) x_gulp_forcefield_fourbody_phi0 = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" GULP 4-body force field parameter phi0 - ''') + """, + ) class System(runschema.system.System): - m_def = Section(validate=False, extends_base_section=True) x_gulp_patterson_group = Quantity( type=str, shape=[], - description=''' + description=""" Patterson group - ''') + """, + ) x_gulp_space_group = Quantity( type=str, shape=[], - description=''' + description=""" Space group - ''') + """, + ) x_gulp_formula = Quantity( type=str, shape=[], - description=''' + description=""" GULP chemical formula - ''') + """, + ) x_gulp_cell_alpha = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" grrr - ''') + """, + ) x_gulp_cell_beta = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" grrr - ''') + """, + ) x_gulp_cell_gamma = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" grrr - ''') + """, + ) x_gulp_cell_a = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" grrr - ''') + """, + ) x_gulp_cell_b = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" grrr - ''') + """, + ) x_gulp_cell_c = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" grrr - ''') + """, + ) x_gulp_prim_cell_alpha = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" grrr - ''') + """, + ) x_gulp_prim_cell_beta = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" grrr - ''') + """, + ) x_gulp_prim_cell_gamma = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" grrr - ''') + """, + ) x_gulp_prim_cell_a = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" grrr - ''') + """, + ) x_gulp_prim_cell_b = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" grrr - ''') + """, + ) x_gulp_prim_cell_c = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" grrr - ''') + """, + ) x_gulp_pbc = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' + description=""" grrr - ''') + """, + ) class Run(runschema.run.Run): - m_def = Section(validate=False, extends_base_section=True) x_gulp_title = Quantity( type=str, shape=[], - description=''' + description=""" Title of GULP calculation - ''') + """, + ) x_gulp_n_cpu = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' - ''') + description=""" + """, + ) x_gulp_host_name = Quantity( type=str, shape=[], - description=''' - ''') + description=""" + """, + ) x_gulp_total_n_configurations_input = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' - ''') + description=""" + """, + ) x_gulp_section_main_keyword = SubSection( - sub_section=SectionProxy('x_gulp_section_main_keyword'), - repeats=True) + sub_section=SectionProxy("x_gulp_section_main_keyword"), repeats=True + ) class Method(runschema.method.Method): - m_def = Section(validate=False, extends_base_section=True) x_gulp_number_of_species = Quantity( type=int, shape=[], - description=''' + description=""" Number of species in GULP - ''') + """, + ) x_gulp_species_charge = Quantity( - type=np.dtype(np.float64), - shape=['x_gulp_number_of_species'], - description=''' + type=np.float64, + shape=["x_gulp_number_of_species"], + description=""" Number of species in GULP - ''') + """, + ) x_gulp_section_forcefield = SubSection( - sub_section=SectionProxy('x_gulp_section_forcefield'), - repeats=True) + sub_section=SectionProxy("x_gulp_section_forcefield"), repeats=True + ) class AtomParameters(runschema.method.AtomParameters): - m_def = Section(validate=False, extends_base_section=True) x_gulp_type = Quantity( type=str, shape=[], - description=''' - ''') + description=""" + """, + ) x_gulp_covalent_radius = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='m', - description=''' - ''') + unit="m", + description=""" + """, + ) x_gulp_ionic_radius = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='m', - description=''' - ''') + unit="m", + description=""" + """, + ) x_gulp_vdw_radius = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='m', - description=''' - ''') + unit="m", + description=""" + """, + ) class Energy(runschema.calculation.Energy): - m_def = Section(validate=False, extends_base_section=True) x_gulp_attachment_energy = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='joule', - description=''' + unit="joule", + description=""" GULP energy term for attachment_energy - ''') + """, + ) x_gulp_attachment_unit = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='joule', - description=''' + unit="joule", + description=""" GULP energy term for attachment_energy_unit - ''') + """, + ) x_gulp_bond_order_potentials = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='joule', - description=''' + unit="joule", + description=""" GULP energy term for bond_order_potentials - ''') + """, + ) x_gulp_brenner_potentials = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='joule', - description=''' + unit="joule", + description=""" GULP energy term for brenner_potentials - ''') + """, + ) x_gulp_bulk = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='joule', - description=''' + unit="joule", + description=""" GULP energy term for bulk_energy - ''') + """, + ) x_gulp_dispersion_real_recip = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='joule', - description=''' + unit="joule", + description=""" GULP energy term for dispersion_real_recip - ''') + """, + ) x_gulp_electric_field_times_distance = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='joule', - description=''' + unit="joule", + description=""" GULP energy term for electric_field_times_distance - ''') + """, + ) x_gulp_shift = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='joule', - description=''' + unit="joule", + description=""" GULP energy term for energy_shift - ''') + """, + ) x_gulp_four_body_potentials = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='joule', - description=''' + unit="joule", + description=""" GULP energy term for four_body_potentials - ''') + """, + ) x_gulp_improper_torsions = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='joule', - description=''' + unit="joule", + description=""" GULP energy term for improper_torsions - ''') + """, + ) x_gulp_interatomic_potentials = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='joule', - description=''' + unit="joule", + description=""" GULP energy term for interatomic_potentials - ''') + """, + ) x_gulp_many_body_potentials = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='joule', - description=''' + unit="joule", + description=""" GULP energy term for many_body_potentials - ''') + """, + ) x_gulp_monopole_monopole_real = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='joule', - description=''' + unit="joule", + description=""" GULP energy term for monopole_monopole_real - ''') + """, + ) x_gulp_monopole_monopole_recip = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='joule', - description=''' + unit="joule", + description=""" GULP energy term for monopole_monopole_recip - ''') + """, + ) x_gulp_monopole_monopole_total = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='joule', - description=''' + unit="joule", + description=""" GULP energy term for monopole_monopole_total - ''') + """, + ) x_gulp_neutralising = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='joule', - description=''' + unit="joule", + description=""" GULP energy term for neutralising_energy - ''') + """, + ) x_gulp_non_primitive_unit_cell = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='joule', - description=''' + unit="joule", + description=""" GULP energy term for non_primitive_unit_cell - ''') + """, + ) x_gulp_out_of_plane_potentials = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='joule', - description=''' + unit="joule", + description=""" GULP energy term for out_of_plane_potentials - ''') + """, + ) x_gulp_primitive_unit_cell = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='joule', - description=''' + unit="joule", + description=""" GULP energy term for primitive_unit_cell - ''') + """, + ) x_gulp_reaxff_force_field = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='joule', - description=''' + unit="joule", + description=""" GULP energy term for reaxff_force_field - ''') + """, + ) x_gulp_region_1_2_interaction = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='joule', - description=''' + unit="joule", + description=""" GULP energy term for region_1_2_interaction - ''') + """, + ) x_gulp_region_2_2_interaction = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='joule', - description=''' + unit="joule", + description=""" GULP energy term for region_2_2_interaction - ''') + """, + ) x_gulp_self_eem_qeq_sm = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='joule', - description=''' + unit="joule", + description=""" GULP energy term for self_energy_eem_qeq_sm - ''') + """, + ) x_gulp_sm_coulomb_correction = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='joule', - description=''' + unit="joule", + description=""" GULP energy term for sm_coulomb_correction - ''') + """, + ) x_gulp_solvation = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='joule', - description=''' + unit="joule", + description=""" GULP energy term for solvation_energy - ''') + """, + ) x_gulp_three_body_potentials = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='joule', - description=''' + unit="joule", + description=""" GULP energy term for three_body_potentials - ''') + """, + ) - x_gulp_total_averaged = SubSection(sub_section=runschema.calculation.EnergyEntry.m_def) + x_gulp_total_averaged = SubSection( + sub_section=runschema.calculation.EnergyEntry.m_def + ) class x_gulp_bulk_optimisation_cycle(MSection): - m_def = Section(validate=False) x_gulp_energy = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='joule', - description=''' - ''') + unit="joule", + description=""" + """, + ) x_gulp_gnorm = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' - ''') + description=""" + """, + ) x_gulp_cpu_time = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='s', - description=''' - ''') + unit="s", + description=""" + """, + ) class x_gulp_bulk_optimisation(MSection): - m_def = Section(validate=False) x_gulp_n_variables = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' - ''') + description=""" + """, + ) x_gulp_max_n_calculations = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' - ''') + description=""" + """, + ) x_gulp_max_hessian_update_interval = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' - ''') + description=""" + """, + ) x_gulp_max_step_size = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' - ''') + description=""" + """, + ) x_gulp_max_parameter_tolerance = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' - ''') + description=""" + """, + ) x_gulp_max_function_tolerance = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' - ''') + description=""" + """, + ) x_gulp_max_gradient_tolerance = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' - ''') + description=""" + """, + ) x_gulp_max_gradient_component = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' - ''') + description=""" + """, + ) x_gulp_optimiser = Quantity( type=str, shape=[], - description=''' - ''') + description=""" + """, + ) x_gulp_hessian_updater = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' - ''') + description=""" + """, + ) - x_gulp_bulk_optimisation_cycle = SubSection(sub_section=x_gulp_bulk_optimisation_cycle, repeats=True) + x_gulp_bulk_optimisation_cycle = SubSection( + sub_section=x_gulp_bulk_optimisation_cycle, repeats=True + ) class Calculation(runschema.calculation.Calculation): - m_def = Section(validate=False, extends_base_section=True) x_gulp_md_time = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" GULP molecular dynamics time - ''') + """, + ) x_gulp_md_kinetic_energy = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" GULP molecular dynamics kinetic energy - ''') + """, + ) x_gulp_md_potential_energy = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" GULP molecular dynamics potential energy - ''') + """, + ) x_gulp_md_total_energy = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" GULP molecular dynamics total energy - ''') + """, + ) x_gulp_md_temperature = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" GULP molecular dynamics temperature - ''') + """, + ) x_gulp_md_pressure = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" GULP molecular dynamics pressure - ''') + """, + ) x_gulp_temperature_averaged = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='kelvin', - description=''' - ''') + unit="kelvin", + description=""" + """, + ) x_gulp_pressure_averaged = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='pascal', - description=''' - ''') + unit="pascal", + description=""" + """, + ) x_gulp_piezoelectric_strain_matrix = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[3, 6], - unit='C / m**2', - description=''' - ''') + unit="C / m**2", + description=""" + """, + ) x_gulp_piezoelectric_stress_matrix = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[3, 6], - unit='C / N', - description=''' - ''') + unit="C / N", + description=""" + """, + ) x_gulp_static_dielectric_constant_tensor = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[3, 3], - description=''' - ''') + description=""" + """, + ) x_gulp_high_frequency_dielectric_constant_tensor = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[3, 3], - description=''' - ''') + description=""" + """, + ) x_gulp_static_refractive_indices = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[3], - description=''' - ''') + description=""" + """, + ) x_gulp_high_frequency_refractive_indices = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[3], - description=''' - ''') + description=""" + """, + ) x_gulp_bulk_optimisation = SubSection(sub_section=x_gulp_bulk_optimisation.m_def) class ElasticResults(simulationworkflowschema.ElasticResults): - m_def = Section(validate=False, extends_base_section=True) x_gulp_velocity_s_wave_reuss = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='m / s', - description=''' - ''') + unit="m / s", + description=""" + """, + ) x_gulp_velocity_s_wave_voigt = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='m / s', - description=''' - ''') + unit="m / s", + description=""" + """, + ) x_gulp_velocity_s_wave_hill = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='m / s', - description=''' - ''') + unit="m / s", + description=""" + """, + ) x_gulp_velocity_p_wave_reuss = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='m / s', - description=''' - ''') + unit="m / s", + description=""" + """, + ) x_gulp_velocity_p_wave_voigt = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='m / s', - description=''' - ''') + unit="m / s", + description=""" + """, + ) x_gulp_velocity_p_wave_hill = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='m / s', - description=''' - ''') + unit="m / s", + description=""" + """, + ) x_gulp_compressibility = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='1 / pascal', - description=''' - ''') + unit="1 / pascal", + description=""" + """, + ) # TODO determine if these values can be transformed to the top level definitions x_gulp_youngs_modulus_x = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='pascal', - description=''' - ''') + unit="pascal", + description=""" + """, + ) x_gulp_youngs_modulus_y = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='pascal', - description=''' - ''') + unit="pascal", + description=""" + """, + ) x_gulp_youngs_modulus_z = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='pascal', - description=''' - ''') + unit="pascal", + description=""" + """, + ) x_gulp_poissons_ratio = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[3, 3], - description=''' - ''') + description=""" + """, + ) class MolecularDynamics(simulationworkflowschema.MolecularDynamics): - m_def = Section(validate=False, extends_base_section=True) x_gulp_friction_temperature_bath = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' - ''') + description=""" + """, + ) x_gulp_n_mobile_ions = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' - ''') + description=""" + """, + ) x_gulp_n_degrees_of_freedom = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' - ''') + description=""" + """, + ) x_gulp_equilibration_time = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='s', - description=''' - ''') + unit="s", + description=""" + """, + ) x_gulp_production_time = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='s', - description=''' - ''') + unit="s", + description=""" + """, + ) x_gulp_scaling_time = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='s', - description=''' - ''') + unit="s", + description=""" + """, + ) x_gulp_scaling_frequency = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='s', - description=''' - ''') + unit="s", + description=""" + """, + ) x_gulp_sampling_frequency = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='s', - description=''' - ''') + unit="s", + description=""" + """, + ) x_gulp_write_frequency = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='s', - description=''' - ''') + unit="s", + description=""" + """, + ) x_gulp_td_force_start_time = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='s', - description=''' - ''') + unit="s", + description=""" + """, + ) x_gulp_td_field_start_time = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='s', - description=''' - ''') + unit="s", + description=""" + """, + ) diff --git a/atomisticparsers/gulp/parser.py b/atomisticparsers/gulp/parser.py index 98964f32..f7e206f4 100644 --- a/atomisticparsers/gulp/parser.py +++ b/atomisticparsers/gulp/parser.py @@ -1092,7 +1092,7 @@ def write_to_archive(self) -> None: sec_model.contributions.append( Interaction( functional_form=interaction.functional_form, - atom_labels=[v[0] for v in interaction.get("atom_type")], + atom_labels=[[v[0] for v in interaction.get("atom_type")]], parameters={ key: float(val) if isinstance(val, np.float64) else val for key, val in interaction.get("key_parameter", []) diff --git a/atomisticparsers/h5md/metainfo/h5md.py b/atomisticparsers/h5md/metainfo/h5md.py index edd7b52e..f2621e1e 100644 --- a/atomisticparsers/h5md/metainfo/h5md.py +++ b/atomisticparsers/h5md/metainfo/h5md.py @@ -88,7 +88,7 @@ class CalcEntry(MSection): ) value = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], description=""" Value of this contribution. @@ -220,7 +220,7 @@ class Run(runschema.run.Run): # TODO Not sure how we are dealing with versioning with H5MD-NOMAD x_h5md_version = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[2], description=""" Specifies the version of the h5md schema being followed. diff --git a/atomisticparsers/h5md/parser.py b/atomisticparsers/h5md/parser.py index 94c184fc..4b1823a0 100644 --- a/atomisticparsers/h5md/parser.py +++ b/atomisticparsers/h5md/parser.py @@ -379,9 +379,9 @@ def get_observable_paths(observable_group: Dict, current_path: str) -> List: if observable_label else f"{observable_name}" ) - self._observable_info[observable_type][step][ - observable_key - ] = values[i_step] + self._observable_info[observable_type][step][observable_key] = ( + values[i_step] + ) else: if observable_name not in self._observable_info[observable_type].keys(): self._observable_info[observable_type][observable_name] = {} @@ -704,25 +704,42 @@ def get_workflow_properties_dict( property_type_key=None, property_type_value_key=None, properties_known={}, - property_keys_list=[], - property_value_keys_list=[], + property_def: MSection = None, + property_value_def: MSection = None, ): + property_quantities = property_def.all_quantities + property_value_quantities = property_value_def.all_quantities + + def reshape(quantity_name, val): + quantity_def = property_quantities.get( + quantity_name, property_value_quantities.get(quantity_name) + ) + units = val.units if hasattr(val, "units") else None + magnitude = val.magnitude if units else val + if ( + quantity_def + and quantity_def.shape + and not isinstance(magnitude, (np.ndarray, list)) + ): + magnitude = [magnitude] + return magnitude * units if units else magnitude + def populate_property_dict( property_dict, val_name, val, flag_known_property=False ): if val is None: return - value_unit = val.units if hasattr(val, "units") else None - value_magnitude = val.magnitude if hasattr(val, "units") else val if flag_known_property: - property_dict[val_name] = ( - value_magnitude * value_unit if value_unit else value_magnitude - ) + property_dict[val_name] = reshape(val_name, val) else: + val = reshape(f"{val_name}_magnitude", val) + value_unit = val.units if hasattr(val, "units") else None property_dict[f"{val_name}_unit"] = ( str(value_unit) if value_unit else None ) - property_dict[f"{val_name}_magnitude"] = value_magnitude + property_dict[f"{val_name}_magnitude"] = ( + val.magnitude if value_unit else val + ) workflow_properties_dict: Dict[Any, Any] = {} for observable_type, observable_dict in observables.items(): @@ -740,9 +757,10 @@ def populate_property_dict( continue if quant_name == "bins": continue - if quant_name in property_keys_list: + val = reshape(quant_name, val) + if quant_name in property_quantities: property_dict[quant_name] = val - if quant_name in property_value_keys_list: + if quant_name in property_value_quantities: property_values_dict[quant_name] = val # TODO Still need to add custom values here. @@ -784,8 +802,8 @@ def parse_workflow(self): "properties_known": { "radial_distribution_functions": "radial_distribution_function_values" }, - "property_keys_list": EnsembleProperty.m_def.all_quantities.keys(), - "property_value_keys_list": EnsemblePropertyValues.m_def.all_quantities.keys(), + "property_def": EnsembleProperty.m_def, + "property_value_def": EnsemblePropertyValues.m_def, } workflow_results.update( self.get_workflow_properties_dict( @@ -801,8 +819,8 @@ def parse_workflow(self): "properties_known": { "mean_squared_displacements": "mean_squared_displacement_values" }, - "property_keys_list": CorrelationFunction.m_def.all_quantities.keys(), - "property_value_keys_list": CorrelationFunctionValues.m_def.all_quantities.keys(), + "property_def": CorrelationFunction.m_def, + "property_value_def": CorrelationFunctionValues.m_def, } workflow_results.update( self.get_workflow_properties_dict( diff --git a/atomisticparsers/lammps/metainfo/lammps.py b/atomisticparsers/lammps/metainfo/lammps.py index 8f2f5bad..2e979199 100644 --- a/atomisticparsers/lammps/metainfo/lammps.py +++ b/atomisticparsers/lammps/metainfo/lammps.py @@ -16,11 +16,18 @@ # 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 +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 + MSection, + MCategory, + Category, + Package, + Quantity, + Section, + SubSection, + SectionProxy, + Reference, ) import runschema.run # pylint: disable=unused-import import runschema.calculation # pylint: disable=unused-import @@ -33,1223 +40,1378 @@ class System(runschema.system.System): - m_def = Section(validate=False, extends_base_section=True) x_lammps_atom_positions_image_index = Quantity( - type=np.dtype(np.int32), - shape=['number_of_atoms', 3], - unit='dimensionless', - description=''' + type=np.int32, + shape=["number_of_atoms", 3], + unit="dimensionless", + description=""" PBC image flag index. - ''') + """, + ) x_lammps_atom_positions_scaled = Quantity( - type=np.dtype(np.float64), - shape=['number_of_atoms', 3], - unit='dimensionless', - description=''' + type=np.float64, + shape=["number_of_atoms", 3], + unit="dimensionless", + description=""" Position of the atoms in a scaled format [0, 1]. - ''') + """, + ) x_lammps_atom_positions_wrapped = Quantity( - type=np.dtype(np.float64), - shape=['number_of_atoms', 3], - unit='meter', - description=''' + type=np.float64, + shape=["number_of_atoms", 3], + unit="meter", + description=""" Position of the atoms wrapped back to the periodic box. - ''') + """, + ) x_lammps_trj_timestep_store = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_lammps_trj_number_of_atoms_store = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_lammps_trj_box_bound_store = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_lammps_trj_box_bounds_store = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_lammps_trj_variables_store = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_lammps_trj_atoms_store = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) class MolecularDynamics(simulationworkflowschema.MolecularDynamics): - m_def = Section(validate=False, extends_base_section=True) x_lammps_barostat_target_pressure = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='pascal', - description=''' + unit="pascal", + description=""" MD barostat target pressure. - ''') + """, + ) x_lammps_barostat_tau = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='second', - description=''' + unit="second", + description=""" MD barostat relaxation time. - ''') + """, + ) x_lammps_barostat_type = Quantity( type=str, shape=[], - description=''' + description=""" MD barostat type, valid values are defined in the barostat_type wiki page. - ''') + """, + ) x_lammps_integrator_dt = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='second', - description=''' + unit="second", + description=""" MD integration time step. - ''') + """, + ) x_lammps_integrator_type = Quantity( type=str, shape=[], - description=''' + description=""" MD integrator type, valid values are defined in the integrator_type wiki page. - ''') + """, + ) x_lammps_langevin_gamma = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='second', - description=''' + unit="second", + description=""" Langevin thermostat damping factor. - ''') + """, + ) x_lammps_number_of_steps_requested = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" Number of requested MD integration time steps. - ''') + """, + ) x_lammps_thermostat_level = Quantity( type=str, shape=[], - description=''' + description=""" MD thermostat level (see wiki: single, multiple, regional). - ''') + """, + ) x_lammps_thermostat_target_temperature = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='kelvin', - description=''' + unit="kelvin", + description=""" MD thermostat target temperature. - ''') + """, + ) x_lammps_thermostat_tau = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='second', - description=''' + unit="second", + description=""" MD thermostat relaxation time. - ''') + """, + ) x_lammps_thermostat_type = Quantity( type=str, shape=[], - description=''' + description=""" MD thermostat type, valid values are defined in the thermostat_type wiki page. - ''') + """, + ) class Interaction(runschema.method.Interaction): - m_def = Section(validate=False, extends_base_section=True) x_lammps_interaction_atom_to_atom_type_ref = Quantity( type=runschema.method.AtomParameters, - shape=['number_of_atoms_per_interaction'], - description=''' + shape=["number_of_atoms_per_interaction"], + description=""" Reference to the atom type of each interaction atoms. - ''') + """, + ) x_lammps_number_of_defined_pair_interactions = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' + description=""" Number of defined pair interactions (L-J pairs). - ''') + """, + ) x_lammps_pair_interaction_atom_type_ref = Quantity( type=runschema.method.AtomParameters, - shape=['x_lammps_number_of_defined_pair_interactions', 'number_of_atoms_per_interaction'], - description=''' + shape=[ + "x_lammps_number_of_defined_pair_interactions", + "number_of_atoms_per_interaction", + ], + description=""" Reference to the atom type for pair interactions. - ''') + """, + ) x_lammps_pair_interaction_parameters = Quantity( - type=np.dtype(np.float64), - shape=['x_lammps_number_of_defined_pair_interactions', 2], - description=''' + type=np.float64, + shape=["x_lammps_number_of_defined_pair_interactions", 2], + description=""" Pair interactions parameters. - ''') + """, + ) x_lammps_molecule_interaction_atom_to_atom_type_ref = Quantity( type=runschema.method.AtomParameters, - shape=['number_of_atoms_per_interaction'], - description=''' + shape=["number_of_atoms_per_interaction"], + description=""" Reference to the atom type of each molecule interaction atoms. - ''') + """, + ) x_lammps_number_of_defined_molecule_pair_interactions = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' + description=""" Number of defined pair interactions within a molecule (L-J pairs). - ''') + """, + ) x_lammps_pair_molecule_interaction_parameters = Quantity( - type=np.dtype(np.float64), - shape=['number_of_defined_molecule_pair_interactions', 2], - description=''' + type=np.float64, + shape=["number_of_defined_molecule_pair_interactions", 2], + description=""" Molecule pair interactions parameters. - ''') + """, + ) x_lammps_pair_molecule_interaction_to_atom_type_ref = Quantity( type=runschema.method.AtomParameters, - shape=['x_lammps_number_of_defined_pair_interactions', 'number_of_atoms_per_interaction'], - description=''' + shape=[ + "x_lammps_number_of_defined_pair_interactions", + "number_of_atoms_per_interaction", + ], + description=""" Reference to the atom type for pair interactions within a molecule. - ''') + """, + ) class x_lammps_section_input_output_files(MSection): - ''' + """ Section to store input and output file names - ''' + """ m_def = Section(validate=False) x_lammps_inout_file_data = Quantity( type=str, shape=[], - description=''' + description=""" Lammps input data file. - ''') + """, + ) x_lammps_inout_file_trajectory = Quantity( type=str, shape=[], - description=''' + description=""" Lammps input trajectory file. - ''') + """, + ) class x_lammps_section_control_parameters(MSection): - ''' + """ Section to store the input and output control parameters - ''' + """ m_def = Section(validate=False) x_lammps_inout_control_anglecoeff = Quantity( type=str, shape=[], - description=''' + description=""" Specify the angle force field coefficients for one or more angle types. - ''') + """, + ) x_lammps_inout_control_anglestyle = Quantity( type=str, shape=[], - description=''' + description=""" Set the formula(s) LAMMPS uses to compute angle interactions between triplets of atoms, which remain in force for the duration of the simulation. - ''') + """, + ) x_lammps_inout_control_atommodify = Quantity( type=str, shape=[], - description=''' + description=""" Modify certain attributes of atoms defined and stored within LAMMPS, in addition to what is specified by the atom_style command. - ''') + """, + ) x_lammps_inout_control_atomstyle = Quantity( type=str, shape=[], - description=''' + description=""" Define what style of atoms to use in a simulation. - ''') + """, + ) x_lammps_inout_control_balance = Quantity( type=str, shape=[], - description=''' + description=""" This command adjusts the size and shape of processor sub-domains within the simulation box, to attempt to balance the number of atoms or particles and thus indirectly the computational cost (load) more evenly across processors. - ''') + """, + ) x_lammps_inout_control_bondcoeff = Quantity( type=str, shape=[], - description=''' + description=""" Specify the bond force field coefficients for one or more bond type. - ''') + """, + ) x_lammps_inout_control_bondstyle = Quantity( type=str, shape=[], - description=''' + description=""" Set the formula(s) LAMMPS uses to compute bond interactions between pairs of atoms. - ''') + """, + ) x_lammps_inout_control_bondwrite = Quantity( type=str, shape=[], - description=''' + description=""" Write energy and force values to a file as a function of distance for the currently defined bond potential. - ''') + """, + ) x_lammps_inout_control_boundary = Quantity( type=str, shape=[], - description=''' + description=""" Set the style of boundaries for the global simulation box in each dimension. - ''') + """, + ) x_lammps_inout_control_box = Quantity( type=str, shape=[], - description=''' + description=""" Set attributes of the simulation box. - ''') + """, + ) x_lammps_inout_control_changebox = Quantity( type=str, shape=[], - description=''' + description=""" Change the volume and/or shape and/or boundary conditions for the simulation box. - ''') + """, + ) x_lammps_inout_control_clear = Quantity( type=str, shape=[], - description=''' + description=""" This command deletes all atoms, restores all settings to their default values, and frees all memory allocated by LAMMPS. - ''') + """, + ) x_lammps_inout_control_commmodify = Quantity( type=str, shape=[], - description=''' + description=""" This command sets parameters that affect the inter-processor communication of atom information that occurs each timestep as coordinates and other properties are exchanged between neighboring processors and stored as properties of ghost atoms. - ''') + """, + ) x_lammps_inout_control_commstyle = Quantity( type=str, shape=[], - description=''' + description=""" This command sets the style of inter-processor communication of atom information that occurs each timestep as coordinates and other properties are exchanged between neighboring processors and stored as properties of ghost atoms. - ''') + """, + ) x_lammps_inout_control_compute = Quantity( type=str, shape=[], - description=''' + description=""" Define a computation that will be performed on a group of atoms. - ''') + """, + ) x_lammps_inout_control_computemodify = Quantity( type=str, shape=[], - description=''' + description=""" Modify one or more parameters of a previously defined compute. - ''') + """, + ) x_lammps_inout_control_createatoms = Quantity( type=str, shape=[], - description=''' + description=""" This command creates atoms (or molecules) on a lattice, or a single atom (or molecule), or a random collection of atoms (or molecules), as an alternative to reading in their coordinates explicitly via a read_data or read_restart command. - ''') + """, + ) x_lammps_inout_control_createbonds = Quantity( type=str, shape=[], - description=''' + description=""" Create bonds between pairs of atoms that meet a specified distance criteria. - ''') + """, + ) x_lammps_inout_control_createbox = Quantity( type=str, shape=[], - description=''' + description=""" This command creates a simulation box based on the specified region. - ''') + """, + ) x_lammps_inout_control_deleteatoms = Quantity( type=str, shape=[], - description=''' + description=""" Delete the specified atoms. - ''') + """, + ) x_lammps_inout_control_deletebonds = Quantity( type=str, shape=[], - description=''' + description=""" Turn off (or on) molecular topology interactions, i.e. bonds, angles, dihedrals, impropers. - ''') + """, + ) x_lammps_inout_control_dielectric = Quantity( type=str, shape=[], - description=''' + description=""" Set the dielectric constant for Coulombic interactions (pairwise and long-range) to this value. - ''') + """, + ) x_lammps_inout_control_dihedralcoeff = Quantity( type=str, shape=[], - description=''' + description=""" Specify the dihedral force field coefficients for one or more dihedral types. - ''') + """, + ) x_lammps_inout_control_dihedralstyle = Quantity( type=str, shape=[], - description=''' + description=""" Set the formula(s) LAMMPS uses to compute dihedral interactions between quadruplets of atoms, which remain in force for the duration of the simulation. - ''') + """, + ) x_lammps_inout_control_dimension = Quantity( type=str, shape=[], - description=''' + description=""" Set the dimensionality of the simulation. - ''') + """, + ) x_lammps_inout_control_displaceatoms = Quantity( type=str, shape=[], - description=''' + description=""" Displace a group of atoms. - ''') + """, + ) x_lammps_inout_control_dump = Quantity( type=str, shape=[], - description=''' + description=""" Dump a snapshot of atom quantities to one or more files every N timesteps in one of several styles. - ''') + """, + ) x_lammps_inout_control_dynamicalmatrix = Quantity( type=str, shape=[], - description=''' + description=""" Calculate the dynamical matrix by finite difference of the selected group. - ''') + """, + ) x_lammps_inout_control_echo = Quantity( type=str, shape=[], - description=''' + description=""" This command determines whether LAMMPS echoes each input script command to the screen and/or log file as it is read and processed. - ''') + """, + ) x_lammps_inout_control_fix = Quantity( type=str, shape=[], - description=''' + description=""" Set a fix that will be applied to a group of atoms. In LAMMPS, a “fix” is any operation that is applied to the system during timestepping or minimization - ''') + """, + ) x_lammps_inout_control_fixmodify = Quantity( type=str, shape=[], - description=''' + description=""" Modify one or more parameters of a previously defined fix. - ''') + """, + ) x_lammps_inout_control_group = Quantity( type=str, shape=[], - description=''' + description=""" Identify a collection of atoms as belonging to a group. - ''') + """, + ) x_lammps_inout_control_group2ndx = Quantity( type=str, shape=[], - description=''' + description=""" Write or read a Gromacs style index file in text format that associates atom IDs with the corresponding group definitions. The group2ndx command will write group definitions to an index file. - ''') + """, + ) x_lammps_inout_control_ndx2group = Quantity( type=str, shape=[], - description=''' + description=""" Write or read a Gromacs style index file in text format that associates atom IDs with the corresponding group definitions. The ndx2group command will create of update group definitions from those stored in an index file. - ''') + """, + ) x_lammps_inout_control_hyper = Quantity( type=str, shape=[], - description=''' + description=""" Run a bond-boost hyperdynamics (HD) simulation where time is accelerated by application of a bias potential to one or more pairs of nearby atoms in the system. - ''') + """, + ) x_lammps_inout_control_if = Quantity( type=str, shape=[], - description=''' + description=""" This command provides an if-then-else capability within an input script. - ''') + """, + ) x_lammps_inout_control_impropercoeff = Quantity( type=str, shape=[], - description=''' + description=""" Specify the improper force field coefficients for one or more improper types. - ''') + """, + ) x_lammps_inout_control_improperstyle = Quantity( type=str, shape=[], - description=''' + description=""" Set the formula(s) LAMMPS uses to compute improper interactions between quadruplets of atoms, which remain in force for the duration of the simulation. - ''') + """, + ) x_lammps_inout_control_include = Quantity( type=str, shape=[], - description=''' + description=""" This command opens a new input script file and begins reading LAMMPS commands from that file. - ''') + """, + ) x_lammps_inout_control_info = Quantity( type=str, shape=[], - description=''' + description=""" Print out information about the current internal state of the running LAMMPS process. - ''') + """, + ) x_lammps_inout_control_jump = Quantity( type=str, shape=[], - description=''' + description=""" This command closes the current input script file, opens the file with the specified name, and begins reading LAMMPS commands from that file. - ''') + """, + ) x_lammps_inout_control_kiminit = Quantity( type=str, shape=[], - description=''' + description=""" The set of kim_commands provide a high-level wrapper around the Open Knowledgebase of Interatomic Models (OpenKIM) repository of interatomic models (IMs) (potentials and force fields), so that they can be used by LAMMPS scripts. - ''') + """, + ) x_lammps_inout_control_kiminteractions = Quantity( type=str, shape=[], - description=''' + description=""" The set of kim_commands provide a high-level wrapper around the Open Knowledgebase of Interatomic Models (OpenKIM) repository of interatomic models (IMs) (potentials and force fields), so that they can be used by LAMMPS scripts. - ''') + """, + ) x_lammps_inout_control_kimquery = Quantity( type=str, shape=[], - description=''' + description=""" The set of kim_commands provide a high-level wrapper around the Open Knowledgebase of Interatomic Models (OpenKIM) repository of interatomic models (IMs) (potentials and force fields), so that they can be used by LAMMPS scripts. - ''') + """, + ) x_lammps_inout_control_kimparam = Quantity( type=str, shape=[], - description=''' + description=""" The set of kim_commands provide a high-level wrapper around the Open Knowledgebase of Interatomic Models (OpenKIM) repository of interatomic models (IMs) (potentials and force fields), so that they can be used by LAMMPS scripts. - ''') + """, + ) x_lammps_inout_control_kimproperty = Quantity( type=str, shape=[], - description=''' + description=""" The set of kim_commands provide a high-level wrapper around the Open Knowledgebase of Interatomic Models (OpenKIM) repository of interatomic models (IMs) (potentials and force fields), so that they can be used by LAMMPS scripts. - ''') + """, + ) x_lammps_inout_control_kspacemodify = Quantity( type=str, shape=[], - description=''' + description=""" Set parameters used by the kspace solvers defined by the kspace_style command. Not all parameters are relevant to all kspace styles. - ''') + """, + ) x_lammps_inout_control_kspacestyle = Quantity( type=str, shape=[], - description=''' + description=""" Define a long-range solver for LAMMPS to use each timestep to compute long-range Coulombic interactions or long-range interactions. - ''') + """, + ) x_lammps_inout_control_label = Quantity( type=str, shape=[], - description=''' + description=""" Label this line of the input script with the chosen ID. - ''') + """, + ) x_lammps_inout_control_lattice = Quantity( type=str, shape=[], - description=''' + description=""" Define a lattice for use by other commands. - ''') + """, + ) x_lammps_inout_control_log = Quantity( type=str, shape=[], - description=''' + description=""" This command closes the current LAMMPS log file, opens a new file with the specified name, and begins logging information to it. - ''') + """, + ) x_lammps_inout_control_mass = Quantity( type=str, shape=[], - description=''' + description=""" Set the mass for all atoms of one or more atom types. - ''') + """, + ) x_lammps_inout_control_message = Quantity( type=str, shape=[], - description=''' + description=""" Establish a messaging protocol between LAMMPS and another code for the purpose of client/server coupling. - ''') + """, + ) x_lammps_inout_control_minmodify = Quantity( type=str, shape=[], - description=''' + description=""" This command sets parameters that affect the energy minimization algorithms selected by the min_style command. - ''') + """, + ) x_lammps_inout_control_minstyle = Quantity( type=str, shape=[], - description=''' + description=""" Apply a minimization algorithm to use when a minimize command is performed. - ''') + """, + ) x_lammps_inout_control_minimize = Quantity( type=str, shape=[], - description=''' + description=""" Perform an energy minimization of the system, by iteratively adjusting atom coordinates. - ''') + """, + ) x_lammps_inout_control_molecule = Quantity( type=str, shape=[], - description=''' + description=""" Define a molecule template that can be used as part of other LAMMPS commands, typically to define a collection of particles as a bonded molecule or a rigid body. - ''') + """, + ) x_lammps_inout_control_neb = Quantity( type=str, shape=[], - description=''' + description=""" Perform a nudged elastic band (NEB) calculation using multiple replicas of a system. - ''') + """, + ) x_lammps_inout_control_neighmodify = Quantity( type=str, shape=[], - description=''' + description=""" This command sets parameters that affect the building and use of pairwise neighbor lists. - ''') + """, + ) x_lammps_inout_control_neighbor = Quantity( type=str, shape=[], - description=''' + description=""" This command sets parameters that affect the building of pairwise neighbor lists. - ''') + """, + ) x_lammps_inout_control_newton = Quantity( type=str, shape=[], - description=''' + description=""" This command turns Newton’s third law on or off for pairwise and bonded interactions. - ''') + """, + ) x_lammps_inout_control_next = Quantity( type=str, shape=[], - description=''' + description=""" This command is used with variables defined by the variable command. - ''') + """, + ) x_lammps_inout_control_package = Quantity( type=str, shape=[], - description=''' + description=""" This command invokes package-specific settings for the various accelerator packages available in LAMMPS. - ''') + """, + ) x_lammps_inout_control_paircoeff = Quantity( type=str, shape=[], - description=''' + description=""" Specify the pairwise force field coefficients for one or more pairs of atom types. - ''') + """, + ) x_lammps_inout_control_pairmodify = Quantity( type=str, shape=[], - description=''' + description=""" Modify the parameters of the currently defined pair style. - ''') + """, + ) x_lammps_inout_control_pairstyle = Quantity( type=str, shape=[], - description=''' + description=""" Set the formula(s) LAMMPS uses to compute pairwise interactions. - ''') + """, + ) x_lammps_inout_control_pairwrite = Quantity( type=str, shape=[], - description=''' + description=""" Write energy and force values to a file as a function of distance for the currently defined pair potential. - ''') + """, + ) x_lammps_inout_control_partition = Quantity( type=str, shape=[], - description=''' + description=""" This command invokes the specified command on a subset of the partitions of processors you have defined via the -partition command-line switch. - ''') + """, + ) x_lammps_inout_control_prd = Quantity( type=str, shape=[], - description=''' + description=""" Run a parallel replica dynamics (PRD) simulation using multiple replicas of a system. - ''') + """, + ) x_lammps_inout_control_print = Quantity( type=str, shape=[], - description=''' + description=""" Print a text string to the screen and logfile. - ''') + """, + ) x_lammps_inout_control_processors = Quantity( type=str, shape=[], - description=''' + description=""" Specify how processors are mapped as a regular 3d grid to the global simulation box. - ''') + """, + ) x_lammps_inout_control_quit = Quantity( type=str, shape=[], - description=''' + description=""" This command causes LAMMPS to exit, after shutting down all output cleanly. - ''') + """, + ) x_lammps_inout_control_readdata = Quantity( type=str, shape=[], - description=''' + description=""" Read in a data file containing information LAMMPS needs to run a simulation. - ''') + """, + ) x_lammps_inout_control_readdump = Quantity( type=str, shape=[], - description=''' + description=""" Read atom information from a dump file to overwrite the current atom coordinates, and optionally the atom velocities and image flags and the simulation box dimensions. - ''') + """, + ) x_lammps_inout_control_readrestart = Quantity( type=str, shape=[], - description=''' + description=""" Read in a previously saved system configuration from a restart file. - ''') + """, + ) x_lammps_inout_control_region = Quantity( type=str, shape=[], - description=''' + description=""" This command defines a geometric region of space. - ''') + """, + ) x_lammps_inout_control_replicate = Quantity( type=str, shape=[], - description=''' + description=""" Replicate the current simulation one or more times in each dimension. - ''') + """, + ) x_lammps_inout_control_rerun = Quantity( type=str, shape=[], - description=''' + description=""" Perform a pseudo simulation run where atom information is read one snapshot at a time from a dump file(s), and energies and forces are computed on the shapshot to produce thermodynamic or other output. - ''') + """, + ) x_lammps_inout_control_resetatomids = Quantity( type=str, shape=[], - description=''' + description=""" Reset atom IDs for the system, including all the global IDs stored for bond, angle, dihedral, improper topology data. - ''') + """, + ) x_lammps_inout_control_resetmolids = Quantity( type=str, shape=[], - description=''' + description=""" Reset molecule IDs for a group of atoms based on current bond connectivity. - ''') + """, + ) x_lammps_inout_control_resettimestep = Quantity( type=str, shape=[], - description=''' + description=""" Set the timestep counter to the specified value. - ''') + """, + ) x_lammps_inout_control_restart = Quantity( type=str, shape=[], - description=''' + description=""" Write out a binary restart file with the current state of the simulation every so many timesteps, in either or both of two modes, as a run proceeds. - ''') + """, + ) x_lammps_inout_control_run = Quantity( type=str, shape=[], - description=''' + description=""" Run or continue dynamics for a specified number of timesteps. - ''') + """, + ) x_lammps_inout_control_runstyle = Quantity( type=str, shape=[], - description=''' + description=""" Choose the style of time integrator used for molecular dynamics simulations performed by LAMMPS. - ''') + """, + ) x_lammps_inout_control_server = Quantity( type=str, shape=[], - description=''' + description=""" This command starts LAMMPS running in “server” mode, where it receives messages from a separate “client” code and responds by sending a reply message back to the client. - ''') + """, + ) x_lammps_inout_control_set = Quantity( type=str, shape=[], - description=''' + description=""" Set one or more properties of one or more atoms. - ''') + """, + ) x_lammps_inout_control_shell = Quantity( type=str, shape=[], - description=''' + description=""" Execute a shell command. - ''') + """, + ) x_lammps_inout_control_specialbonds = Quantity( type=str, shape=[], - description=''' + description=""" Set weighting coefficients for pairwise energy and force contributions between pairs of atoms that are also permanently bonded to each other, either directly or via one or two intermediate bonds. - ''') + """, + ) x_lammps_inout_control_suffix = Quantity( type=str, shape=[], - description=''' + description=""" This command allows you to use variants of various styles if they exist. - ''') + """, + ) x_lammps_inout_control_tad = Quantity( type=str, shape=[], - description=''' + description=""" Run a temperature accelerated dynamics (TAD) simulation. - ''') + """, + ) x_lammps_inout_control_tempergrem = Quantity( type=str, shape=[], - description=''' + description=""" Run a parallel tempering or replica exchange simulation in LAMMPS partition mode using multiple generalized replicas (ensembles) of a system defined by fix grem, which stands for the generalized replica exchange method (gREM) originally developed by (Kim). - ''') + """, + ) x_lammps_inout_control_tempernpt = Quantity( type=str, shape=[], - description=''' + description=""" Run a parallel tempering or replica exchange simulation using multiple replicas (ensembles) of a system in the isothermal-isobaric (NPT) ensemble. - ''') + """, + ) x_lammps_inout_control_thermo = Quantity( type=str, shape=[], - description=''' + description=""" Compute and print thermodynamic info (e.g. temperature, energy, pressure) on timesteps that are a multiple of N and at the beginning and end of a simulation. - ''') + """, + ) x_lammps_inout_control_thermomodify = Quantity( type=str, shape=[], - description=''' + description=""" Set options for how thermodynamic information is computed and printed by LAMMPS. - ''') + """, + ) x_lammps_inout_control_thermostyle = Quantity( type=str, shape=[], - description=''' + description=""" Set the style and content for printing thermodynamic data to the screen and log file. - ''') + """, + ) x_lammps_inout_control_thirdorder = Quantity( type=str, shape=[], - description=''' + description=""" Calculate the third order force constant tensor by finite difference of the selected group, where Phi is the third order force constant tensor. - ''') + """, + ) x_lammps_inout_control_timer = Quantity( type=str, shape=[], - description=''' + description=""" Select the level of detail at which LAMMPS performs its CPU timings. - ''') + """, + ) x_lammps_inout_control_timestep = Quantity( type=str, shape=[], - description=''' + description=""" Set the timestep size for subsequent molecular dynamics simulations. - ''') + """, + ) x_lammps_inout_control_uncompute = Quantity( type=str, shape=[], - description=''' + description=""" Delete a compute that was previously defined with a compute command. - ''') + """, + ) x_lammps_inout_control_undump = Quantity( type=str, shape=[], - description=''' + description=""" Turn off a previously defined dump so that it is no longer active. - ''') + """, + ) x_lammps_inout_control_unfix = Quantity( type=str, shape=[], - description=''' + description=""" Delete a fix that was previously defined with a fix command. - ''') + """, + ) x_lammps_inout_control_units = Quantity( type=str, shape=[], - description=''' + description=""" This command sets the style of units used for a simulation. - ''') + """, + ) x_lammps_inout_control_variable = Quantity( type=str, shape=[], - description=''' + description=""" This command assigns one or more strings to a variable name for evaluation later in the input script or during a simulation. - ''') + """, + ) x_lammps_inout_control_velocity = Quantity( type=str, shape=[], - description=''' + description=""" Set or change the velocities of a group of atoms in one of several styles. - ''') + """, + ) x_lammps_inout_control_writecoeff = Quantity( type=str, shape=[], - description=''' + description=""" Write a text format file with the currently defined force field coefficients in a way, that it can be read by LAMMPS with the include command. - ''') + """, + ) x_lammps_inout_control_writedata = Quantity( type=str, shape=[], - description=''' + description=""" Write a data file in text format of the current state of the simulation. - ''') + """, + ) x_lammps_inout_control_writedump = Quantity( type=str, shape=[], - description=''' + description=""" Dump a single snapshot of atom quantities to one or more files for the current state of the system. - ''') + """, + ) x_lammps_inout_control_writerestart = Quantity( type=str, shape=[], - description=''' + description=""" Write a binary restart file of the current state of the simulation. - ''') + """, + ) class Run(runschema.run.Run): - m_def = Section(validate=False, extends_base_section=True) x_lammps_section_input_output_files = SubSection( - sub_section=SectionProxy('x_lammps_section_input_output_files'), - repeats=True) + sub_section=SectionProxy("x_lammps_section_input_output_files"), repeats=True + ) x_lammps_section_control_parameters = SubSection( - sub_section=SectionProxy('x_lammps_section_control_parameters'), - repeats=True) + sub_section=SectionProxy("x_lammps_section_control_parameters"), repeats=True + ) class Constraint(runschema.system.Constraint): - m_def = Section(validate=False, extends_base_section=True) x_lammps_xlo_xhi = Quantity( type=str, shape=[], - description=''' + description=""" test - ''') + """, + ) x_lammps_data_file_store = Quantity( type=str, shape=[], - description=''' + description=""" Filename of data file - ''') + """, + ) x_lammps_dummy = Quantity( type=str, shape=[], - description=''' + description=""" dummy - ''') + """, + ) x_lammps_input_units_store = Quantity( type=str, shape=[], - description=''' + description=""" It determines the units of all quantities specified in the input script and data file, as well as quantities output to the screen, log file, and dump files. - ''') + """, + ) x_lammps_data_bd_types_store = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' + description=""" store temporarly - ''') + """, + ) x_lammps_data_bd_count_store = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' + description=""" store temporarly - ''') + """, + ) x_lammps_data_ag_count_store = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' + description=""" store temporarly - ''') + """, + ) x_lammps_data_at_types_store = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' + description=""" store temporarly - ''') + """, + ) x_lammps_data_dh_count_store = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' + description=""" store temporarly - ''') + """, + ) x_lammps_data_angles_store = Quantity( type=str, shape=[], - description=''' + description=""" store temporarly - ''') + """, + ) x_lammps_data_angle_list_store = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_lammps_data_bond_list_store = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_lammps_data_dihedral_list_store = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_lammps_data_dihedral_coeff_list_store = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_lammps_masses_store = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_lammps_data_topo_list_store = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) diff --git a/atomisticparsers/lammps/parser.py b/atomisticparsers/lammps/parser.py index 3896d2c1..33d05b80 100644 --- a/atomisticparsers/lammps/parser.py +++ b/atomisticparsers/lammps/parser.py @@ -33,6 +33,7 @@ Method, Model, AtomParameters, + Interaction, ) from runschema.system import AtomsGroup from simulationworkflowschema import ( @@ -1209,9 +1210,9 @@ def parse_workflow(self): float(fix[i_temp + 3]) * integration_timestep ) elif fix_style == "temp/csld": - thermostat_parameters[ - "thermostat_type" - ] = "velocity_rescaling_langevin" + thermostat_parameters["thermostat_type"] = ( + "velocity_rescaling_langevin" + ) i_temp = 3 reference_temperature = float(fix[i_temp + 2]) # stop temp coupling_constant = ( @@ -1390,7 +1391,7 @@ def get_composition(children_names): ), "labels": self.traj_parsers.eval("get_atom_labels", traj_n), "velocities": velocities, - "bond_list": bond_list, + "bond_list": bond_list if bond_list else None, } } ) @@ -1549,6 +1550,14 @@ def parse_method(self): # TODO address case types are numbered instead of giving atom labels (fix tests accordingly) interactions = self._mdanalysistraj_parser.get_interactions() + # for interaction in interactions: + # for key, val in interaction.items(): + # quantity_def = Interaction.m_def.all_quantities.get(key) + # if quantity_def and quantity_def.shape: + # # TODO reshape properly + # interaction[key] = [val] + # print("---------", self._mdanalysistraj_parser.mainfile) + # print(interactions) self.parse_interactions(interactions, sec_model) # Force Calculation Parameters diff --git a/atomisticparsers/libatoms/metainfo/lib_atoms.py b/atomisticparsers/libatoms/metainfo/lib_atoms.py index bc18d6d7..09910cf5 100644 --- a/atomisticparsers/libatoms/metainfo/lib_atoms.py +++ b/atomisticparsers/libatoms/metainfo/lib_atoms.py @@ -16,11 +16,18 @@ # 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 +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 + MSection, + MCategory, + Category, + Package, + Quantity, + Section, + SubSection, + SectionProxy, + Reference, ) import runschema.run # pylint: disable=unused-import import runschema.calculation # pylint: disable=unused-import @@ -32,191 +39,213 @@ class x_lib_atoms_section_gap(MSection): - ''' + """ Description of Gaussian Approximation Potentials (GAPs). - ''' + """ m_def = Section(validate=False) x_lib_atoms_training_config_refs = Quantity( type=runschema.calculation.Calculation, - shape=['n_sparseX'], - description=''' + shape=["n_sparseX"], + description=""" References to frames in training configuration. - ''') + """, + ) x_lib_atoms_GAP_params_label = Quantity( type=str, shape=[], - description=''' + description=""" GAP classifier. - ''') + """, + ) x_lib_atoms_GAP_params_svn_version = Quantity( type=str, shape=[], - description=''' + description=""" GAP classifier. - ''') + """, + ) x_lib_atoms_GAP_data_do_core = Quantity( type=str, shape=[], - description=''' + description=""" GAP classifier. - ''') + """, + ) x_lib_atoms_GAP_data_e0 = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" GAP classifier. - ''') + """, + ) x_lib_atoms_command_line_command_line = Quantity( type=str, shape=[], - description=''' + description=""" GAP classifier. - ''') + """, + ) x_lib_atoms_gpSparse_n_coordinate = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' + description=""" GAP classifier. - ''') + """, + ) x_lib_atoms_gpCoordinates_n_permutations = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' + description=""" GAP classifier. - ''') + """, + ) x_lib_atoms_gpCoordinates_sparsified = Quantity( type=str, shape=[], - description=''' + description=""" GAP classifier. - ''') + """, + ) x_lib_atoms_gpCoordinates_signal_variance = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" GAP classifier. - ''') + """, + ) x_lib_atoms_gpCoordinates_label = Quantity( type=str, shape=[], - description=''' + description=""" GAP classifier. - ''') + """, + ) x_lib_atoms_gpCoordinates_n_sparseX = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' + description=""" GAP classifier. - ''') + """, + ) x_lib_atoms_gpCoordinates_covariance_type = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' + description=""" GAP classifier. - ''') + """, + ) x_lib_atoms_gpCoordinates_signal_mean = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" GAP classifier. - ''') + """, + ) x_lib_atoms_gpCoordinates_sparseX_filename = Quantity( type=str, shape=[], - description=''' + description=""" GAP classifier. - ''') + """, + ) x_lib_atoms_gpCoordinates_dimensions = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' + description=""" GAP classifier. - ''') + """, + ) x_lib_atoms_gpCoordinates_theta = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" GAP classifier. - ''') + """, + ) x_lib_atoms_gpCoordinates_descriptor = Quantity( type=str, shape=[], - description=''' + description=""" GAP classifier. - ''') + """, + ) x_lib_atoms_gpCoordinates_perm_permutation = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' + description=""" GAP classifier. - ''') + """, + ) x_lib_atoms_gpCoordinates_perm_i = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' + description=""" GAP classifier. - ''') + """, + ) x_lib_atoms_gpCoordinates_alpha = Quantity( - type=np.dtype(np.float64), - shape=['n_sparseX', 2], - description=''' + type=np.float64, + shape=["n_sparseX", 2], + description=""" GAP classifier. - ''') + """, + ) x_lib_atoms_gpCoordinates_sparseX = Quantity( - type=np.dtype(np.float64), - shape=['n_sparseX', 'dimensions'], - description=''' + type=np.float64, + shape=["n_sparseX", "dimensions"], + description=""" GAP classifier. - ''') + """, + ) class Run(runschema.run.Run): - m_def = Section(validate=False, extends_base_section=True) x_lib_atoms_section_gap = SubSection( - sub_section=SectionProxy('x_lib_atoms_section_gap'), - repeats=False) + sub_section=SectionProxy("x_lib_atoms_section_gap"), repeats=False + ) class Calculation(runschema.calculation.Calculation): - m_def = Section(validate=False, extends_base_section=True) x_lib_atoms_virial_tensor = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[3, 3], - unit='pascal', - description=''' + unit="pascal", + description=""" Virial tensor for this frame. - ''') + """, + ) x_lib_atoms_config_type = Quantity( type=str, shape=[], - description=''' + description=""" Configuration type, e.g. = dislocation_quadrupole. - ''') + """, + ) diff --git a/atomisticparsers/namd/metainfo/namd.py b/atomisticparsers/namd/metainfo/namd.py index 90ea0460..7f355465 100644 --- a/atomisticparsers/namd/metainfo/namd.py +++ b/atomisticparsers/namd/metainfo/namd.py @@ -16,11 +16,19 @@ # 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 +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, JSON + MSection, + MCategory, + Category, + Package, + Quantity, + Section, + SubSection, + SectionProxy, + Reference, + JSON, ) import runschema.run # pylint: disable=unused-import import runschema.calculation # pylint: disable=unused-import @@ -33,1391 +41,1565 @@ class x_namd_mdin_input_output_files(MCategory): - ''' + """ Parameters of mdin belonging to x_namd_section_control_parameters. - ''' + """ m_def = Category() class x_namd_mdin_control_parameters(MCategory): - ''' + """ Parameters of mdin belonging to x_namd_section_control_parameters. - ''' + """ m_def = Category() class x_namd_mdin_method(MCategory): - ''' + """ Parameters of mdin belonging to section method. - ''' + """ m_def = Category() class x_namd_mdout_single_configuration_calculation(MCategory): - ''' + """ Parameters of mdout belonging to section_single_configuration_calculation. - ''' + """ m_def = Category() class x_namd_mdout_method(MCategory): - ''' + """ Parameters of mdin belonging to section method. - ''' + """ m_def = Category() class x_namd_mdout_run(MCategory): - ''' + """ Parameters of mdin belonging to settings run. - ''' + """ m_def = Category() class x_namd_mdin_run(MCategory): - ''' + """ Parameters of mdin belonging to settings run. - ''' + """ m_def = Category() class x_namd_section_input_output_files(MSection): - ''' + """ Section to store input and output file names - ''' + """ m_def = Section(validate=False) x_namd_inout_file_structure = Quantity( type=str, shape=[], - description=''' + description=""" NAMD input topology file. - ''') + """, + ) x_namd_inout_file_traj_coord = Quantity( type=str, shape=[], - description=''' + description=""" NAMD output trajectory file. - ''') + """, + ) x_namd_inout_file_traj_vel = Quantity( type=str, shape=[], - description=''' + description=""" NAMD output file for velocities in the trajectory. - ''') + """, + ) x_namd_inout_file_traj_force = Quantity( type=str, shape=[], - description=''' + description=""" NAMD output file for forces in the trajectory. - ''') + """, + ) x_namd_inout_file_output_coord = Quantity( type=str, shape=[], - description=''' + description=""" NAMD output coordinates file. - ''') + """, + ) x_namd_inout_file_output_vel = Quantity( type=str, shape=[], - description=''' + description=""" NAMD output velocities file. - ''') + """, + ) x_namd_inout_file_output_force = Quantity( type=str, shape=[], - description=''' + description=""" NAMD output forces file. - ''') + """, + ) x_namd_inout_file_input_coord = Quantity( type=str, shape=[], - description=''' + description=""" NAMD input coordinates file. - ''') + """, + ) x_namd_inout_file_input_vel = Quantity( type=str, shape=[], - description=''' + description=""" NAMD input velocities file. - ''') + """, + ) x_namd_inout_file_restart_coord = Quantity( type=str, shape=[], - description=''' + description=""" NAMD restart coordinates file. - ''') + """, + ) x_namd_inout_file_restart_vel = Quantity( type=str, shape=[], - description=''' + description=""" NAMD restart velocities file. - ''') + """, + ) x_namd_inout_file_fftw_datafile = Quantity( type=str, shape=[], - description=''' + description=""" NAMD FFTW data file. - ''') + """, + ) x_namd_inout_file_mdlog = Quantity( type=str, shape=[], - description=''' + description=""" NAMD MD output log file. - ''') + """, + ) class x_namd_section_control_parameters(MSection): - ''' + """ Section to store the input and output control parameters - ''' + """ m_def = Section(validate=False) x_namd_inout_control_timestep = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_number_of_steps = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_steps_per_cycle = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_periodic_cell_basis_1 = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_periodic_cell_basis_2 = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_periodic_cell_basis_3 = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_periodic_cell_center = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_load_balancer = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_load_balancing_strategy = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_ldb_period = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_first_ldb_timestep = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_last_ldb_timestep = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_ldb_background_scaling = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_hom_background_scaling = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_pme_background_scaling = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_min_atoms_per_patch = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_initial_temperature = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_center_of_mass_moving_initially = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_dielectric = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_excluded_species_or_groups = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_1_4_electrostatics_scale = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_traj_dcd_filename = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_traj_dcd_frequency = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_traj_dcd_first_step = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_velocity_dcd_filename = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_velocity_dcd_frequency = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_velocity_dcd_first_step = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_force_dcd_filename = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_force_dcd_frequency = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_force_dcd_first_step = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_output_filename = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_binary_output = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_restart_filename = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_restart_frequency = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_binary_restart = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_switching = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_switching_on = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_switching_off = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_pairlist_distance = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_pairlist_shrink_rate = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_pairlist_grow_rate = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_pairlist_trigger = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_pairlists_per_cycle = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_pairlists = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_margin = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_hydrogen_group_cutoff = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_patch_dimension = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_energy_output_steps = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_crossterm_energy = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_timing_output_steps = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_velocity_rescale_freq = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_velocity_rescale_temp = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_velocity_reassignment_freq = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_velocity_reassignment_temp = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_velocity_reassignment_incr = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_velocity_reassignment_hold = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_lowe_andersen_dynamics = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_lowe_andersen_temperature = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_lowe_andersen_rate = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_lowe_andersen_cutoff = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_langevin_dynamics = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_langevin_temperature = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_langevin_integrator = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_langevin_damping_file = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_langevin_damping_column = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_langevin_damping_coefficient_unit = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_langevin_dynamics_not_applied_to = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_temperature_coupling = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_coupling_temperature = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_berendsen_pressure_coupling = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_berendsen_compressibility_estimate = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_berendsen_relaxation_time = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_berendsen_coupling_frequency = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_langevin_piston_pressure_control = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_target_pressure = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_langevin_oscillation_period = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_langevin_decay_time = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_langevin_piston_temperature = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_pressure_control = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_initial_strain_rate = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_cell_fluctuation = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_particle_mesh_ewald = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_pme_tolerance = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_pme_ewald_coefficient = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_pme_interpolation_order = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_pme_grid_dimensions = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_pme_maximum_grid_spacing = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_fftw_data_file = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_full_electrostatic_evaluation_frequency = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_minimization = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_velocity_quenching = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_verlet_integrator = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_random_number_seed = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_use_hydrogen_bonds = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_coordinate_pdb = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_structure_file = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_parameter_file = Quantity( type=str, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_number_of_parameters = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' + description=""" NAMD running environment and control parameters. - ''') + """, + ) x_namd_inout_control_parameters = Quantity( type=str, - shape=['x_namd_inout_control_number_of_parameters'], - description=''' + shape=["x_namd_inout_control_number_of_parameters"], + description=""" NAMD running environment and control parameters. - ''') + """, + ) class x_namd_section_atom_to_atom_type_ref(MSection): - ''' + """ Section to store atom label to atom type definition list - ''' + """ m_def = Section(validate=False) x_namd_atom_to_atom_type_ref = Quantity( - type=np.dtype(np.int64), - shape=['number_of_atoms_per_type'], - description=''' + type=np.int64, + shape=["number_of_atoms_per_type"], + description=""" Reference to the atoms of each atom type. - ''') + """, + ) class x_namd_section_single_configuration_calculation(MSection): - ''' + """ section for gathering values for MD steps - ''' + """ m_def = Section(validate=False) class System(runschema.system.System): - m_def = Section(validate=False, extends_base_section=True) x_namd_atom_positions_image_index = Quantity( - type=np.dtype(np.int32), - shape=['number_of_atoms', 3], - unit='dimensionless', - description=''' + type=np.int32, + shape=["number_of_atoms", 3], + unit="dimensionless", + description=""" PBC image flag index. - ''') + """, + ) x_namd_atom_positions_scaled = Quantity( - type=np.dtype(np.float64), - shape=['number_of_atoms', 3], - unit='dimensionless', - description=''' + type=np.float64, + shape=["number_of_atoms", 3], + unit="dimensionless", + description=""" Position of the atoms in a scaled format [0, 1]. - ''') + """, + ) x_namd_atom_positions_wrapped = Quantity( - type=np.dtype(np.float64), - shape=['number_of_atoms', 3], - unit='meter', - description=''' + type=np.float64, + shape=["number_of_atoms", 3], + unit="meter", + description=""" Position of the atoms wrapped back to the periodic box. - ''') + """, + ) x_namd_lattice_lengths = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[3], - description=''' + description=""" Lattice dimensions in a vector. Vector includes [a, b, c] lengths. - ''') + """, + ) x_namd_lattice_angles = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[3], - description=''' + description=""" Angles of lattice vectors. Vector includes [alpha, beta, gamma] in degrees. - ''') + """, + ) x_namd_dummy = Quantity( type=str, shape=[], - description=''' + description=""" dummy - ''') + """, + ) x_namd_mdin_finline = Quantity( type=str, shape=[], - description=''' + description=""" finline in mdin - ''') + """, + ) x_namd_traj_timestep_store = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_namd_traj_number_of_atoms_store = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_namd_traj_box_bound_store = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_namd_traj_box_bounds_store = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_namd_traj_variables_store = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_namd_traj_atoms_store = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) class MolecularDynamics(simulationworkflowschema.MolecularDynamics): - m_def = Section(validate=False, extends_base_section=True) x_namd_barostat_target_pressure = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='pascal', - description=''' + unit="pascal", + description=""" MD barostat target pressure. - ''') + """, + ) x_namd_barostat_tau = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='second', - description=''' + unit="second", + description=""" MD barostat relaxation time. - ''') + """, + ) x_namd_barostat_type = Quantity( type=str, shape=[], - description=''' + description=""" MD barostat type, valid values are defined in the barostat_type wiki page. - ''') + """, + ) x_namd_integrator_dt = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='second', - description=''' + unit="second", + description=""" MD integration time step. - ''') + """, + ) x_namd_integrator_type = Quantity( type=str, shape=[], - description=''' + description=""" MD integrator type, valid values are defined in the integrator_type wiki page. - ''') + """, + ) x_namd_periodicity_type = Quantity( type=str, shape=[], - description=''' + description=""" Periodic boundary condition type in the sampling (non-PBC or PBC). - ''') + """, + ) x_namd_langevin_gamma = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='second', - description=''' + unit="second", + description=""" Langevin thermostat damping factor. - ''') + """, + ) x_namd_number_of_steps_requested = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" Number of requested MD integration time steps. - ''') + """, + ) x_namd_thermostat_level = Quantity( type=str, shape=[], - description=''' + description=""" MD thermostat level (see wiki: single, multiple, regional). - ''') + """, + ) x_namd_thermostat_target_temperature = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='kelvin', - description=''' + unit="kelvin", + description=""" MD thermostat target temperature. - ''') + """, + ) x_namd_thermostat_tau = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='second', - description=''' + unit="second", + description=""" MD thermostat relaxation time. - ''') + """, + ) x_namd_thermostat_type = Quantity( type=str, shape=[], - description=''' + description=""" MD thermostat type, valid values are defined in the thermostat_type wiki page. - ''') + """, + ) class AtomParameters(runschema.method.AtomParameters): - m_def = Section(validate=False, extends_base_section=True) x_namd_atom_name = Quantity( type=str, shape=[], - description=''' + description=""" Atom name of an atom in topology definition. - ''') + """, + ) x_namd_atom_type = Quantity( type=str, shape=[], - description=''' + description=""" Atom type of an atom in topology definition. - ''') + """, + ) x_namd_atom_element = Quantity( type=str, shape=[], - description=''' + description=""" Atom type of an atom in topology definition. - ''') + """, + ) x_namd_atom_type_element = Quantity( type=str, shape=[], - description=''' + description=""" Element symbol of an atom type. - ''') + """, + ) x_namd_atom_type_radius = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" van der Waals radius of an atom type. - ''') + """, + ) number_of_atoms_per_type = Quantity( type=int, shape=[], - description=''' + description=""" Number of atoms involved in this type. - ''') + """, + ) class Interaction(runschema.method.Interaction): - m_def = Section(validate=False, extends_base_section=True) x_namd_interaction_atom_to_atom_type_ref = Quantity( type=runschema.method.AtomParameters, - shape=['number_of_atoms_per_interaction'], - description=''' + shape=["number_of_atoms_per_interaction"], + description=""" Reference to the atom type of each interaction atoms. - ''') + """, + ) x_namd_number_of_defined_pair_interactions = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' + description=""" Number of defined pair interactions (L-J pairs). - ''') + """, + ) x_namd_pair_interaction_atom_type_ref = Quantity( type=runschema.method.AtomParameters, - shape=['x_namd_number_of_defined_pair_interactions', 'number_of_atoms_per_interaction'], - description=''' + shape=[ + "x_namd_number_of_defined_pair_interactions", + "number_of_atoms_per_interaction", + ], + description=""" Reference to the atom type for pair interactions. - ''') + """, + ) x_namd_pair_interaction_parameters = Quantity( - type=np.dtype(np.float64), - shape=['x_namd_number_of_defined_pair_interactions', 2], - description=''' + type=np.float64, + shape=["x_namd_number_of_defined_pair_interactions", 2], + description=""" Pair interactions parameters. - ''') + """, + ) x_namd_molecule_interaction_atom_to_atom_type_ref = Quantity( type=runschema.method.AtomParameters, - shape=['number_of_atoms_per_interaction'], - description=''' + shape=["number_of_atoms_per_interaction"], + description=""" Reference to the atom type of each molecule interaction atoms. - ''') + """, + ) x_namd_number_of_defined_molecule_pair_interactions = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' + description=""" Number of defined pair interactions within a molecule (L-J pairs). - ''') + """, + ) x_namd_pair_molecule_interaction_parameters = Quantity( - type=np.dtype(np.float64), - shape=['number_of_defined_molecule_pair_interactions', 2], - description=''' + type=np.float64, + shape=["number_of_defined_molecule_pair_interactions", 2], + description=""" Molecule pair interactions parameters. - ''') + """, + ) x_namd_pair_molecule_interaction_to_atom_type_ref = Quantity( type=runschema.method.AtomParameters, - shape=['x_namd_number_of_defined_pair_interactions', 'number_of_atoms_per_interaction'], - description=''' + shape=[ + "x_namd_number_of_defined_pair_interactions", + "number_of_atoms_per_interaction", + ], + description=""" Reference to the atom type for pair interactions within a molecule. - ''') + """, + ) class Run(runschema.run.Run): - m_def = Section(validate=False, extends_base_section=True) x_namd_program_version_date = Quantity( type=str, shape=[], - description=''' + description=""" Program version date. - ''') + """, + ) x_namd_parallel_task_nr = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" Program task no. - ''') + """, + ) x_namd_program_build_date = Quantity( type=str, shape=[], - description=''' + description=""" Program Build date - ''') + """, + ) x_namd_program_citation = Quantity( type=str, shape=[], - description=''' + description=""" Program citations - ''') + """, + ) x_namd_number_of_tasks = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" Number of tasks in parallel program (MPI). - ''') + """, + ) x_namd_program_module_version = Quantity( type=str, shape=[], - description=''' + description=""" NAMD program module version. - ''') + """, + ) x_namd_program_license = Quantity( type=str, shape=[], - description=''' + description=""" NAMD program license. - ''') + """, + ) x_namd_xlo_xhi = Quantity( type=str, shape=[], - description=''' + description=""" test - ''') + """, + ) x_namd_data_file_store = Quantity( type=str, shape=[], - description=''' + description=""" Filename of data file - ''') + """, + ) x_namd_program_working_path = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_namd_program_execution_host = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_namd_program_execution_path = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_namd_program_module = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_namd_program_execution_date = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_namd_program_execution_time = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_namd_mdin_header = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_namd_mdin_wt = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_namd_section_input_output_files = SubSection( - sub_section=SectionProxy('x_namd_section_input_output_files'), - repeats=True) + sub_section=SectionProxy("x_namd_section_input_output_files"), repeats=True + ) x_namd_section_control_parameters = SubSection( - sub_section=SectionProxy('x_namd_section_control_parameters'), - repeats=True) + sub_section=SectionProxy("x_namd_section_control_parameters"), repeats=True + ) class Calculation(runschema.calculation.Calculation): - m_def = Section(validate=False, extends_base_section=True) x_namd_temperature_average = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='kelvin', - description=''' - ''') + unit="kelvin", + description=""" + """, + ) x_namd_gpressure = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='pascal', - description=''' - ''') + unit="pascal", + description=""" + """, + ) x_namd_pressure_average = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='pascal', - description=''' - ''') + unit="pascal", + description=""" + """, + ) x_namd_gpressure_average = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='pascal', - description=''' - ''') + unit="pascal", + description=""" + """, + ) x_namd_volume = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='meter ** 3', - description=''' - ''') + unit="meter ** 3", + description=""" + """, + ) class Energy(runschema.calculation.Energy): - m_def = Section(validate=False, extends_base_section=True) x_namd_total3 = SubSection(sub_section=runschema.calculation.EnergyEntry.m_def) class Program(runschema.run.Program): - m_def = Section(validate=False, extends_base_section=True) x_namd_build_osarch = Quantity( type=str, shape=[], - description=''' + description=""" Program Build OS/ARCH - ''') + """, + ) class Method(runschema.method.Method): - m_def = Section(validate=False, extends_base_section=True) x_namd_input_parameters = Quantity( type=JSON, shape=[], - description=''' + description=""" Input parameters read from the configuration file. - ''') + """, + ) x_namd_simulation_parameters = Quantity( type=JSON, shape=[], - description=''' + description=""" Simulation parameters used by the program. - ''') + """, + ) diff --git a/atomisticparsers/tinker/metainfo/tinker.py b/atomisticparsers/tinker/metainfo/tinker.py index 53d65dba..41f9297e 100644 --- a/atomisticparsers/tinker/metainfo/tinker.py +++ b/atomisticparsers/tinker/metainfo/tinker.py @@ -16,10 +16,18 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import numpy as np # pylint: disable=unused-import +import numpy as np # pylint: disable=unused-import from nomad.metainfo import ( # pylint: disable=unused-import - MSection, MCategory, Category, Package, Quantity, Section, SubSection, SectionProxy, - Reference, JSON + MSection, + MCategory, + Category, + Package, + Quantity, + Section, + SubSection, + SectionProxy, + Reference, + JSON, ) import runschema.run # pylint: disable=unused-import import runschema.calculation # pylint: disable=unused-import @@ -32,1180 +40,1324 @@ class x_tinker_mdin_input_output_files(MCategory): - ''' + """ Parameters of mdin belonging to x_tinker_section_control_parameters. - ''' + """ m_def = Category() class x_tinker_mdin_control_parameters(MCategory): - ''' + """ Parameters of mdin belonging to x_tinker_section_control_parameters. - ''' + """ m_def = Category() class x_tinker_mdin_method(MCategory): - ''' + """ Parameters of mdin belonging to section method. - ''' + """ m_def = Category() class x_tinker_mdout_single_configuration_calculation(MCategory): - ''' + """ Parameters of mdout belonging to section_single_configuration_calculation. - ''' + """ m_def = Category() class x_tinker_mdout_method(MCategory): - ''' + """ Parameters of mdin belonging to section method. - ''' + """ m_def = Category() class x_tinker_mdout_run(MCategory): - ''' + """ Parameters of mdin belonging to settings run. - ''' + """ m_def = Category() class x_tinker_mdin_run(MCategory): - ''' + """ Parameters of mdin belonging to settings run. - ''' + """ m_def = Category() class x_tinker_section_input_output_files(MSection): - ''' + """ Section to store input and output file names - ''' + """ m_def = Section(validate=False) class x_tinker_section_control_parameters(MSection): - ''' + """ Section to store the input and output control parameters - ''' + """ m_def = Section(validate=False) x_tinker_inout_file_structure = Quantity( type=str, shape=[], - description=''' + description=""" tinker input topology file. - ''') + """, + ) x_tinker_inout_file_trajectory = Quantity( type=str, shape=[], - description=''' + description=""" tinker output trajectory file. - ''') + """, + ) x_tinker_inout_file_traj_coord = Quantity( type=str, shape=[], - description=''' + description=""" tinker output trajectory file. - ''') + """, + ) x_tinker_inout_file_traj_vel = Quantity( type=str, shape=[], - description=''' + description=""" tinker output file for velocities in the trajectory. - ''') + """, + ) x_tinker_inout_file_traj_force = Quantity( type=str, shape=[], - description=''' + description=""" tinker output file for forces in the trajectory. - ''') + """, + ) x_tinker_inout_file_output_coord = Quantity( type=str, shape=[], - description=''' + description=""" tinker output coordinates file. - ''') + """, + ) x_tinker_inout_file_output_vel = Quantity( type=str, shape=[], - description=''' + description=""" tinker output velocities file. - ''') + """, + ) x_tinker_inout_file_output_force = Quantity( type=str, shape=[], - description=''' + description=""" tinker output forces file. - ''') + """, + ) x_tinker_inout_file_input_coord = Quantity( type=str, shape=[], - description=''' + description=""" tinker input coordinates file. - ''') + """, + ) x_tinker_inout_file_input_vel = Quantity( type=str, shape=[], - description=''' + description=""" tinker input velocities file. - ''') + """, + ) x_tinker_inout_file_restart_coord = Quantity( type=str, shape=[], - description=''' + description=""" tinker restart coordinates file. - ''') + """, + ) x_tinker_inout_file_restart_vel = Quantity( type=str, shape=[], - description=''' + description=""" tinker restart velocities file. - ''') + """, + ) x_tinker_inout_file_output_log = Quantity( type=str, shape=[], - description=''' + description=""" tinker MD output log file. - ''') + """, + ) x_tinker_inout_control_number_of_steps = Quantity( type=str, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_polar_eps = Quantity( type=str, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_initial_temperature = Quantity( type=str, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_dielectric = Quantity( type=str, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_minimization = Quantity( type=str, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_integrator = Quantity( type=str, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_parameters = Quantity( type=str, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_verbose = Quantity( type=bool, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_a_axis = Quantity( type=str, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_b_axis = Quantity( type=str, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_c_axis = Quantity( type=str, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_alpha = Quantity( type=str, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_beta = Quantity( type=str, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_gamma = Quantity( type=str, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_tau_pressure = Quantity( type=str, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_tau_temperature = Quantity( type=str, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_debug = Quantity( type=bool, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_group = Quantity( type=bool, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_group_inter = Quantity( type=str, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_vib_roots = Quantity( type=str, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_spacegroup = Quantity( type=str, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_digits = Quantity( type=str, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_printout = Quantity( type=str, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_enforce_chirality = Quantity( type=bool, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_neighbor_list = Quantity( type=bool, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_vdw_cutoff = Quantity( type=str, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_vdw_correction = Quantity( type=bool, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_ewald = Quantity( type=bool, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_ewald_cutoff = Quantity( type=str, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_archive = Quantity( type=bool, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_barostat = Quantity( type=str, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_aniso_pressure = Quantity( type=bool, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_lights = Quantity( type=bool, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_randomseed = Quantity( type=str, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_saddlepoint = Quantity( type=bool, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_vdwtype = Quantity( type=str, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_title = Quantity( type=str, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_step_t = Quantity( type=str, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_step_dt = Quantity( type=str, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_random_number_generator_seed = Quantity( type=str, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_radiusrule = Quantity( type=str, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_radiustype = Quantity( type=str, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_radiussize = Quantity( type=str, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_epsilonrule = Quantity( type=str, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_rattle = Quantity( type=str, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_lambda = Quantity( type=str, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_mutate = Quantity( type=str, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_basin = Quantity( type=str, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_pme_grid = Quantity( type=str, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_pme_order = Quantity( type=str, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_nstep = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_initial_configuration_file = Quantity( type=str, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_final_configuration_file = Quantity( type=str, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_initial_trajectory_file = Quantity( type=str, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_restart_file = Quantity( type=str, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_archive_file = Quantity( type=str, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_force_field_file = Quantity( type=str, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_key_file = Quantity( type=str, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_coordinate_file_list = Quantity( type=str, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_structure_file = Quantity( type=str, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_parameter_file = Quantity( type=str, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_input_file = Quantity( type=str, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_topology_file = Quantity( type=str, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_configuration_file = Quantity( type=str, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_number_of_parameter_files = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_inout_control_parameter_files = Quantity( type=str, - shape=['x_tinker_inout_control_number_of_parameter_files'], - description=''' + shape=["x_tinker_inout_control_number_of_parameter_files"], + description=""" tinker running environment and control parameters. - ''') + """, + ) x_tinker_section_input_output_files = SubSection( - sub_section=SectionProxy('x_tinker_section_input_output_files'), - repeats=True) + sub_section=SectionProxy("x_tinker_section_input_output_files"), repeats=True + ) class x_tinker_section_atom_to_atom_type_ref(MSection): - ''' + """ Section to store atom label to atom type definition list - ''' + """ m_def = Section(validate=False) x_tinker_atom_to_atom_type_ref = Quantity( - type=np.dtype(np.int64), - shape=['number_of_atoms_per_type'], - description=''' + type=np.int64, + shape=["number_of_atoms_per_type"], + description=""" Reference to the atoms of each atom type. - ''') + """, + ) class x_tinker_section_single_configuration_calculation(MSection): - ''' + """ section for gathering values for MD steps - ''' + """ m_def = Section(validate=False) class System(runschema.system.System): - m_def = Section(validate=False, extends_base_section=True) x_tinker_atom_positions_image_index = Quantity( - type=np.dtype(np.int32), - shape=['number_of_atoms', 3], - unit='dimensionless', - description=''' + type=np.int32, + shape=["number_of_atoms", 3], + unit="dimensionless", + description=""" PBC image flag index. - ''') + """, + ) x_tinker_atom_positions_scaled = Quantity( - type=np.dtype(np.float64), - shape=['number_of_atoms', 3], - unit='dimensionless', - description=''' + type=np.float64, + shape=["number_of_atoms", 3], + unit="dimensionless", + description=""" Position of the atoms in a scaled format [0, 1]. - ''') + """, + ) x_tinker_atom_positions_wrapped = Quantity( - type=np.dtype(np.float64), - shape=['number_of_atoms', 3], - unit='meter', - description=''' + type=np.float64, + shape=["number_of_atoms", 3], + unit="meter", + description=""" Position of the atoms wrapped back to the periodic box. - ''') + """, + ) x_tinker_lattice_lengths = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[3], - description=''' + description=""" Lattice dimensions in a vector. Vector includes [a, b, c] lengths. - ''') + """, + ) x_tinker_lattice_angles = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[3], - description=''' + description=""" Angles of lattice vectors. Vector includes [alpha, beta, gamma] in degrees. - ''') + """, + ) x_tinker_dummy = Quantity( type=str, shape=[], - description=''' + description=""" dummy - ''') + """, + ) x_tinker_mdin_finline = Quantity( type=str, shape=[], - description=''' + description=""" finline in mdin - ''') + """, + ) x_tinker_traj_timestep_store = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_tinker_traj_number_of_atoms_store = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_tinker_traj_box_bound_store = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_tinker_traj_box_bounds_store = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_tinker_traj_variables_store = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_tinker_traj_atoms_store = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) class MolecularDynamics(simulationworkflowschema.MolecularDynamics): - m_def = Section(validate=False, extends_base_section=True) x_tinker_barostat_target_pressure = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='pascal', - description=''' + unit="pascal", + description=""" MD barostat target pressure. - ''') + """, + ) x_tinker_barostat_tau = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" MD barostat relaxation time. - ''') + """, + ) x_tinker_barostat_type = Quantity( type=str, shape=[], - description=''' + description=""" MD barostat type, valid values are defined in the barostat_type wiki page. - ''') + """, + ) x_tinker_integrator_dt = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='second', - description=''' + unit="second", + description=""" MD integration time step. - ''') + """, + ) x_tinker_integrator_type = Quantity( type=str, shape=[], - description=''' + description=""" MD integrator type, valid values are defined in the integrator_type wiki page. - ''') + """, + ) x_tinker_periodicity_type = Quantity( type=str, shape=[], - description=''' + description=""" Periodic boundary condition type in the sampling (non-PBC or PBC). - ''') + """, + ) x_tinker_langevin_gamma = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='second', - description=''' + unit="second", + description=""" Langevin thermostat damping factor. - ''') + """, + ) x_tinker_number_of_steps_requested = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" Number of requested MD integration time steps. - ''') + """, + ) x_tinker_thermostat_level = Quantity( type=str, shape=[], - description=''' + description=""" MD thermostat level (see wiki: single, multiple, regional). - ''') + """, + ) x_tinker_thermostat_target_temperature = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='kelvin', - description=''' + unit="kelvin", + description=""" MD thermostat target temperature. - ''') + """, + ) x_tinker_thermostat_tau = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='second', - description=''' + unit="second", + description=""" MD thermostat relaxation time. - ''') + """, + ) x_tinker_thermostat_type = Quantity( type=str, shape=[], - description=''' + description=""" MD thermostat type, valid values are defined in the thermostat_type wiki page. - ''') + """, + ) class GeometryOptimization(simulationworkflowschema.GeometryOptimization): - m_def = Section(validate=False, extends_base_section=True) x_tiner_final_function_value = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='newton', - description=''' + unit="newton", + description=""" Final value of the energy. - ''') + """, + ) x_tinker_final_rms_gradient = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='newton', - description=''' + unit="newton", + description=""" Tolerance value of the RMS gradient for structure minimization. - ''') + """, + ) x_tinker_final_gradient_norm = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='newton', - description=''' + unit="newton", + description=""" Tolerance value of the RMS gradient for structure minimization. - ''') + """, + ) x_tinker_final_gradient_norm = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='newton', - description=''' + unit="newton", + description=""" Tolerance value of the RMS gradient for structure minimization. - ''') + """, + ) class AtomParameters(runschema.method.AtomParameters): - m_def = Section(validate=False, extends_base_section=True) x_tinker_atom_name = Quantity( type=str, shape=[], - description=''' + description=""" Atom name of an atom in topology definition. - ''') + """, + ) x_tinker_atom_type = Quantity( type=str, shape=[], - description=''' + description=""" Atom type of an atom in topology definition. - ''') + """, + ) x_tinker_atom_resid = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' - ''') + description=""" + """, + ) x_tinker_atom_element = Quantity( type=str, shape=[], - description=''' + description=""" Atom type of an atom in topology definition. - ''') + """, + ) x_tinker_atom_type_element = Quantity( type=str, shape=[], - description=''' + description=""" Element symbol of an atom type. - ''') + """, + ) x_tinker_atom_type_radius = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" van der Waals radius of an atom type. - ''') + """, + ) number_of_atoms_per_type = Quantity( type=int, shape=[], - description=''' + description=""" Number of atoms involved in this type. - ''') + """, + ) class Interaction(runschema.method.Interaction): - m_def = Section(validate=False, extends_base_section=True) x_tinker_interaction_atom_to_atom_type_ref = Quantity( type=runschema.method.AtomParameters, - shape=['number_of_atoms_per_interaction'], - description=''' + shape=["number_of_atoms_per_interaction"], + description=""" Reference to the atom type of each interaction atoms. - ''') + """, + ) x_tinker_number_of_defined_pair_interactions = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' + description=""" Number of defined pair interactions (L-J pairs). - ''') + """, + ) x_tinker_pair_interaction_atom_type_ref = Quantity( type=runschema.method.AtomParameters, - shape=['x_tinker_number_of_defined_pair_interactions', 'number_of_atoms_per_interaction'], - description=''' + shape=[ + "x_tinker_number_of_defined_pair_interactions", + "number_of_atoms_per_interaction", + ], + description=""" Reference to the atom type for pair interactions. - ''') + """, + ) x_tinker_pair_interaction_parameters = Quantity( - type=np.dtype(np.float64), - shape=['x_tinker_number_of_defined_pair_interactions', 2], - description=''' + type=np.float64, + shape=["x_tinker_number_of_defined_pair_interactions", 2], + description=""" Pair interactions parameters. - ''') + """, + ) x_tinker_molecule_interaction_atom_to_atom_type_ref = Quantity( type=runschema.method.AtomParameters, - shape=['number_of_atoms_per_interaction'], - description=''' + shape=["number_of_atoms_per_interaction"], + description=""" Reference to the atom type of each molecule interaction atoms. - ''') + """, + ) x_tinker_number_of_defined_molecule_pair_interactions = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' + description=""" Number of defined pair interactions within a molecule (L-J pairs). - ''') + """, + ) x_tinker_pair_molecule_interaction_parameters = Quantity( - type=np.dtype(np.float64), - shape=['number_of_defined_molecule_pair_interactions', 2], - description=''' + type=np.float64, + shape=["number_of_defined_molecule_pair_interactions", 2], + description=""" Molecule pair interactions parameters. - ''') + """, + ) x_tinker_pair_molecule_interaction_to_atom_type_ref = Quantity( type=runschema.method.AtomParameters, - shape=['x_tinker_number_of_defined_pair_interactions', 'number_of_atoms_per_interaction'], - description=''' + shape=[ + "x_tinker_number_of_defined_pair_interactions", + "number_of_atoms_per_interaction", + ], + description=""" Reference to the atom type for pair interactions within a molecule. - ''') + """, + ) class Run(runschema.run.Run): - m_def = Section(validate=False, extends_base_section=True) x_tinker_program_version_date = Quantity( type=str, shape=[], - description=''' + description=""" Program version date. - ''') + """, + ) x_tinker_parallel_task_nr = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" Program task no. - ''') + """, + ) x_tinker_build_osarch = Quantity( type=str, shape=[], - description=''' + description=""" Program Build OS/ARCH - ''') + """, + ) x_tinker_output_created_by_user = Quantity( type=str, shape=[], - description=''' + description=""" Output file creator - ''') + """, + ) x_tinker_most_severe_warning_level = Quantity( type=str, shape=[], - description=''' + description=""" Highest tinker warning level in the run. - ''') + """, + ) x_tinker_program_build_date = Quantity( type=str, shape=[], - description=''' + description=""" Program Build date - ''') + """, + ) x_tinker_program_citation = Quantity( type=str, shape=[], - description=''' + description=""" Program citations - ''') + """, + ) x_tinker_program_copyright = Quantity( type=str, shape=[], - description=''' + description=""" Program copyright - ''') + """, + ) x_tinker_number_of_tasks = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' + description=""" Number of tasks in parallel program (MPI). - ''') + """, + ) x_tinker_program_module_version = Quantity( type=str, shape=[], - description=''' + description=""" tinker program module version. - ''') + """, + ) x_tinker_program_license = Quantity( type=str, shape=[], - description=''' + description=""" tinker program license. - ''') + """, + ) x_tinker_xlo_xhi = Quantity( type=str, shape=[], - description=''' + description=""" test - ''') + """, + ) x_tinker_data_file_store = Quantity( type=str, shape=[], - description=''' + description=""" Filename of data file - ''') + """, + ) x_tinker_program_working_path = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_tinker_program_execution_host = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_tinker_program_execution_path = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_tinker_program_module = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_tinker_program_execution_date = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_tinker_program_execution_time = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_tinker_mdin_header = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_tinker_mdin_wt = Quantity( type=str, shape=[], - description=''' + description=""" tmp - ''') + """, + ) x_tinker_section_control_parameters = SubSection( - sub_section=SectionProxy('x_tinker_section_control_parameters'), - repeats=True) + sub_section=SectionProxy("x_tinker_section_control_parameters"), repeats=True + ) x_tinker_control_parameters = Quantity( type=JSON, shape=[], - description=''' - Parameters read from key file''' + description=""" + Parameters read from key file""", ) class Calculation(runschema.calculation.Calculation): - m_def = Section(validate=False, extends_base_section=True) x_tinker_section_single_configuration_calculation = SubSection( - sub_section=SectionProxy('x_tinker_section_single_configuration_calculation'), - repeats=True) + sub_section=SectionProxy("x_tinker_section_single_configuration_calculation"), + repeats=True, + ) class VibrationalFrequencies(runschema.calculation.VibrationalFrequencies): - m_def = Section(validate=False, extends_base_section=True) x_tinker_eigenvalues = Quantity( - type=np.dtype(np.float64), - shape=['n_frequencies'], - description=''' - ''' + type=np.float64, + shape=["n_frequencies"], + description=""" + """, ) diff --git a/atomisticparsers/tinker/parser.py b/atomisticparsers/tinker/parser.py index 7d7a2225..9af3e6e8 100644 --- a/atomisticparsers/tinker/parser.py +++ b/atomisticparsers/tinker/parser.py @@ -21,6 +21,7 @@ import numpy as np import fnmatch from typing import List +import re from nomad.parsing.file_parser.text_parser import Quantity, TextParser from nomad.units import ureg @@ -52,6 +53,7 @@ def to_key_val(val_in): if len(val) == 1: return [val[0], True] elif len(val) == 2: + val[1] = float(val[1]) if re.match(re_f, val[1]) else val[1] return val else: return [val[0], val[1:]] diff --git a/atomisticparsers/utils/mdanalysis.py b/atomisticparsers/utils/mdanalysis.py index 13deb9e6..f9057caf 100644 --- a/atomisticparsers/utils/mdanalysis.py +++ b/atomisticparsers/utils/mdanalysis.py @@ -462,13 +462,21 @@ def get_interactions(self): except Exception: continue - for i in range(len(interaction)): + for inter in interaction: + atom_labels = None + try: + atom_labels = [ + self.universe.atoms[ind].type for ind in inter.indices + ] + except Exception: + self.logger.warning("Could not assign atom labels to interactions.") interactions.append( dict( - atom_labels=list(interaction[i].type), - parameters=float(interaction[i].value()), - atom_indices=interaction[i].indices, - type=interaction[i].btype, + atom_labels=atom_labels, + # parameters=float(inter.value()), ## This is not the parameter but rather the value of the interaction order parameter for a single frame + # TODO implement functions to get parameters for individual parsers + atom_indices=inter.indices, + type=inter.btype, ) ) diff --git a/atomisticparsers/utils/parsers.py b/atomisticparsers/utils/parsers.py index 3a34352e..723f0d3a 100644 --- a/atomisticparsers/utils/parsers.py +++ b/atomisticparsers/utils/parsers.py @@ -179,52 +179,42 @@ def parse_md_workflow(self, data: Dict[str, Any]) -> None: self.archive.workflow2 = sec_workflow def parse_interactions(self, interactions: List[Dict], sec_model: MSection) -> None: - interaction_dict = {} - for interaction_key in Interaction.m_def.all_quantities.keys(): - interaction_dict[interaction_key] = np.array( - [interaction.get(interaction_key) for interaction in interactions], - dtype=object, - ) - interaction_dict = {key: val for key, val in interaction_dict.items()} - interaction_types = ( - np.unique(interaction_dict["type"]) - if interaction_dict.get("type") is not None - else [] - ) - for interaction_type in interaction_types: + if not interactions: + return + + def write_interaction_values(values): sec_interaction = Interaction() sec_model.contributions.append(sec_interaction) - interaction_indices = np.where( - interaction_dict["type"] == interaction_type - )[0] - sec_interaction.type = interaction_type - sec_interaction.n_interactions = len(interaction_indices) - sec_interaction.n_atoms - for key, val in interaction_dict.items(): + sec_interaction.type = current_type + sec_interaction.n_atoms = max( + [len(v) for v in values.get("atom_indices", [[0]])] + ) + for key, val in values.items(): + quantity_def = sec_interaction.m_def.all_quantities.get(key) + if quantity_def: + try: + sec_interaction.m_set(quantity_def, val) + except Exception: + self.logger.error("Error setting metadata.", data={"key": key}) + + interactions.sort(key=lambda x: x.get("type")) + current_type = interactions[0].get("type") + interaction_values: Dict[str, Any] = {} + for interaction in interactions: + interaction_type = interaction.get("type") + if current_type and current_type != interaction_type: + write_interaction_values(interaction_values) + current_type = interaction_type + interaction_values = {} + interaction_values.setdefault("n_interactions", 0) + interaction_values["n_interactions"] += 1 + for key, val in interaction.items(): if key == "type": continue - interaction_vals = val[interaction_indices] - if type(interaction_vals[0]).__name__ == "ndarray": - interaction_vals = np.array( - [vals.tolist() for vals in interaction_vals], dtype=object - ) - if interaction_vals.all() is None: - continue - if key == "parameters": - interaction_vals = interaction_vals.tolist() - elif key == "n_atoms": - interaction_vals = interaction_vals[0] - if hasattr(sec_interaction, key): - sec_interaction.m_set( - sec_interaction.m_get_quantity_definition(key), interaction_vals - ) - - if not sec_interaction.n_atoms: - sec_interaction.n_atoms = ( - len(sec_interaction.get("atom_indices")[0]) - if sec_interaction.get("atom_indices") is not None - else None - ) + interaction_values.setdefault(key, []) + interaction_values[key].append(val) + if interaction_values: + write_interaction_values(interaction_values) def parse_interactions_by_type( self, interactions_by_type: List[Dict], sec_model: Model diff --git a/atomisticparsers/xtb/metainfo/xtb.py b/atomisticparsers/xtb/metainfo/xtb.py index 91269925..aa8a17ac 100644 --- a/atomisticparsers/xtb/metainfo/xtb.py +++ b/atomisticparsers/xtb/metainfo/xtb.py @@ -16,10 +16,14 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import numpy as np # pylint: disable=unused-import +import numpy as np # pylint: disable=unused-import from nomad.metainfo import ( # pylint: disable=unused-import - Package, Quantity, Section, SubSection, JSON + Package, + Quantity, + Section, + SubSection, + JSON, ) import runschema.run # pylint: disable=unused-import import runschema.calculation # pylint: disable=unused-import @@ -32,195 +36,221 @@ class Run(runschema.method.Method): - m_def = Section(validate=False, extends_base_section=True) x_xtb_calculation_setup = Quantity( type=JSON, shape=[], - description=''' - ''') + description=""" + """, + ) class TB(runschema.method.TB): - m_def = Section(validate=False, extends_base_section=True) x_xtb_setup = Quantity( type=JSON, shape=[], - description=''' - ''') + description=""" + """, + ) class Energy(runschema.calculation.Energy): - m_def = Section(validate=False, extends_base_section=True) x_xtb_scc = SubSection(sub_section=runschema.calculation.EnergyEntry.m_def) x_xtb_isotropic_es = SubSection(sub_section=runschema.calculation.EnergyEntry.m_def) - x_xtb_anisotropic_es = SubSection(sub_section=runschema.calculation.EnergyEntry.m_def) + x_xtb_anisotropic_es = SubSection( + sub_section=runschema.calculation.EnergyEntry.m_def + ) - x_xtb_anistropic_xc = SubSection(sub_section=runschema.calculation.EnergyEntry.m_def) + x_xtb_anistropic_xc = SubSection( + sub_section=runschema.calculation.EnergyEntry.m_def + ) x_xtb_dispersion = SubSection(sub_section=runschema.calculation.EnergyEntry.m_def) x_xtb_repulsion = SubSection(sub_section=runschema.calculation.EnergyEntry.m_def) - x_xtb_halogen_bond_corr = SubSection(sub_section=runschema.calculation.EnergyEntry.m_def) + x_xtb_halogen_bond_corr = SubSection( + sub_section=runschema.calculation.EnergyEntry.m_def + ) - x_xtb_add_restraining = SubSection(sub_section=runschema.calculation.EnergyEntry.m_def) + x_xtb_add_restraining = SubSection( + sub_section=runschema.calculation.EnergyEntry.m_def + ) class MultipolesEntry(runschema.calculation.MultipolesEntry): - m_def = Section(validate=False, extends_base_section=True) x_xtb_q_only = Quantity( - type=np.dtype(np.float64), - shape=['n_multipoles'], - description=''' - ''') + type=np.float64, + shape=["n_multipoles"], + description=""" + """, + ) x_xtb_q_plus_dip = Quantity( - type=np.dtype(np.float64), - shape=['n_multipoles'], - description=''' - ''') + type=np.float64, + shape=["n_multipoles"], + description=""" + """, + ) class GeometryOptimization(simulationworkflowschema.GeometryOptimization): - m_def = Section(validate=False, extends_base_section=True) x_xtb_optimization_level = Quantity( type=str, shape=[], - description=''' - ''') + description=""" + """, + ) x_xtb_max_opt_cycles = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' - ''') + description=""" + """, + ) x_xtb_anc_micro_cycles = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' - ''') + description=""" + """, + ) x_xtb_n_degrees_freedom = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' - ''') + description=""" + """, + ) x_xtb_rf_solver = Quantity( type=str, shape=[], - description=''' - ''') + description=""" + """, + ) x_xtb_linear = Quantity( type=str, shape=[], - description=''' - ''') + description=""" + """, + ) x_xtb_hlow = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' - ''') + description=""" + """, + ) x_xtb_hmax = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' - ''') + description=""" + """, + ) x_xtb_s6 = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' - ''') + description=""" + """, + ) class MolecularDynamics(simulationworkflowschema.MolecularDynamics): - m_def = Section(validate=False, extends_base_section=True) x_xtb_md_time = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='s', - description=''' - ''') + unit="s", + description=""" + """, + ) x_xtb_scc_accuracy = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - description=''' - ''') + description=""" + """, + ) x_xtb_temperature = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='K', - description=''' - ''') + unit="K", + description=""" + """, + ) x_xtb_max_steps = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' - ''') + description=""" + """, + ) x_xtb_max_block_length = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' - ''') + description=""" + """, + ) x_xtb_dumpstep_trj = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='s', - description=''' - ''') + unit="s", + description=""" + """, + ) x_xtb_dumpstep_coords = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='s', - description=''' - ''') + unit="s", + description=""" + """, + ) x_xtb_h_atoms_mass = Quantity( - type=np.dtype(np.float64), + type=np.float64, shape=[], - unit='kg', - description=''' - ''') + unit="kg", + description=""" + """, + ) x_xtb_n_degrees_freedom = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' - ''') + description=""" + """, + ) x_xtb_shake_bonds = Quantity( - type=np.dtype(np.int32), + type=np.int32, shape=[], - description=''' - ''') + description=""" + """, + ) x_xtb_berendsen = Quantity( type=bool, shape=[], - description=''' - ''') + description=""" + """, + ) diff --git a/tests/test_gromacsparser.py b/tests/test_gromacsparser.py index a2927d85..f8dc1e83 100644 --- a/tests/test_gromacsparser.py +++ b/tests/test_gromacsparser.py @@ -140,7 +140,7 @@ def test_md_verbose(parser): assert sec_systems[1].atoms.positions[800][1].magnitude == approx(2.4740036e-09) assert sec_systems[0].atoms.velocities[500][0].magnitude == approx(869.4773) assert sec_systems[1].atoms.lattice_vectors[2][2].magnitude == approx(2.469158e-09) - assert sec_systems[0].atoms.bond_list[200][0] == 289 + assert sec_systems[0].atoms.bond_list[200, 0] == 289 sec_method = sec_run.method assert len(sec_method) == 1 @@ -150,11 +150,8 @@ def test_md_verbose(parser): assert sec_method[0].force_field.model[0].contributions[6].n_atoms == 2 assert sec_method[0].force_field.model[0].contributions[6].atom_labels[10][0] == "C" assert ( - sec_method[0].force_field.model[0].contributions[6].atom_indices[100][1] == 141 + sec_method[0].force_field.model[0].contributions[6].atom_indices[100, 1] == 141 ) - assert sec_method[0].force_field.model[0].contributions[6].parameters[ - 858 - ] == approx(0.9999996193044006) assert sec_method[0].force_field.force_calculations.vdw_cutoff.magnitude == 1.2e-09 assert sec_method[0].force_field.force_calculations.vdw_cutoff.units == "meter" assert ( diff --git a/tests/test_gulpparser.py b/tests/test_gulpparser.py index 5a517615..7cb0a67f 100644 --- a/tests/test_gulpparser.py +++ b/tests/test_gulpparser.py @@ -26,7 +26,7 @@ def approx(value, abs=0, rel=1e-6): return pytest.approx(value, abs=abs, rel=rel) -@pytest.fixture(scope='module') +@pytest.fixture(scope="module") def parser(): return GulpParser() @@ -34,38 +34,42 @@ def parser(): def test_optimise_conp_property_old(parser): archive = EntryArchive() - parser.parse('tests/data/gulp/example1_old/example1.got', archive, None) + parser.parse("tests/data/gulp/example1_old/example1.got", archive, None) sec_run = archive.run[0] - assert sec_run.program.version == '4.1.0' - assert sec_run.x_gulp_title == 'alumina test file' + assert sec_run.program.version == "4.1.0" + assert sec_run.x_gulp_title == "alumina test file" assert sec_run.x_gulp_n_cpu == 1 - assert sec_run.x_gulp_host_name == 'M-A0002884.local' + assert sec_run.x_gulp_host_name == "M-A0002884.local" assert sec_run.time_run.date_start > 0 assert sec_run.time_run.date_end > 0 sec_method = sec_run.method[0] contributions = sec_method.force_field.model[0].contributions assert len(contributions) == 4 - assert contributions[0].functional_form == 'Buckingham' - assert contributions[1].atom_labels[1] == 'O' - assert contributions[2].parameters['A'] == approx(404.0) - assert contributions[3].parameters['cutoff_max'] == approx(0.8) + assert contributions[0].functional_form == "Buckingham" + assert contributions[1].atom_labels[0][1] == "O" + assert contributions[2].parameters["A"] == approx(404.0) + assert contributions[3].parameters["cutoff_max"] == approx(0.8) assert len(sec_method.atom_parameters) == 4 - assert sec_method.atom_parameters[0].label == 'Al' - assert sec_method.atom_parameters[1].x_gulp_type == 'shell' + assert sec_method.atom_parameters[0].label == "Al" + assert sec_method.atom_parameters[1].x_gulp_type == "shell" assert sec_method.atom_parameters[2].atom_number == 8 - assert sec_method.atom_parameters[3].mass.magnitude == approx(0.) + assert sec_method.atom_parameters[3].mass.magnitude == approx(0.0) assert sec_method.atom_parameters[0].charge.magnitude == approx(6.88935953e-21) - assert sec_method.atom_parameters[1].x_gulp_covalent_radius.magnitude == approx(1.35e-10) - assert sec_method.atom_parameters[2].x_gulp_ionic_radius.magnitude == approx(0.) + assert sec_method.atom_parameters[1].x_gulp_covalent_radius.magnitude == approx( + 1.35e-10 + ) + assert sec_method.atom_parameters[2].x_gulp_ionic_radius.magnitude == approx(0.0) assert sec_method.atom_parameters[3].x_gulp_vdw_radius.magnitude == approx(1.36e-10) sec_system = sec_run.system assert len(sec_system) == 2 assert len(sec_system[0].atoms.positions) == 10 - assert sec_system[0].atoms.lattice_vectors[2][1].magnitude == approx(-2.74830275e-10) - assert sec_system[0].atoms.labels[1] == 'O' + assert sec_system[0].atoms.lattice_vectors[2][1].magnitude == approx( + -2.74830275e-10 + ) + assert sec_system[0].atoms.labels[1] == "O" assert sec_system[0].atoms.positions[1][1].magnitude == approx(-1.11691024e-11) assert sec_system[1].atoms.lattice_vectors[1][0].magnitude == approx(-2.410026e-10) assert sec_system[1].atoms.positions[0][2].magnitude == approx(7.59013967e-10) @@ -74,15 +78,27 @@ def test_optimise_conp_property_old(parser): sec_calc = sec_run.calculation assert len(sec_calc) == 2 assert sec_calc[0].energy.total.value.magnitude == approx(-5.04201973e-17) - assert sec_calc[0].energy.x_gulp_interatomic_potentials.magnitude == approx(1.01073584e-17) - assert sec_calc[0].energy.x_gulp_monopole_monopole_real.magnitude == approx(-2.03424558e-17) - assert sec_calc[0].energy.x_gulp_monopole_monopole_recip.magnitude == approx(-4.01850999e-17) - assert sec_calc[1].energy.x_gulp_monopole_monopole_total.magnitude == approx(-6.00279419e-17) + assert sec_calc[0].energy.x_gulp_interatomic_potentials.magnitude == approx( + 1.01073584e-17 + ) + assert sec_calc[0].energy.x_gulp_monopole_monopole_real.magnitude == approx( + -2.03424558e-17 + ) + assert sec_calc[0].energy.x_gulp_monopole_monopole_recip.magnitude == approx( + -4.01850999e-17 + ) + assert sec_calc[1].energy.x_gulp_monopole_monopole_total.magnitude == approx( + -6.00279419e-17 + ) assert sec_calc[1].energy.total.value.magnitude == approx(-5.04963266e-17) - assert sec_calc[1].x_gulp_piezoelectric_strain_matrix[1][0].magnitude == approx(0.) - assert sec_calc[1].x_gulp_piezoelectric_stress_matrix[1][0].magnitude == approx(0.) - assert sec_calc[1].x_gulp_static_dielectric_constant_tensor[2][2] == approx(16.36434) - assert sec_calc[1].x_gulp_high_frequency_dielectric_constant_tensor[1][1] == approx(5.63011) + assert sec_calc[1].x_gulp_piezoelectric_strain_matrix[1][0].magnitude == approx(0.0) + assert sec_calc[1].x_gulp_piezoelectric_stress_matrix[1][0].magnitude == approx(0.0) + assert sec_calc[1].x_gulp_static_dielectric_constant_tensor[2][2] == approx( + 16.36434 + ) + assert sec_calc[1].x_gulp_high_frequency_dielectric_constant_tensor[1][1] == approx( + 5.63011 + ) assert sec_calc[1].x_gulp_static_refractive_indices[1] == approx(3.36052) assert sec_calc[1].x_gulp_high_frequency_refractive_indices[0] == approx(2.37279) sec_opt = sec_calc[0].x_gulp_bulk_optimisation @@ -96,22 +112,32 @@ def test_optimise_conp_property_old(parser): assert sec_opt.x_gulp_max_gradient_component == approx(0.01) sec_workflow = archive.workflow2 - assert sec_workflow.results.elastic_constants_matrix_second_order[1][3].magnitude == approx(-4.45913e+10) - assert sec_workflow.results.compliance_matrix_second_order[4][5].magnitude == approx(-3.838e-12) - assert sec_workflow.results.bulk_modulus_voigt.magnitude == approx(3.5517284e+11) - assert sec_workflow.results.bulk_modulus_reuss.magnitude == approx(3.5201356e+11) - assert sec_workflow.results.shear_modulus_hill.magnitude == approx(1.264132e+11) - assert sec_workflow.results.x_gulp_velocity_s_wave_reuss.magnitude == approx(5337.12) - assert sec_workflow.results.x_gulp_velocity_p_wave_hill.magnitude == approx(11600.06) + assert sec_workflow.results.elastic_constants_matrix_second_order[1][ + 3 + ].magnitude == approx(-4.45913e10) + assert sec_workflow.results.compliance_matrix_second_order[4][ + 5 + ].magnitude == approx(-3.838e-12) + assert sec_workflow.results.bulk_modulus_voigt.magnitude == approx(3.5517284e11) + assert sec_workflow.results.bulk_modulus_reuss.magnitude == approx(3.5201356e11) + assert sec_workflow.results.shear_modulus_hill.magnitude == approx(1.264132e11) + assert sec_workflow.results.x_gulp_velocity_s_wave_reuss.magnitude == approx( + 5337.12 + ) + assert sec_workflow.results.x_gulp_velocity_p_wave_hill.magnitude == approx( + 11600.06 + ) assert sec_workflow.results.x_gulp_compressibility.magnitude == approx(2.8408e-12) - assert sec_workflow.results.x_gulp_youngs_modulus_y.magnitude == approx(3.7496954e+11) + assert sec_workflow.results.x_gulp_youngs_modulus_y.magnitude == approx( + 3.7496954e11 + ) assert sec_workflow.results.x_gulp_poissons_ratio[0][2] == approx(0.19595) def test_single_md_conv_old(parser): archive = EntryArchive() - parser.parse('tests/data/gulp/example18_old/example18.got', archive, None) + parser.parse("tests/data/gulp/example18_old/example18.got", archive, None) sec_system = archive.run[0].system assert len(sec_system) == 1 @@ -123,22 +149,26 @@ def test_single_md_conv_old(parser): sec_calc = archive.run[0].calculation assert len(sec_calc) == 5 assert sec_calc[2].energy.total.value.magnitude == approx(-1.91632663e-16) - assert sec_calc[4].energy.x_gulp_total_averaged.value.magnitude == approx(-2.05507335e-16) + assert sec_calc[4].energy.x_gulp_total_averaged.value.magnitude == approx( + -2.05507335e-16 + ) assert sec_calc[1].energy.total.kinetic.magnitude == approx(3.82803257e-19) assert sec_calc[3].energy.total.potential.magnitude == approx(-2.1107173e-16) - assert sec_calc[2].energy.x_gulp_total_averaged.kinetic.magnitude == approx(5.07815332e-19) + assert sec_calc[2].energy.x_gulp_total_averaged.kinetic.magnitude == approx( + 5.07815332e-19 + ) assert sec_calc[1].time.magnitude == approx(5e-15) assert sec_calc[4].temperature.magnitude == approx(291.528999) - assert sec_calc[1].pressure.magnitude == approx(5.56407e+08) + assert sec_calc[1].pressure.magnitude == approx(5.56407e08) assert sec_calc[2].x_gulp_temperature_averaged.magnitude == approx(389.215575) - assert sec_calc[3].x_gulp_pressure_averaged.magnitude == approx(1.2832591e+10) + assert sec_calc[3].x_gulp_pressure_averaged.magnitude == approx(1.2832591e10) sec_workflow = archive.workflow2 - assert sec_workflow.m_def.name == 'MolecularDynamics' - assert sec_workflow.method.thermodynamic_ensemble == 'NVT' + assert sec_workflow.m_def.name == "MolecularDynamics" + assert sec_workflow.method.thermodynamic_ensemble == "NVT" assert sec_workflow.method.integration_timestep.magnitude == approx(1e-15) assert sec_workflow.x_gulp_production_time.magnitude == approx(5e-13) - assert sec_workflow.x_gulp_td_field_start_time.magnitude == approx(0.) + assert sec_workflow.x_gulp_td_field_start_time.magnitude == approx(0.0) assert sec_workflow.x_gulp_n_degrees_of_freedom == approx(189) assert sec_workflow.x_gulp_friction_temperature_bath == approx(0.1) @@ -146,13 +176,15 @@ def test_single_md_conv_old(parser): def test_opti_mole_defe(parser): archive = EntryArchive() - parser.parse('tests/data/gulp/example8/example8.got', archive, None) + parser.parse("tests/data/gulp/example8/example8.got", archive, None) sec_model = archive.run[0].method[0].force_field.model assert len(sec_model) == 4 - assert sec_model[0].contributions[1].functional_form == 'Spring (c-s)' - assert sec_model[1].contributions[0].atom_labels[1] == 'O' - assert sec_model[2].contributions[0].parameters['Buckingham rho'] == approx(0.19760000) + assert sec_model[0].contributions[1].functional_form == "Spring (c-s)" + assert sec_model[1].contributions[0].atom_labels[0][1] == "O" + assert sec_model[2].contributions[0].parameters["Buckingham rho"] == approx( + 0.19760000 + ) sec_system = archive.run[0].system assert len(sec_system) == 3 diff --git a/tests/test_lammpsparser.py b/tests/test_lammpsparser.py index 968ff7f8..dc718225 100644 --- a/tests/test_lammpsparser.py +++ b/tests/test_lammpsparser.py @@ -27,51 +27,69 @@ def approx(value, abs=0, rel=1e-6): return pytest.approx(value, abs=abs, rel=rel) -@pytest.fixture(scope='module') +@pytest.fixture(scope="module") def parser(): return LammpsParser() def test_nvt(parser): archive = EntryArchive() - parser.parse('tests/data/lammps/hexane_cyclohexane/log.hexane_cyclohexane_nvt', archive, None) + parser.parse( + "tests/data/lammps/hexane_cyclohexane/log.hexane_cyclohexane_nvt", archive, None + ) sec_run = archive.run[0] - assert sec_run.program.version == '14 May 2016' + assert sec_run.program.version == "14 May 2016" sec_workflow = archive.workflow2 - assert sec_workflow.m_def.name == 'MolecularDynamics' - assert sec_workflow.method.thermodynamic_ensemble == 'NVT' - assert sec_workflow.method.integrator_type == 'velocity_verlet' + assert sec_workflow.m_def.name == "MolecularDynamics" + assert sec_workflow.method.thermodynamic_ensemble == "NVT" + assert sec_workflow.method.integrator_type == "velocity_verlet" assert sec_workflow.method.integration_timestep.magnitude == 2.5e-16 - assert sec_workflow.method.integration_timestep.units == 'second' + assert sec_workflow.method.integration_timestep.units == "second" assert sec_workflow.method.n_steps == 80000 assert sec_workflow.method.coordinate_save_frequency == 400 assert sec_workflow.method.thermodynamics_save_frequency == 400 - assert sec_workflow.method.thermostat_parameters[0].thermostat_type == 'nose_hoover' - assert sec_workflow.method.thermostat_parameters[0].reference_temperature.magnitude == 300.0 - assert sec_workflow.method.thermostat_parameters[0].reference_temperature.units == 'kelvin' - assert sec_workflow.method.thermostat_parameters[0].coupling_constant.magnitude == 2.5e-14 - assert sec_workflow.method.thermostat_parameters[0].coupling_constant.units == 'second' + assert sec_workflow.method.thermostat_parameters[0].thermostat_type == "nose_hoover" + assert ( + sec_workflow.method.thermostat_parameters[0].reference_temperature.magnitude + == 300.0 + ) + assert ( + sec_workflow.method.thermostat_parameters[0].reference_temperature.units + == "kelvin" + ) + assert ( + sec_workflow.method.thermostat_parameters[0].coupling_constant.magnitude + == 2.5e-14 + ) + assert ( + sec_workflow.method.thermostat_parameters[0].coupling_constant.units == "second" + ) sec_method = sec_run.method[0] assert len(sec_method.force_field.model[0].contributions) == 3 - assert sec_method.force_field.model[0].contributions[1].type == 'bond' + assert sec_method.force_field.model[0].contributions[1].type == "bond" assert sec_method.force_field.model[0].contributions[1].n_interactions == 666 assert sec_method.force_field.model[0].contributions[1].n_atoms == 2 - assert sec_method.force_field.model[0].contributions[1].atom_indices[100][1] == 103 - assert sec_method.force_field.model[0].contributions[1].parameters[200] == approx(1.1147454117684314) - assert sec_method.force_field.model[0].contributions[1].atom_labels[350][0] == '2' - assert sec_method.force_field.force_calculations.coulomb_cutoff.magnitude == 1.2000000000000002e-08 - assert sec_method.force_field.force_calculations.coulomb_cutoff.units == 'meter' - assert sec_method.force_field.force_calculations.neighbor_searching.neighbor_update_frequency == 10 + assert sec_method.force_field.model[0].contributions[1].atom_indices[100, 1] == 103 + assert sec_method.force_field.model[0].contributions[1].atom_labels[350, 0] == "1" + assert ( + sec_method.force_field.force_calculations.coulomb_cutoff.magnitude + == 1.2000000000000002e-08 + ) + assert sec_method.force_field.force_calculations.coulomb_cutoff.units == "meter" + assert ( + sec_method.force_field.force_calculations.neighbor_searching.neighbor_update_frequency + == 10 + ) sec_system = sec_run.system assert len(sec_system) == 201 assert sec_system[5].atoms.lattice_vectors[1][1].magnitude == approx(2.24235e-09) assert False not in sec_system[0].atoms.periodic - assert sec_system[80].atoms.labels[91:96] == ['H', 'H', 'H', 'C', 'C'] - assert sec_system[0].atoms.bond_list[200][0] == 194 + assert sec_system[80].atoms.labels[91:96] == ["H", "H", "H", "C", "C"] + assert sec_system[0].atoms.bond_list[200, 0] == 194 sec_scc = sec_run.calculation assert len(sec_scc) == 201 @@ -80,18 +98,23 @@ def test_nvt(parser): assert sec_scc[103].temperature.magnitude == 291.4591 assert sec_scc[11].step == 4400 assert len(sec_scc[1].energy.contributions) == 9 - assert sec_scc[112].energy.contributions[8].kind == 'kspace long range' + assert sec_scc[112].energy.contributions[8].kind == "kspace long range" assert sec_scc[96].energy.contributions[2].value.magnitude == approx(1.19666271e-18) assert sec_scc[47].energy.contributions[4].value.magnitude == approx(1.42166035e-18) assert sec_scc[75].time_physical.magnitude == approx(83.56332225) assert sec_scc[112].time_calculation.magnitude == approx(1.2351 / 400) - assert sec_run.x_lammps_section_control_parameters[0].x_lammps_inout_control_atomstyle == 'full' + assert ( + sec_run.x_lammps_section_control_parameters[0].x_lammps_inout_control_atomstyle + == "full" + ) def test_thermo_format(parser): archive = EntryArchive() - parser.parse('tests/data/lammps/1_methyl_naphthalene/log.1_methyl_naphthalene', archive, None) + parser.parse( + "tests/data/lammps/1_methyl_naphthalene/log.1_methyl_naphthalene", archive, None + ) sec_sccs = archive.run[0].calculation assert len(sec_sccs) == 301 @@ -102,7 +125,11 @@ def test_thermo_format(parser): def test_traj_xyz(parser): archive = EntryArchive() - parser.parse('tests/data/lammps/methane_xyz/log.methane_nvt_traj_xyz_thermo_style_custom', archive, None) + parser.parse( + "tests/data/lammps/methane_xyz/log.methane_nvt_traj_xyz_thermo_style_custom", + archive, + None, + ) sec_systems = archive.run[0].system assert len(sec_systems) == 201 @@ -111,7 +138,11 @@ def test_traj_xyz(parser): def test_traj_dcd(parser): archive = EntryArchive() - parser.parse('tests/data/lammps/methane_dcd/log.methane_nvt_traj_dcd_thermo_style_custom', archive, None) + parser.parse( + "tests/data/lammps/methane_dcd/log.methane_nvt_traj_dcd_thermo_style_custom", + archive, + None, + ) assert len(archive.run[0].calculation) == 201 sec_systems = archive.run[0].system @@ -121,12 +152,17 @@ def test_traj_dcd(parser): def test_unwrapped_pos(parser): archive = EntryArchive() - parser.parse('tests/data/lammps/1_xyz_files/log.lammps', archive, None) + parser.parse("tests/data/lammps/1_xyz_files/log.lammps", archive, None) assert len(archive.run[0].calculation) == 101 sec_systems = archive.run[0].system - assert sec_systems[1].atoms.positions[452][2].magnitude == approx(5.99898) # JFR - units are incorrect?! - assert sec_systems[2].atoms.velocities[457][-2].magnitude == approx(-0.928553) # JFR - velocities are not being read!! + assert sec_systems[1].atoms.positions[452][2].magnitude == approx( + 5.99898 + ) # JFR - units are incorrect?! + assert sec_systems[2].atoms.velocities[457][-2].magnitude == approx( + -0.928553 + ) # JFR - velocities are not being read!! + # TODO Fix dealing with multiple output files with archive_to_universe function, then add back in this test # def test_multiple_dump(parser): @@ -141,7 +177,9 @@ def test_unwrapped_pos(parser): def test_md_atomsgroup(parser): archive = EntryArchive() - parser.parse('tests/data/lammps/polymer_melt/Emin/log.step4.0_minimization', archive, None) + parser.parse( + "tests/data/lammps/polymer_melt/Emin/log.step4.0_minimization", archive, None + ) sec_run = archive.run[0] sec_systems = sec_run.system @@ -149,63 +187,138 @@ def test_md_atomsgroup(parser): assert len(sec_systems[0].atoms_group) == 1 assert len(sec_systems[0].atoms_group[0].atoms_group) == 100 - assert sec_systems[0].atoms_group[0].label == 'group_0' - assert sec_systems[0].atoms_group[0].type == 'molecule_group' + assert sec_systems[0].atoms_group[0].label == "group_0" + assert sec_systems[0].atoms_group[0].type == "molecule_group" assert sec_systems[0].atoms_group[0].index == 0 - assert sec_systems[0].atoms_group[0].composition_formula == '0(100)' + assert sec_systems[0].atoms_group[0].composition_formula == "0(100)" assert sec_systems[0].atoms_group[0].n_atoms == 7200 assert sec_systems[0].atoms_group[0].atom_indices[5] == 5 assert sec_systems[0].atoms_group[0].is_molecule is False - assert sec_systems[0].atoms_group[0].atoms_group[52].label == '0' - assert sec_systems[0].atoms_group[0].atoms_group[52].type == 'molecule' + assert sec_systems[0].atoms_group[0].atoms_group[52].label == "0" + assert sec_systems[0].atoms_group[0].atoms_group[52].type == "molecule" assert sec_systems[0].atoms_group[0].atoms_group[52].index == 52 - assert sec_systems[0].atoms_group[0].atoms_group[52].composition_formula == '1(1)2(1)3(1)4(1)5(1)6(1)7(1)8(1)9(1)10(1)' + assert ( + sec_systems[0].atoms_group[0].atoms_group[52].composition_formula + == "1(1)2(1)3(1)4(1)5(1)6(1)7(1)8(1)9(1)10(1)" + ) assert sec_systems[0].atoms_group[0].atoms_group[52].n_atoms == 72 assert sec_systems[0].atoms_group[0].atoms_group[52].atom_indices[8] == 3752 assert sec_systems[0].atoms_group[0].atoms_group[52].is_molecule is True - assert sec_systems[0].atoms_group[0].atoms_group[76].atoms_group[7].label == 'group_8' - assert sec_systems[0].atoms_group[0].atoms_group[76].atoms_group[7].type == 'monomer_group' + assert ( + sec_systems[0].atoms_group[0].atoms_group[76].atoms_group[7].label == "group_8" + ) + assert ( + sec_systems[0].atoms_group[0].atoms_group[76].atoms_group[7].type + == "monomer_group" + ) assert sec_systems[0].atoms_group[0].atoms_group[76].atoms_group[7].index == 7 - assert sec_systems[0].atoms_group[0].atoms_group[76].atoms_group[7].composition_formula == '8(1)' + assert ( + sec_systems[0].atoms_group[0].atoms_group[76].atoms_group[7].composition_formula + == "8(1)" + ) assert sec_systems[0].atoms_group[0].atoms_group[76].atoms_group[7].n_atoms == 7 - assert sec_systems[0].atoms_group[0].atoms_group[76].atoms_group[7].atom_indices[5] == 5527 - assert sec_systems[0].atoms_group[0].atoms_group[76].atoms_group[7].is_molecule is False - - assert sec_systems[0].atoms_group[0].atoms_group[76].atoms_group[7].atoms_group[0].label == '8' - assert sec_systems[0].atoms_group[0].atoms_group[76].atoms_group[7].atoms_group[0].type == 'monomer' - assert sec_systems[0].atoms_group[0].atoms_group[76].atoms_group[7].atoms_group[0].index == 0 - assert sec_systems[0].atoms_group[0].atoms_group[76].atoms_group[7].atoms_group[0].composition_formula == '1(4)4(2)6(1)' - assert sec_systems[0].atoms_group[0].atoms_group[76].atoms_group[7].atoms_group[0].n_atoms == 7 - assert sec_systems[0].atoms_group[0].atoms_group[76].atoms_group[7].atoms_group[0].atom_indices[5] == 5527 - assert sec_systems[0].atoms_group[0].atoms_group[76].atoms_group[7].atoms_group[0].is_molecule is False + assert ( + sec_systems[0].atoms_group[0].atoms_group[76].atoms_group[7].atom_indices[5] + == 5527 + ) + assert ( + sec_systems[0].atoms_group[0].atoms_group[76].atoms_group[7].is_molecule + is False + ) + + assert ( + sec_systems[0] + .atoms_group[0] + .atoms_group[76] + .atoms_group[7] + .atoms_group[0] + .label + == "8" + ) + assert ( + sec_systems[0].atoms_group[0].atoms_group[76].atoms_group[7].atoms_group[0].type + == "monomer" + ) + assert ( + sec_systems[0] + .atoms_group[0] + .atoms_group[76] + .atoms_group[7] + .atoms_group[0] + .index + == 0 + ) + assert ( + sec_systems[0] + .atoms_group[0] + .atoms_group[76] + .atoms_group[7] + .atoms_group[0] + .composition_formula + == "1(4)4(2)6(1)" + ) + assert ( + sec_systems[0] + .atoms_group[0] + .atoms_group[76] + .atoms_group[7] + .atoms_group[0] + .n_atoms + == 7 + ) + assert ( + sec_systems[0] + .atoms_group[0] + .atoms_group[76] + .atoms_group[7] + .atoms_group[0] + .atom_indices[5] + == 5527 + ) + assert ( + sec_systems[0] + .atoms_group[0] + .atoms_group[76] + .atoms_group[7] + .atoms_group[0] + .is_molecule + is False + ) def test_geometry_optimization(parser): archive = EntryArchive() - parser.parse('tests/data/lammps/polymer_melt/Emin/log.step4.0_minimization', archive, None) + parser.parse( + "tests/data/lammps/polymer_melt/Emin/log.step4.0_minimization", archive, None + ) sec_workflow = archive.workflow2 - assert sec_workflow.method.type == 'atomic' - assert sec_workflow.method.method == 'polak_ribiere_conjugant_gradient' + assert sec_workflow.method.type == "atomic" + assert sec_workflow.method.method == "polak_ribiere_conjugant_gradient" - assert sec_workflow.method.convergence_tolerance_energy_difference.magnitude == approx(0.0) - assert sec_workflow.method.convergence_tolerance_energy_difference.units == 'joule' + assert ( + sec_workflow.method.convergence_tolerance_energy_difference.magnitude + == approx(0.0) + ) + assert sec_workflow.method.convergence_tolerance_energy_difference.units == "joule" assert sec_workflow.results.final_energy_difference.magnitude == approx(0.0) - assert sec_workflow.results.final_energy_difference.units == 'joule' + assert sec_workflow.results.final_energy_difference.units == "joule" - assert sec_workflow.method.convergence_tolerance_force_maximum.magnitude == approx(100) - assert sec_workflow.method.convergence_tolerance_force_maximum.units == 'newton' + assert sec_workflow.method.convergence_tolerance_force_maximum.magnitude == approx( + 100 + ) + assert sec_workflow.method.convergence_tolerance_force_maximum.units == "newton" assert sec_workflow.results.final_force_maximum.magnitude == approx(5091750000.0) - assert sec_workflow.results.final_force_maximum.units == 'newton' + assert sec_workflow.results.final_force_maximum.units == "newton" assert sec_workflow.method.optimization_steps_maximum == 10000 assert sec_workflow.results.optimization_steps == 160 assert len(sec_workflow.results.energies) == 159 assert sec_workflow.results.energies[14].magnitude == approx(6.931486093999211e-17) - assert sec_workflow.results.energies[14].units == 'joule' + assert sec_workflow.results.energies[14].units == "joule" assert len(sec_workflow.results.steps) == 159 assert sec_workflow.results.steps[22] == 1100