diff --git a/parser/parser-tinker/setup_paths.py b/setup.py similarity index 55% rename from parser/parser-tinker/setup_paths.py rename to setup.py index ea06cf4d5c80d476807a03677f8a7b8eb45ee424..81e014bef39b77bc98e3c7996e48beabb4c9aabf 100644 --- a/parser/parser-tinker/setup_paths.py +++ b/setup.py @@ -1,22 +1,34 @@ -# Copyright 2018-2018 Berk Onat -# +# Copyright 2015-2018 Berk Onat +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -import sys -import os -import os.path -basedir = os.path.dirname(os.path.abspath(__file__)) -commondir = os.path.normpath(os.path.join(basedir,"../../../../python-common/common/python")) +from setuptools import setup, find_packages -if not commondir in sys.path: - sys.path.insert(0, commondir) + +def main(): + setup( + name='tinkerparser', + version='0.1', + description='NOMAD parser implementation for TINKER.', + license='APACHE 2.0', + package_dir={'': './'}, + packages=find_packages(), + install_requires=[ + 'nomadcore', + 'nomad' + ], + ) + + +if __name__ == '__main__': + main() diff --git a/src/main/scala/eu/nomad_lab/parsers/TinkerParser.scala b/src/main/scala/eu/nomad_lab/parsers/TinkerParser.scala deleted file mode 100644 index aeeda762df6d131e5c8955b8a37e05f3cc28a15b..0000000000000000000000000000000000000000 --- a/src/main/scala/eu/nomad_lab/parsers/TinkerParser.scala +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2018-2018 Berk Onat - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package eu.nomad_lab.parsers - -import eu.nomad_lab -import eu.nomad_lab.DefaultPythonInterpreter -import org.{ json4s => jn } -import eu.{ nomad_lab => lab } -import scala.collection.breakOut - -object TinkerParser extends SimpleExternalParserGenerator( - name = "TinkerParser", - parserInfo = jn.JObject( - ("name" -> jn.JString("TinkerParser")) :: - ("parserId" -> jn.JString("TinkerParser" + lab.TinkerVersionInfo.version)) :: - ("versionInfo" -> jn.JObject( - ("nomadCoreVersion" -> jn.JObject(lab.NomadCoreVersionInfo.toMap.map { - case (k, v) => k -> jn.JString(v.toString) - }(breakOut): List[(String, jn.JString)])) :: - (lab.TinkerVersionInfo.toMap.map { - case (key, value) => - (key -> jn.JString(value.toString)) - }(breakOut): List[(String, jn.JString)]) - )) :: Nil - ), - mainFileTypes = Seq("text/.*"), - mainFileRe = """\s*#+\s*TINKER\s*---\s*Software\s*Tools\s*for\s*Molecular\s*Design\s*#+\s*""".r, - cmd = Seq(DefaultPythonInterpreter.pythonExe(), "${envDir}/parsers/tinker/parser/parser-tinker/TINKERParser.py", - "${mainFilePath}"), - resList = Seq( - "parser-tinker/TINKERParser.py", - "parser-tinker/TINKERDictionary.py", - "parser-tinker/TINKERCommon.py", - "parser-tinker/setup_paths.py", - "nomad_meta_info/public.nomadmetainfo.json", - "nomad_meta_info/common.nomadmetainfo.json", - "nomad_meta_info/meta_types.nomadmetainfo.json", - "nomad_meta_info/tinker.nomadmetainfo.json" - ) ++ DefaultPythonInterpreter.commonFiles(), - dirMap = Map( - "parser-tinker" -> "parsers/tinker/parser/parser-tinker", - "nomad_meta_info" -> "nomad-meta-info/meta_info/nomad_meta_info", - "python" -> "python-common/common/python/nomadcore" - ) ++ DefaultPythonInterpreter.commonDirMapping(), - metaInfoEnv = Some(lab.meta.KnownMetaInfoEnvs.tinker) -) - diff --git a/src/test/scala/eu/nomad_lab/parsers/TinkerParserSpec.scala b/src/test/scala/eu/nomad_lab/parsers/TinkerParserSpec.scala deleted file mode 100644 index 05ca218541b5c9202269ab77d080843b9083ee0a..0000000000000000000000000000000000000000 --- a/src/test/scala/eu/nomad_lab/parsers/TinkerParserSpec.scala +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2018-2018 Berk Onat - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package eu.nomad_lab.parsers - -import org.specs2.mutable.Specification - -object TinkerParserTests extends Specification { - "TinkerParserTest" >> { - "[Anion in Water (xyz sequence of outputs with 643 atoms)] test with json-events" >> { - ParserRun.parse(TinkerParser, "parsers/tinker/test/examples/anion/anion.log", "json-events") must_== ParseResult.ParseSuccess - } - "[Anion in Water (xyz sequence of outputs with 643 atoms)] test with json" >> { - ParserRun.parse(TinkerParser, "parsers/tinker/test/examples/anion/anion.log", "json") must_== ParseResult.ParseSuccess - } - "[Ice (.arc trajectory with 3024 atoms)] test with json-events" >> { - ParserRun.parse(TinkerParser, "parsers/tinker/test/examples/ice/ice.log", "json-events") must_== ParseResult.ParseSuccess - } - "[Ice (.arc trajectory with 3024 atoms)] test with json" >> { - ParserRun.parse(TinkerParser, "parsers/tinker/test/examples/ice/ice.log", "json") must_== ParseResult.ParseSuccess - } - } -} diff --git a/tinkerparser.egg-info/PKG-INFO b/tinkerparser.egg-info/PKG-INFO new file mode 100644 index 0000000000000000000000000000000000000000..46db525b5d6da02d2812cdc820145859e4499346 --- /dev/null +++ b/tinkerparser.egg-info/PKG-INFO @@ -0,0 +1,10 @@ +Metadata-Version: 1.0 +Name: tinkerparser +Version: 0.1 +Summary: NOMAD parser implementation for TINKER. +Home-page: UNKNOWN +Author: UNKNOWN +Author-email: UNKNOWN +License: APACHE 2.0 +Description: UNKNOWN +Platform: UNKNOWN diff --git a/tinkerparser.egg-info/SOURCES.txt b/tinkerparser.egg-info/SOURCES.txt new file mode 100644 index 0000000000000000000000000000000000000000..dcb79743e51de880134a89231c100acb9fd06c07 --- /dev/null +++ b/tinkerparser.egg-info/SOURCES.txt @@ -0,0 +1,11 @@ +README.md +setup.py +./tinkerparser/TINKERCommon.py +./tinkerparser/TINKERDictionary.py +./tinkerparser/TINKERParser.py +./tinkerparser/__init__.py +./tinkerparser.egg-info/PKG-INFO +./tinkerparser.egg-info/SOURCES.txt +./tinkerparser.egg-info/dependency_links.txt +./tinkerparser.egg-info/requires.txt +./tinkerparser.egg-info/top_level.txt \ No newline at end of file diff --git a/tinkerparser.egg-info/dependency_links.txt b/tinkerparser.egg-info/dependency_links.txt new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/tinkerparser.egg-info/dependency_links.txt @@ -0,0 +1 @@ + diff --git a/tinkerparser.egg-info/requires.txt b/tinkerparser.egg-info/requires.txt new file mode 100644 index 0000000000000000000000000000000000000000..3128dc7c9ee27ec353b6cf61ea77c0818a26d32b --- /dev/null +++ b/tinkerparser.egg-info/requires.txt @@ -0,0 +1,2 @@ +nomadcore +nomad diff --git a/tinkerparser.egg-info/top_level.txt b/tinkerparser.egg-info/top_level.txt new file mode 100644 index 0000000000000000000000000000000000000000..1284d8bb3463e290d7b35713846c90a48e0a3d51 --- /dev/null +++ b/tinkerparser.egg-info/top_level.txt @@ -0,0 +1 @@ +tinkerparser diff --git a/parser/parser-tinker/TINKERCommon.py b/tinkerparser/TINKERCommon.py similarity index 100% rename from parser/parser-tinker/TINKERCommon.py rename to tinkerparser/TINKERCommon.py diff --git a/parser/parser-tinker/TINKERDictionary.py b/tinkerparser/TINKERDictionary.py similarity index 94% rename from parser/parser-tinker/TINKERDictionary.py rename to tinkerparser/TINKERDictionary.py index db0fc89c2802fb1d4d9df077d87148b2fe6a0dd9..f410235962e3339cedd4b5e07b712294cd000555 100644 --- a/parser/parser-tinker/TINKERDictionary.py +++ b/tinkerparser/TINKERDictionary.py @@ -1,22 +1,21 @@ # Copyright 2018-2018 Berk Onat -# +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -import setup_paths import numpy as np -from TINKERCommon import PARSERNAME, PROGRAMNAME, PARSERTAG +from .TINKERCommon import PARSERNAME, PROGRAMNAME, PARSERTAG from nomadcore.smart_parser.SmartParserDictionary import metaNameConverter, metaNameConverter_UnderscoreSpaceDash -from nomadcore.smart_parser.SmartParserDictionary import MetaInfoMap, FileInfoMap, MapDictionary +from nomadcore.smart_parser.SmartParserDictionary import MetaInfoMap, FileInfoMap, MapDictionary from nomadcore.smart_parser.SmartParserDictionary import getDict_MetaStrInDict, getList_MetaStrInDict, get_unitDict import nomadcore.md_data_access.MDDataAccess as MDData @@ -26,7 +25,7 @@ def get_fileListDict(): Returns: the list of defaults file namelists """ - + startpage = { 'nameTranslate' : metaNameConverter, 'metaHeader' : PARSERTAG, @@ -37,15 +36,15 @@ def get_fileListDict(): 'fileInterface' : ["tinkerread", "parmed", "mdanalysis", "mdtraj", "pymolfile"] } namelist = { - 'structure' : FileInfoMap(startpage, fileFormat=['.tinkerxyz', '.txyz'], activeInfo=False, + 'structure' : FileInfoMap(startpage, fileFormat=['.tinkerxyz', '.txyz'], activeInfo=False, infoPurpose=['topology', 'inputcoordinates']), 'input_coord' : FileInfoMap(startpage, fileFormat=['.tinkerxyz', '.txyz'], activeInfo=False, infoPurpose=['inputcoordinates', 'inputvelocities']), 'output_coord' : FileInfoMap(startpage, fileFormat=['.tinkerdyn', '.dyn'], activeInfo=False, infoPurpose=['outputcoordinates', 'outputvelocities']), - 'trajectory' : FileInfoMap(startpage, fileFormat=['.txyz', '.arc'], activeInfo=False, + 'trajectory' : FileInfoMap(startpage, fileFormat=['.txyz', '.arc'], activeInfo=False, infoPurpose=['trajectory']), - 'parameter' : FileInfoMap(startpage, fileFormat=['.tinkerprm'], activeInfo=False, + 'parameter' : FileInfoMap(startpage, fileFormat=['.tinkerprm'], activeInfo=False, infoPurpose=['forcefield']), 'output_log' : FileInfoMap(startpage), 'control_input' : FileInfoMap(startpage), @@ -60,11 +59,11 @@ def get_nameListDict(deflist): matchWith parameters: EOL = End of line - PL = Match with previous line + PL = Match with previous line PW = Previous word NW = Next word (until space, comma) (DEFAULT) UD = until delimeter (can be any string/character) - + The text matched inside apostrophe or qoutation is extracted Returns: @@ -91,19 +90,19 @@ def get_nameListDict(deflist): 'Random Number Generator Initialized with SEED' : MetaInfoMap(startpage, replaceTag='Random Number Generator seed'), 'Preconditioning' : MetaInfoMap(startpage), - 'Termin' : MetaInfoMap(startpage, matchWith='PW', matchAlso='--', + 'Termin' : MetaInfoMap(startpage, matchWith='PW', matchAlso='--', replaceTag='termination status'), 'nation' : MetaInfoMap(startpage, matchAlso='--', matchWith='EOL', replaceTag='termination reason', subFunc=lambda x: ' '.join(x.strip().replace( 'due to', '').replace('at', '').split()) if x is not None else None), - 'Function Value' : MetaInfoMap(startpage), - 'RMS Gradient' : MetaInfoMap(startpage), - 'RMS Coordinate Gradient' : MetaInfoMap(startpage), - 'RMS Lattice Gradient' : MetaInfoMap(startpage), - 'Final Gradient Norm' : MetaInfoMap(startpage), - 'Coordinate Gradient Norm' : MetaInfoMap(startpage), - 'Lattice Gradient Norm' : MetaInfoMap(startpage), + 'Function Value' : MetaInfoMap(startpage), + 'RMS Gradient' : MetaInfoMap(startpage), + 'RMS Coordinate Gradient' : MetaInfoMap(startpage), + 'RMS Lattice Gradient' : MetaInfoMap(startpage), + 'Final Gradient Norm' : MetaInfoMap(startpage), + 'Coordinate Gradient Norm' : MetaInfoMap(startpage), + 'Lattice Gradient Norm' : MetaInfoMap(startpage), #'' : MetaInfoMap(startpage, defaultValue=None), } @@ -187,16 +186,16 @@ def get_nameListDict(deflist): 'activeSections' : ['section_single_configuration_calculation'] }) mddatalist = { - 'MD Step' : MetaInfoMap(startpage), - 'InputCoordStep' : MetaInfoMap(startpage), - 'OutputCoordStep' : MetaInfoMap(startpage), + 'MD Step' : MetaInfoMap(startpage), + 'InputCoordStep' : MetaInfoMap(startpage), + 'OutputCoordStep' : MetaInfoMap(startpage), 'E Total' : MetaInfoMap(startpage), 'E Potential' : MetaInfoMap(startpage), 'E Kinetic' : MetaInfoMap(startpage), 'Temp' : MetaInfoMap(startpage), 'Pres' : MetaInfoMap(startpage), - 'STEP' : MetaInfoMap(startpage), - 'TIME' : MetaInfoMap(startpage), + 'STEP' : MetaInfoMap(startpage), + 'TIME' : MetaInfoMap(startpage), 'VOLUME' : MetaInfoMap(startpage), 'VIRIAL' : MetaInfoMap(startpage), 'Dynamics Steps' : MetaInfoMap(startpage, defaultValue=None, matchWith='PW'), @@ -216,17 +215,17 @@ def get_nameListDict(deflist): subFunc=lambda x: ','.join(x.strip().split()) if x is not None else None), 'Frame Number' : MetaInfoMap(startpage, defaultValue=None), 'Coordinate File' : MetaInfoMap(startpage, defaultValue=None), - 'VM Iter' : MetaInfoMap(startpage), - 'TN Iter' : MetaInfoMap(startpage), - 'QN Iter' : MetaInfoMap(startpage), - 'CG Iter' : MetaInfoMap(startpage), - 'F Value' : MetaInfoMap(startpage), - 'G RMS' : MetaInfoMap(startpage), - 'RMS G' : MetaInfoMap(startpage), - 'F Move' : MetaInfoMap(startpage), - 'X Move' : MetaInfoMap(startpage), - 'Angle' : MetaInfoMap(startpage), - 'FG Call' : MetaInfoMap(startpage), + 'VM Iter' : MetaInfoMap(startpage), + 'TN Iter' : MetaInfoMap(startpage), + 'QN Iter' : MetaInfoMap(startpage), + 'CG Iter' : MetaInfoMap(startpage), + 'F Value' : MetaInfoMap(startpage), + 'G RMS' : MetaInfoMap(startpage), + 'RMS G' : MetaInfoMap(startpage), + 'F Move' : MetaInfoMap(startpage), + 'X Move' : MetaInfoMap(startpage), + 'Angle' : MetaInfoMap(startpage), + 'FG Call' : MetaInfoMap(startpage), } startpage.update({ @@ -281,7 +280,7 @@ def set_Dictionaries(self): self.stepcontrolDict = { 'logsteps' : None, 'nextlogsteps' : None, - 'trajsteps' : None, + 'trajsteps' : None, 'velsteps' : None, 'forcesteps' : None, 'steps' : None, @@ -298,12 +297,12 @@ def set_Dictionaries(self): 'mddata' : self.mddataDict, 'extra' : self.extraDict, } - self.sectionDict = { - 'section' : { - "metaNameTag" : ['input_output_files', - 'control_parameters'], - "listTypStr" : 'type_section', - "repeatingSection" : False, + self.sectionDict = { + 'section' : { + "metaNameTag" : ['input_output_files', + 'control_parameters'], + "listTypStr" : 'type_section', + "repeatingSection" : False, "supraNames" : ["section_run"] } } @@ -325,7 +324,7 @@ def get_updateDictionary(self, defname): if(st is not None and isinstance(st, str)): if("[" in st or "(" in st): val.append(list(storedtext)) - if val: + if val: return False, np.linalg.norm(np.asarray(val)), itemdict else: return False, itemdict["value"], itemdict @@ -340,27 +339,27 @@ def get_updateDictionary(self, defname): # --------------------------------------------------------------- # Definitions of meta data values for section_sampling_method # --------------------------------------------------------------- - sampling = { + sampling = { #'ensemble_type' : MetaInfoMap(startpage, activeInfo=True, # depends=[ - # {'test' : [['DYNA', ' is not None'], + # {'test' : [['DYNA', ' is not None'], # ['FIRSTT', ' in [\"tcouple\",' # '\"rescale\",' # '\"reassign\",' # '\"andersen\",' - # '\"langevin\"]'], + # '\"langevin\"]'], # ['barostat', ' in [\"berendsen\",' - # '\"langevin\"]']], + # '\"langevin\"]']], # 'assign' : 'NPT'}, - # {'test' : [['minimization', ' is None'], - # ['thermostat', ' in [\"langevin\"]'], + # {'test' : [['minimization', ' is None'], + # ['thermostat', ' in [\"langevin\"]'], # ['thermostat', ' not in [\"tcouple\",' # '\"rescale\",' # '\"reassign\",' # '\"andersen\"]'], # ['barostat', ' is None']], # 'assign' : 'Langevin'}, - # {'test' : [['minimization', ' is None'], + # {'test' : [['minimization', ' is None'], # ['thermostat', ' in [\"tcouple\",' # '\"rescale\",' # '\"reassign\",' @@ -369,16 +368,16 @@ def get_updateDictionary(self, defname): # 'assign' : 'NVT'}, # {'test' : [['minimization', ' is None'], # ['thermostat', ' is None'], - # ['barostat', ' is None']], + # ['barostat', ' is None']], # 'assign' : 'NVE'}, - # {'test' : [['minimization', ' is not None']], + # {'test' : [['minimization', ' is not None']], # 'assign' : 'minimization'}, # ], # lookupdict=self.extraDict # ), - 'sampling_method' : MetaInfoMap(startpage, activeInfo=True, + 'sampling_method' : MetaInfoMap(startpage, activeInfo=True, depends=[ - {'test' : [['MINI', ' is not None']], + {'test' : [['MINI', ' is not None']], 'assign' : 'geometry_optimization'}, {'test' : [['DYNA', ' is not None']], 'assign' : 'molecular_dynamics'} @@ -399,22 +398,22 @@ def get_updateDictionary(self, defname): 'geometry_optimization_method' : MetaInfoMap(startpage, depends=[ {'test' : [['MINI',' is not None'], - ['MINI', ' in [\"SD\",\"sd\"]']], + ['MINI', ' in [\"SD\",\"sd\"]']], 'assign' : 'SD'}, {'test' : [['MINI',' is not None'], - ['MINI', ' in [\"ABNR\",\"abnr\"]']], + ['MINI', ' in [\"ABNR\",\"abnr\"]']], 'assign' : 'Adopted Basis Newton-Raphson'}, {'test' : [['MINI',' is not None'], - ['MINI', ' in [\"NRAP\",\"nrap\"]']], + ['MINI', ' in [\"NRAP\",\"nrap\"]']], 'assign' : 'Newton-Raphson'}, {'test' : [['MINI',' is not None'], - ['MINI', ' in [\"POWELL\",\"powell\"]']], + ['MINI', ' in [\"POWELL\",\"powell\"]']], 'assign' : 'Powell'}, {'test' : [['MINI',' is not None'], - ['MINI', ' in [\"POWE\",\"powe\"]']], + ['MINI', ' in [\"POWE\",\"powe\"]']], 'assign' : 'Powell'}, {'test' : [['MINI',' is not None'], - ['MINI', ' in [\"TNPACK\",\"tnpack\"]']], + ['MINI', ' in [\"TNPACK\",\"tnpack\"]']], 'assign' : 'Truncated Newton Method'}, {'test' : [['MINI',' is not None'], ['MINI', ' not in [\"SD\",\"sd\",' @@ -422,7 +421,7 @@ def get_updateDictionary(self, defname): '\"NRAP\",\"nrap\",' '\"POWE\",\"powe\",' '\"POWELL\",\"powell\",' - '\"TNPACK\",\"tnpack\"]']], + '\"TNPACK\",\"tnpack\"]']], 'assign' : 'CG'}, ], lookupdict=self.cntrlDict, @@ -431,12 +430,12 @@ def get_updateDictionary(self, defname): # 'geometry_optimization_threshold_force' : MetaInfoMap(startpage), #'x_tinker_barostat_type' : MetaInfoMap(startpage, # depends=[ - # {'test' : [['minimization', ' is None'], + # {'test' : [['minimization', ' is None'], # ['barostat', '== \"berendsen\"']], # 'assign' : 'Berendsen'}, - # {'test' : [['minimization', ' is None'], + # {'test' : [['minimization', ' is None'], # ['barostat', '== \"langevin\"']], - # 'assign' : 'Nose-Hoover Langevin'} + # 'assign' : 'Nose-Hoover Langevin'} # ], # lookupdict=self.extraDict, # #autoSections=True, @@ -446,7 +445,7 @@ def get_updateDictionary(self, defname): #'x_tinker_barostat_target_pressure' : MetaInfoMap(startpage, # depends=[ # {'test' : [['TARGET PRESSURE', ' is not None']], - # 'value' : 'TARGET PRESSURE'} + # 'value' : 'TARGET PRESSURE'} # ], # lookupdict=self.cntrlDict, # valtype='float', @@ -459,9 +458,9 @@ def get_updateDictionary(self, defname): #'x_tinker_barostat_tau' : MetaInfoMap(startpage, # depends=[ # {'test' : [['LANGEVIN OSCILLATION PERIOD', ' is not None']], - # 'value' : 'LANGEVIN OSCILLATION PERIOD'}, + # 'value' : 'LANGEVIN OSCILLATION PERIOD'}, # {'test' : [['BERENDSEN RELAXATION TIME', ' is not None']], - # 'value' : 'BERENDSEN RELAXATION TIME'} + # 'value' : 'BERENDSEN RELAXATION TIME'} # ], # lookupdict=self.cntrlDict, # valtype='float', @@ -474,7 +473,7 @@ def get_updateDictionary(self, defname): #'x_tinker_integrator_type' : MetaInfoMap(startpage, # depends=[ # {'test' : [['integrator', ' is not None']], - # 'value' : 'integrator'}, + # 'value' : 'integrator'}, # {'test' : [['thermostat', ' == \"langevin\"']], # 'assign' : 'Langevin'} # ], @@ -507,21 +506,21 @@ def get_updateDictionary(self, defname): ), #'x_tinker_thermostat_type' : MetaInfoMap(startpage, # depends=[ - # {'test' : [['minimization', ' is None'], + # {'test' : [['minimization', ' is None'], # ['thermostat', ' == \"tcouple\"']], - # 'assign' : 'Berendsen'}, - # {'test' : [['minimization', ' is None'], + # 'assign' : 'Berendsen'}, + # {'test' : [['minimization', ' is None'], # ['thermostat', ' == \"rescale\"']], - # 'assign' : 'Velocity Rescaling'}, - # {'test' : [['minimization', ' is None'], + # 'assign' : 'Velocity Rescaling'}, + # {'test' : [['minimization', ' is None'], # ['thermostat', ' == \"reassign\"']], - # 'assign' : 'Velocity Reassigning'}, - # {'test' : [['minimization', ' is None'], + # 'assign' : 'Velocity Reassigning'}, + # {'test' : [['minimization', ' is None'], # ['thermostat', ' == \"andersen\"']], - # 'assign' : 'Andersen'}, - # {'test' : [['minimization', ' is None'], - # ['thermostat', ' == \"langevin\"']], - # 'assign' : 'Nose-Hoover Langevin'}, + # 'assign' : 'Andersen'}, + # {'test' : [['minimization', ' is None'], + # ['thermostat', ' == \"langevin\"']], + # 'assign' : 'Nose-Hoover Langevin'}, # ], # lookupdict=self.extraDict, # #autoSections=True, @@ -582,7 +581,7 @@ def get_updateDictionary(self, defname): # ------------------------------------------------------------ # Definitions for section_single_configuration_calculation # ------------------------------------------------------------ - singleconfcalc = { + singleconfcalc = { #'atom_forces_type' : MetaInfoMap(startpage, # depends=[{'assign' : 'Force Field'}], # lookupdict=self.mddataDict @@ -634,7 +633,7 @@ def get_updateDictionary(self, defname): 'time_single_configuration_calculation_wall_start' : MetaInfoMap(startpage), 'stress_tensor_kind' : MetaInfoMap(startpage, depends=[ - {'test' : [['MINI', ' is not None']], + {'test' : [['MINI', ' is not None']], 'assign' : 'geometry_optimization'}, {'test' : [['DYNA', ' is not None']], 'assign' : 'molecular_dynamics'} @@ -670,7 +669,7 @@ def get_updateDictionary(self, defname): #autoSections=True, activeInfo=True, activeSections=['section_restricted_uri'], - subfunction={ + subfunction={ 'function' : self.parameter_file_name, 'supportDict' : self.cntrlDict, }, @@ -700,11 +699,11 @@ def get_updateDictionary(self, defname): activeSections=['section_restricted_uri'] ), } - + # ------------------------------------------ # Definitions for section_frame_sequence # ------------------------------------------ - frameseq = { + frameseq = { #'frame_sequence_conserved_quantity_frames' : MetaInfoMap(startpage, # depends=[{'store' : 'TS'}], # valtype='int', @@ -801,7 +800,7 @@ def get_updateDictionary(self, defname): depends=[{'store' : 'TIME'}], valtype='float', unitdict=self.unitDict, - unit='pico-second', + unit='pico-second', # Calculates in AKMA units including inputs but prints in picoseconds. lookupdict=self.mddataDict ), @@ -1014,7 +1013,7 @@ def get_updateDictionary(self, defname): #'previous_sequence_ref' : MetaInfoMap(startpage) } - frameseqend = { + frameseqend = { #'number_of_conserved_quantity_evaluations_in_sequence' : MetaInfoMap(startpage, # activeInfo=True, # value=(lambda x: np.array(x['val']).flatten().shape[0] if( @@ -1204,7 +1203,7 @@ def get_updateDictionary(self, defname): 'system_name' : MetaInfoMap(startpage, activeInfo=True, activeSections=['section_system'], - subfunction={ + subfunction={ 'function' : MDData.MDDataConverter.topology_system_name, 'supportDict' : self.topoDict, }, @@ -1331,7 +1330,7 @@ def get_updateDictionary(self, defname): 'number_of_atoms_per_molecule_interaction' : MetaInfoMap(startpage), 'number_of_molecule_interactions' : MetaInfoMap(startpage) } - + # section_atom_in_molecule of section_molecule_type atom_in_mol = { 'atom_in_molecule_charge' : MetaInfoMap(startpage), diff --git a/parser/parser-tinker/TINKERParser.py b/tinkerparser/TINKERParser.py similarity index 91% rename from parser/parser-tinker/TINKERParser.py rename to tinkerparser/TINKERParser.py index 70354e9f6e068919d29803ba42ea1751cfe032e2..3b93c3bc74abb0c38d3c41034a7a964ac13c51a1 100644 --- a/parser/parser-tinker/TINKERParser.py +++ b/tinkerparser/TINKERParser.py @@ -1,7 +1,6 @@ from builtins import map from builtins import range from builtins import object -import setup_paths import numpy as np import nomadcore.ActivateLogging from nomadcore.caching_backend import CachingLevel @@ -10,9 +9,9 @@ from nomadcore.smart_parser import SmartParserCommon as SmartParser from nomadcore.smart_parser.SmartParserCommon import get_metaInfo, conv_str, conv_int, conv_float, open_section from nomadcore.smart_parser.SmartParserDictionary import getList_MetaStrInDict, getDict_MetaStrInDict from nomadcore.smart_parser.SmartParserDictionary import isMetaStrInDict, setMetaStrInDict, copyMetaDictToDict -from TINKERDictionary import get_updateDictionary, set_Dictionaries -from TINKERCommon import PARSERNAME, PROGRAMNAME, PARSERVERSION, PARSERTAG, LOGGER -from TINKERCommon import PARSER_INFO_DEFAULT, META_INFO_PATH, set_excludeList, set_includeList +from .TINKERDictionary import get_updateDictionary, set_Dictionaries +from .TINKERCommon import PARSERNAME, PROGRAMNAME, PARSERVERSION, PARSERTAG, LOGGER +from .TINKERCommon import PARSER_INFO_DEFAULT, META_INFO_PATH, set_excludeList, set_includeList from nomadcore.md_data_access import MDDataAccess as MDDA #from nomadcore.md_data_access.MDDataAccess import is_file_binary, is_binary_string import argparse @@ -34,7 +33,7 @@ TEXTCHARS = bytearray({7,8,9,10,12,13,27} | set(range(0x20, 0x100)) - {0x7f}) def is_file_binary(fName, checkBytes=None): if checkBytes is None: - checkBytes = 1024 + checkBytes = 1024 with open(fName, 'rb') as fin: testin = fin.read(checkBytes) if is_binary_string(testin): @@ -64,7 +63,7 @@ class TINKERParser(SmartParser.ParserBase): } SmartParser.ParserBase.__init__( self, re_program_name=re.compile(r"\s*"+PROGRAMNAME+"$"), - parsertag=PARSERTAG, metainfopath=META_INFO_PATH, + parsertag=PARSERTAG, metainfopath=META_INFO_PATH, parserinfodef=PARSER_INFO_DEFAULT, recorderOn=True) set_Dictionaries(self) @@ -82,27 +81,27 @@ class TINKERParser(SmartParser.ParserBase): metaInfo = self.metaInfoEnv.infoKinds[name] if (name.startswith(PARSERTAG + '_mdin_') and metaInfo.kindStr == "type_document_content" and - (PARSERTAG + "_mdin_method" in metaInfo.superNames or - PARSERTAG + "_mdin_run" in metaInfo.superNames or + (PARSERTAG + "_mdin_method" in metaInfo.superNames or + PARSERTAG + "_mdin_run" in metaInfo.superNames or PARSERTAG + "_mdin_system" in metaInfo.superNames) or name.startswith(PARSERTAG + '_parm_') and metaInfo.kindStr == "type_document_content" and - (PARSERTAG + "_mdin_method" in metaInfo.superNames or + (PARSERTAG + "_mdin_method" in metaInfo.superNames or PARSERTAG + "_mdin_run" in metaInfo.superNames or PARSERTAG + "_mdin_system" in metaInfo.superNames) or #name.startswith(PARSERTAG + '_mdin_file_') and name.startswith(PARSERTAG + '_inout_file_') or #metaInfo.kindStr == "type_document_content" and - #(PARSERTAG + "_section_input_output_files" in metaInfo.superNames or + #(PARSERTAG + "_section_input_output_files" in metaInfo.superNames or # "section_run" in metaInfo.superNames) or name.startswith(PARSERTAG + '_inout_control_') or - #(PARSERTAG + "_section_control_parameters" in metaInfo.superNames) or + #(PARSERTAG + "_section_control_parameters" in metaInfo.superNames) or #name.startswith(PARSERTAG + '_mdin_') and #(PARSERTAG + "_section_control_parameters" in metaInfo.superNames) or name.startswith(PARSERTAG + '_mdout_') or name.startswith(PARSERTAG + '_mdout_') and #metaInfo.kindStr == "type_document_content" and - (PARSERTAG + "_mdout_method" in metaInfo.superNames or + (PARSERTAG + "_mdout_method" in metaInfo.superNames or PARSERTAG + "_mdout_system" in metaInfo.superNames or "section_run" in metaInfo.superNames or PARSERTAG + "_mdout_single_configuration_calculation" in metaInfo.superNames) @@ -251,8 +250,8 @@ class TINKERParser(SmartParser.ParserBase): def onClose_section_run(self, backend, gIndex, section): """Trigger called when section_run is closed. - Write the keywords from control parametres and - the TINKER output from the parsed log output, + Write the keywords from control parametres and + the TINKER output from the parsed log output, which belong to settings_run. Variables are reset to ensure clean start for new run. """ @@ -265,7 +264,7 @@ class TINKERParser(SmartParser.ParserBase): 'dictionary' : section_frameseq_Dict } self.metaStorage.update(updateFrameDict) - self.metaStorage.updateBackend(backend.superBackend, + self.metaStorage.updateBackend(backend.superBackend, startsection=['section_frame_sequence'], autoopenclose=False) backend.addValue("frame_sequence_to_sampling_ref", self.secSamplingGIndex) @@ -300,14 +299,14 @@ class TINKERParser(SmartParser.ParserBase): Determine whether topology, trajectory and input coordinate files are supplied to the parser - + Initiates topology and trajectory file handles. - Captures topology, atomic positions, atom labels, lattice vectors and - stores them before section_system and + Captures topology, atomic positions, atom labels, lattice vectors and + stores them before section_system and section_single_configuration_calculation are encountered. """ - # Checking whether topology, input + # Checking whether topology, input # coordinates and trajectory files exist fileList=None fKey = PARSERTAG + '_inout_file_' @@ -468,7 +467,7 @@ class TINKERParser(SmartParser.ParserBase): 'dictionary' : section_control_Dict } self.metaStorage.update(updateDict) - self.metaStorage.updateBackend(backend.superBackend, + self.metaStorage.updateBackend(backend.superBackend, startsection=[PARSERTAG+'_section_control_parameters'], autoopenclose=False) @@ -495,8 +494,8 @@ class TINKERParser(SmartParser.ParserBase): ninputstep = 0 noutputstep = 0 ntrajsteps = 0 - nvelsteps = 0 - nforcesteps = 0 + nvelsteps = 0 + nforcesteps = 0 filesteps = None filefreq = None numSecRun = str(self.secRunGIndex) @@ -545,7 +544,7 @@ class TINKERParser(SmartParser.ParserBase): if noutputKey is not None: if self.filecntrlDict[noutputKey].activeInfo: noutputstep = 1 - + if nlogsteps>0: logsteps = [i for i in range(1, nsteps, nlogsteps)] logsteps.append(nsteps) @@ -622,7 +621,7 @@ class TINKERParser(SmartParser.ParserBase): 'dictionary' : section_file_Dict } self.metaStorage.update(updateDict) - self.metaStorage.updateBackend(backend.superBackend, + self.metaStorage.updateBackend(backend.superBackend, startsection=[PARSERTAG+'_section_control_parameters'], autoopenclose=False) parmmeta = isMetaStrInDict("parameters",self.cntrlDict) @@ -635,7 +634,7 @@ class TINKERParser(SmartParser.ParserBase): 'dictionary' : restrictionsDict } self.metaStorageRestrict.update(updateDict) - self.metaStorageRestrict.updateBackend(backend.superBackend, + self.metaStorageRestrict.updateBackend(backend.superBackend, startsection=['section_restricted_uri'], autoopenclose=False) backend.superBackend.closeSection("section_restricted_uri", self.secRestrictGIndex) @@ -681,13 +680,13 @@ class TINKERParser(SmartParser.ParserBase): 'dictionary' : section_sampling_Dict } self.metaStorage.update(updateDict) - self.metaStorage.updateBackend(backend.superBackend, + self.metaStorage.updateBackend(backend.superBackend, startsection=['section_run'], #startsection=['section_sampling_method'], autoopenclose=False) if (gIndex is None or gIndex == -1 or gIndex == "-1"): backend.superBackend.closeSection("section_sampling_method", self.secSamplingGIndex) - + def onOpen_section_topology(self, backend, gIndex, section): # keep track of the latest topology description section if (gIndex is None or gIndex == -1 or gIndex == "-1"): @@ -706,7 +705,7 @@ class TINKERParser(SmartParser.ParserBase): 'dictionary' : section_topology_Dict } self.metaStorage.update(updateDict) - self.metaStorage.updateBackend(backend.superBackend, + self.metaStorage.updateBackend(backend.superBackend, startsection=['section_topology'], autoopenclose=False) self.topology_atom_type_and_interactions(backend, gIndex) @@ -732,7 +731,7 @@ class TINKERParser(SmartParser.ParserBase): SloppyBackend = backend.superBackend else: SloppyBackend = backend - + numatoms = None if self.numatoms is not None: numatoms = self.numatoms @@ -758,11 +757,11 @@ class TINKERParser(SmartParser.ParserBase): if self.trajectory is not None: if self.trajectory.unitcell_vectors is None: self.trajectory.unitcell_vectors = unit_vectors - + if self.topology: if self.newTopo: # if (self.secTopologyGIndex is None or -# (self.secTopologyGIndex == -1 or +# (self.secTopologyGIndex == -1 or # self.secTopologyGIndex == "-1")): self.onOpen_section_topology(backend, None, None) self.onClose_section_topology(backend, None, None) @@ -775,7 +774,7 @@ class TINKERParser(SmartParser.ParserBase): if self.trajectory is not None: coordinates=self.trajectory positions=self.atompositions - elif(self.inputcoords is not None and + elif(self.inputcoords is not None and self.MDcurrentstep == steps[0]): coordinates=self.inputcoords positions=self.inputpositions @@ -802,9 +801,9 @@ class TINKERParser(SmartParser.ParserBase): SloppyBackend.addArrayValues('atom_positions', np.transpose(np.asarray( self.metaStorage.convertUnits(positions, "nano-meter", self.unitDict)))) if coordinates.velocities is not None: - # Velocities in PDB files are stored in A/ps units.(PDB files are read for input + # Velocities in PDB files are stored in A/ps units.(PDB files are read for input # coordinates, velocities, and forces) - # Velocities in TINKER binary/DCD files are stored in TINKER internal units and must be multiplied + # Velocities in TINKER binary/DCD files are stored in TINKER internal units and must be multiplied # by PDBVELFACTOR=20.45482706 to convert to A/ps. (These files are used for output trajectory) SloppyBackend.addArrayValues('atom_velocities', np.transpose(np.asarray( self.metaStorage.convertUnits( @@ -846,7 +845,7 @@ class TINKERParser(SmartParser.ParserBase): if np.linalg.norm(unit_vectors[2])>0.0: unit_periodicity[2]=True SloppyBackend.addArrayValues('configuration_periodic_dimensions', unit_periodicity) - + if self.topology is not None: self.topology_system_name(backend, gIndex) @@ -911,7 +910,7 @@ class TINKERParser(SmartParser.ParserBase): # } #self.secVDWGIndex = backend.superBackend.openSection("section_energy_van_der_Waals") #self.metaStorage.update(updateDictVDW) - #self.metaStorage.updateBackend(backend.superBackend, + #self.metaStorage.updateBackend(backend.superBackend, # startsection=['section_energy_van_der_Waals'], # autoopenclose=False) #backend.superBackend.closeSection("section_energy_van_der_Waals", self.secVDWGIndex) @@ -923,7 +922,7 @@ class TINKERParser(SmartParser.ParserBase): 'dictionary' : section_singlecalc_Dict } self.metaStorage.update(updateDict) - self.metaStorage.updateBackend(backend.superBackend, + self.metaStorage.updateBackend(backend.superBackend, startsection=['section_single_configuration_calculation'], autoopenclose=False) if self.MDcurrentstep in forcesteps: @@ -935,7 +934,7 @@ class TINKERParser(SmartParser.ParserBase): self.metaStorage.convertUnits( self.atompositions.velocities, "kilo-joule/(mol*nano-meter)", self.unitDict)))) # need to transpose array since its shape is [number_of_atoms,3] in the metadata - if(self.MDcurrentstep in trajsteps or + if(self.MDcurrentstep in trajsteps or self.MDcurrentstep in velsteps): trajfile = None if 'filetrajs' in self.fileUnitDict[self.secRunGIndex]: @@ -943,7 +942,7 @@ class TINKERParser(SmartParser.ParserBase): if self.MDcurrentstep in filetrajs: trajfile = filetrajs[self.MDcurrentstep] if trajfile is not None: - rtn = setMetaStrInDict(self, 'filecntrlDict', 'archive file', trajfile) + rtn = setMetaStrInDict(self, 'filecntrlDict', 'archive file', trajfile) self.tinker_input_output_files(backend, gIndex, section, "traj") self.onOpen_section_system(backend, None, None) @@ -951,26 +950,26 @@ class TINKERParser(SmartParser.ParserBase): backend.addValue('single_configuration_calculation_to_system_ref', self.secSystemGIndex) self.MDiter += 1 else: - if(self.MDcurrentstep in logsteps or + if(self.MDcurrentstep in logsteps or self.MDcurrentstep in forcesteps): self.MDiter += 1 - if(self.inputcoords is not None and + if(self.inputcoords is not None and self.MDcurrentstep == steps[0] and self.inputpositions is not None): self.onOpen_section_system(backend, None, None) self.onClose_section_system(backend, None, None) backend.addValue('single_configuration_calculation_to_system_ref', self.secSystemGIndex) self.MDiter += 1 - if(self.outputcoords is not None and + if(self.outputcoords is not None and self.MDcurrentstep == steps[-1] and self.outputpositions is not None): self.onOpen_section_system(backend, None, None) self.onClose_section_system(backend, None, None) backend.addValue('single_configuration_calculation_to_system_ref', self.secSystemGIndex) self.MDiter += 1 - #if((self.MDcurrentstep in logsteps and - # self.MDiter+1 in steps) or - # (self.MDcurrentstep in forcesteps and + #if((self.MDcurrentstep in logsteps and + # self.MDiter+1 in steps) or + # (self.MDcurrentstep in forcesteps and # self.MDiter+1 in steps)): # self.MDiter += 1 #if self.MDiter<len(steps): @@ -995,7 +994,7 @@ class TINKERParser(SmartParser.ParserBase): def fileNameTrans(self, fname, value): return value - + def mdInfoTrans(self, fname, value): mdInfoDict = { "minimization" : [], @@ -1052,7 +1051,7 @@ class TINKERParser(SmartParser.ParserBase): else: return value return value - + def trueToZero(self, fname, value): keyMapper = { "Molecular Dynamics" : "MDmainstep", @@ -1167,7 +1166,7 @@ class TINKERParser(SmartParser.ParserBase): if self.matchStrInTextFile(parser,fName,reStr): includedList.append(fName) else: - includedList = fileList + includedList = fileList # If and exclude list is given, # remove the files from list that # includes these Regular expression matches @@ -1177,7 +1176,7 @@ class TINKERParser(SmartParser.ParserBase): if not self.matchStrInTextFile(parser,fName,reStr): excludedList.append(fName) else: - excludedList = includedList + excludedList = includedList return excludedList def storeTextFile(self, parser, textDict, storeName, textFile): @@ -1209,7 +1208,7 @@ class TINKERParser(SmartParser.ParserBase): except ValueError: prm = None return prm - + def readTinkerParameterFile(self, parser, fileName, cntrlDict): success = False emptyLine = re.compile(r"^\s*$") @@ -1465,7 +1464,7 @@ class TINKERParser(SmartParser.ParserBase): for filename in fnmatch.filter(filenames, findfile): matches.append(os.path.join(root, filename)) break - + inputFile = None if matches: inputFile = matches[0] @@ -1480,8 +1479,8 @@ class TINKERParser(SmartParser.ParserBase): working_dir_name = os.path.dirname(os.path.abspath(self.fName)) addfile = os.path.normpath(working_dir_name+os.path.sep+arcname) for fname in self.tinkerFiles: - if('.arc' not in fname and - '.xyz' not in fname and + if('.arc' not in fname and + '.xyz' not in fname and fname in fileListInDir): xyzSeqList.append(working_dir_name+os.path.sep+fname) anyFileExist=False @@ -1628,7 +1627,7 @@ class TINKERParser(SmartParser.ParserBase): # First find tinker run name from output files such as Coordinate File outputs # If there is no output file than # find all .key files in working dir - # and try match the base names of these files with the output log file that + # and try match the base names of these files with the output log file that # parser is working on. # If none of the above strategies work, use default key file name tinker.key # Finally, try readinf input key file if there is one @@ -1669,7 +1668,7 @@ class TINKERParser(SmartParser.ParserBase): self.tinkerTrajSteps = [] if fileFound is True: - rtn = setMetaStrInDict(self, 'filecntrlDict', 'coordinate file list', ','.join(self.tinkerFiles)) + rtn = setMetaStrInDict(self, 'filecntrlDict', 'coordinate file list', ','.join(self.tinkerFiles)) self.tinkerRunFiles.update({'coordinate file list' : ','.join(self.tinkerFiles)}) if self.secRunGIndex<1: xyzfile = self.tinkerBaseName + '.xyz' @@ -1680,7 +1679,7 @@ class TINKERParser(SmartParser.ParserBase): corfile = self.tinkerBaseName + '.001' arcfile = self.tinkerBaseName + '.arc' if xyzfile in filesListInDir: - rtn = setMetaStrInDict(self, 'filecntrlDict', 'topology file', xyzfile) + rtn = setMetaStrInDict(self, 'filecntrlDict', 'topology file', xyzfile) self.tinkerRunFiles.update({'topology file' : xyzfile}) self.tinkerTrajSteps.append(1) if self.tinkerFirstStep not in self.tinkerTrajSteps: @@ -1690,32 +1689,32 @@ class TINKERParser(SmartParser.ParserBase): if trajst not in self.tinkerTrajSteps: self.tinkerTrajSteps.append(trajst) if outxyzfile in filesListInDir: - rtn = setMetaStrInDict(self, 'filecntrlDict', 'final configuration file', outxyzfile) + rtn = setMetaStrInDict(self, 'filecntrlDict', 'final configuration file', outxyzfile) self.tinkerRunFiles.update({'final configuration file' : outxyzfile}) if self.MDsteps not in self.tinkerTrajSteps: self.tinkerTrajSteps.append(self.MDsteps) if xyzfile in filesListInDir: - rtn = setMetaStrInDict(self, 'filecntrlDict', 'initial configuration file', xyzfile) + rtn = setMetaStrInDict(self, 'filecntrlDict', 'initial configuration file', xyzfile) self.tinkerRunFiles.update({'initial configuration file' : xyzfile}) if self.tinkerRunMD is True: if dynfile in filesListInDir: - rtn = setMetaStrInDict(self, 'filecntrlDict', 'restart file', dynfile) + rtn = setMetaStrInDict(self, 'filecntrlDict', 'restart file', dynfile) self.tinkerRunFiles.update({'restart file' : dynfile}) if self.MDsteps not in self.tinkerTrajSteps: self.tinkerTrajSteps.append(self.MDsteps) if corfile in filesListInDir: - rtn = setMetaStrInDict(self, 'filecntrlDict', 'initial trajectory file', corfile) + rtn = setMetaStrInDict(self, 'filecntrlDict', 'initial trajectory file', corfile) self.tinkerRunFiles.update({'initial trajectory file' : corfile}) if arcfile in filesListInDir and arcfile in self.tinkerFiles: - rtn = setMetaStrInDict(self, 'filecntrlDict', 'archive file', arcfile) + rtn = setMetaStrInDict(self, 'filecntrlDict', 'archive file', arcfile) self.tinkerRunFiles.update({'archive file' : arcfile}) self.tinkerXYZSeqList = {} if arcfile not in self.tinkerFiles: trajinstance = 0 for fname in self.tinkerFiles: - if('.arc' not in fname and - '.xyz' not in fname and + if('.arc' not in fname and + '.xyz' not in fname and fname in filesListInDir): self.tinkerXYZSeqList.update({ self.tinkerFileSteps[ @@ -1723,12 +1722,12 @@ class TINKERParser(SmartParser.ParserBase): }) trajinstance += 1 # self.generateARCfileFromSequenceFiles(parser, filesListInDir, arcfile) - # rtn = setMetaStrInDict(self, 'filecntrlDict', 'archive file', arcfile) + # rtn = setMetaStrInDict(self, 'filecntrlDict', 'archive file', arcfile) # self.tinkerRunFiles.update({'archive file' : arcfile}) - + if self.tinkerKeyFile is not None: - rtn = setMetaStrInDict(self, 'filecntrlDict', 'key file', self.tinkerKeyFile) + rtn = setMetaStrInDict(self, 'filecntrlDict', 'key file', self.tinkerKeyFile) self.findInputCmdFileAndRead(parser) return success @@ -1780,7 +1779,7 @@ class TINKERParser(SmartParser.ParserBase): for filename in fnmatch.filter(filenames, findfile): matches.append(os.path.join(root, filename)) break - + inputFile = None if matches: inputFile = matches[0] @@ -1795,8 +1794,8 @@ class TINKERParser(SmartParser.ParserBase): working_dir_name = os.path.dirname(os.path.abspath(self.fName)) addfile = os.path.normpath(working_dir_name+os.path.sep+arcname) for fname in self.tinkerFiles: - if('.arc' not in fname and - '.xyz' not in fname and + if('.arc' not in fname and + '.xyz' not in fname and fname in fileListInDir): xyzSeqList.append(working_dir_name+os.path.sep+fname) anyFileExist=False @@ -1943,7 +1942,7 @@ class TINKERParser(SmartParser.ParserBase): # First find tinker run name from output files such as Coordinate File outputs # If there is no output file than # find all .key files in working dir - # and try match the base names of these files with the output log file that + # and try match the base names of these files with the output log file that # parser is working on. # If none of the above strategies work, use default key file name tinker.key # Finally, try readinf input key file if there is one @@ -1984,7 +1983,7 @@ class TINKERParser(SmartParser.ParserBase): self.tinkerTrajSteps = [] if fileFound is True: - rtn = setMetaStrInDict(self, 'filecntrlDict', 'coordinate file list', ','.join(self.tinkerFiles)) + rtn = setMetaStrInDict(self, 'filecntrlDict', 'coordinate file list', ','.join(self.tinkerFiles)) self.tinkerRunFiles.update({'coordinate file list' : ','.join(self.tinkerFiles)}) if self.secRunGIndex<1: xyzfile = self.tinkerBaseName + '.xyz' @@ -1995,7 +1994,7 @@ class TINKERParser(SmartParser.ParserBase): corfile = self.tinkerBaseName + '.001' arcfile = self.tinkerBaseName + '.arc' if xyzfile in filesListInDir: - rtn = setMetaStrInDict(self, 'filecntrlDict', 'topology file', xyzfile) + rtn = setMetaStrInDict(self, 'filecntrlDict', 'topology file', xyzfile) self.tinkerRunFiles.update({'topology file' : xyzfile}) self.tinkerTrajSteps.append(1) if self.tinkerFirstStep not in self.tinkerTrajSteps: @@ -2005,32 +2004,32 @@ class TINKERParser(SmartParser.ParserBase): if trajst not in self.tinkerTrajSteps: self.tinkerTrajSteps.append(trajst) if outxyzfile in filesListInDir: - rtn = setMetaStrInDict(self, 'filecntrlDict', 'final configuration file', outxyzfile) + rtn = setMetaStrInDict(self, 'filecntrlDict', 'final configuration file', outxyzfile) self.tinkerRunFiles.update({'final configuration file' : outxyzfile}) if self.MDsteps not in self.tinkerTrajSteps: self.tinkerTrajSteps.append(self.MDsteps) if xyzfile in filesListInDir: - rtn = setMetaStrInDict(self, 'filecntrlDict', 'initial configuration file', xyzfile) + rtn = setMetaStrInDict(self, 'filecntrlDict', 'initial configuration file', xyzfile) self.tinkerRunFiles.update({'initial configuration file' : xyzfile}) if self.tinkerRunMD is True: if dynfile in filesListInDir: - rtn = setMetaStrInDict(self, 'filecntrlDict', 'restart file', dynfile) + rtn = setMetaStrInDict(self, 'filecntrlDict', 'restart file', dynfile) self.tinkerRunFiles.update({'restart file' : dynfile}) if self.MDsteps not in self.tinkerTrajSteps: self.tinkerTrajSteps.append(self.MDsteps) if corfile in filesListInDir: - rtn = setMetaStrInDict(self, 'filecntrlDict', 'initial trajectory file', corfile) + rtn = setMetaStrInDict(self, 'filecntrlDict', 'initial trajectory file', corfile) self.tinkerRunFiles.update({'initial trajectory file' : corfile}) if arcfile in filesListInDir and arcfile in self.tinkerFiles: - rtn = setMetaStrInDict(self, 'filecntrlDict', 'archive file', arcfile) + rtn = setMetaStrInDict(self, 'filecntrlDict', 'archive file', arcfile) self.tinkerRunFiles.update({'archive file' : arcfile}) self.tinkerXYZSeqList = {} if arcfile not in self.tinkerFiles: trajinstance = 0 for fname in self.tinkerFiles: - if('.arc' not in fname and - '.xyz' not in fname and + if('.arc' not in fname and + '.xyz' not in fname and fname in filesListInDir): self.tinkerXYZSeqList.update({ self.tinkerFileSteps[ @@ -2038,12 +2037,12 @@ class TINKERParser(SmartParser.ParserBase): }) trajinstance += 1 # self.generateARCfileFromSequenceFiles(parser, filesListInDir, arcfile) - # rtn = setMetaStrInDict(self, 'filecntrlDict', 'archive file', arcfile) + # rtn = setMetaStrInDict(self, 'filecntrlDict', 'archive file', arcfile) # self.tinkerRunFiles.update({'archive file' : arcfile}) - + if self.tinkerKeyFile is not None: - rtn = setMetaStrInDict(self, 'filecntrlDict', 'key file', self.tinkerKeyFile) + rtn = setMetaStrInDict(self, 'filecntrlDict', 'key file', self.tinkerKeyFile) #self.findInputCmdFileAndRead(parser) self.tinkerRunFiles.update({'filesteps' : self.tinkerTrajSteps}) @@ -2073,7 +2072,7 @@ class TINKERParser(SmartParser.ParserBase): 'E Kinetic':3, 'Temp':4, 'Pres':5, - } + } #self.minStepHeaderDict={ # 'MIN Iter' : 0, @@ -2084,7 +2083,7 @@ class TINKERParser(SmartParser.ParserBase): # 'Angle' : 5, # 'FG Call' : 6, # 'Comment' : 7 - # } + # } cntrlNameList=getList_MetaStrInDict(self.metaDicts['cntrl']) filecntrlNameList=getList_MetaStrInDict(self.metaDicts['filecntrl']) @@ -2099,7 +2098,7 @@ class TINKERParser(SmartParser.ParserBase): "waitlist" : None, "stopOnMatchStr" : r"\s*(?:QN|TN|CG|VM)\s+Iter\s*", "quitOnMatchStr" : r"\s*(?:QN|TN|CG|VM)\s+Iter\s*", - "metaNameStart" : PARSERTAG + "_inout_control", + "metaNameStart" : PARSERTAG + "_inout_control", "matchNameList" : cntrlNameList, "matchNameDict" : "mdcntrlDict", "updateMatchDict" : True, @@ -2107,8 +2106,8 @@ class TINKERParser(SmartParser.ParserBase): "stopOnFirstLine" : False, "parserOptions" : { "lineFilter" : None, - "controlsections" : ["x_tinker_section_control_parameters"], - "controlsave" : "sectioncontrol", + "controlsections" : ["x_tinker_section_control_parameters"], + "controlsave" : "sectioncontrol", "controldict" : "stepcontrolDict", } }, @@ -2119,7 +2118,7 @@ class TINKERParser(SmartParser.ParserBase): "waitlist" : None, "stopOnMatchStr" : r"^\s*$", "quitOnMatchStr" : r"^\s*$", - "metaNameStart" : PARSERTAG + "_inout_control", + "metaNameStart" : PARSERTAG + "_inout_control", "matchNameList" : cntrlNameList, "matchNameDict" : "mdcntrlDict", "updateMatchDict" : True, @@ -2127,8 +2126,8 @@ class TINKERParser(SmartParser.ParserBase): "stopOnFirstLine" : True, "parserOptions" : { "lineFilter" : None, - #"controlsections" : ["x_tinker_section_control_parameters"], - #"controlsave" : "sectioncontrol", + #"controlsections" : ["x_tinker_section_control_parameters"], + #"controlsave" : "sectioncontrol", #"controldict" : "stepcontrolDict", } }, @@ -2139,7 +2138,7 @@ class TINKERParser(SmartParser.ParserBase): "waitlist" : None, "stopOnMatchStr" : r"^\s*$", "quitOnMatchStr" : r"^\s*$", - "metaNameStart" : PARSERTAG + "_inout_control", + "metaNameStart" : PARSERTAG + "_inout_control", "matchNameList" : cntrlNameList, "matchNameDict" : "mdcntrlDict", "updateMatchDict" : True, @@ -2147,8 +2146,8 @@ class TINKERParser(SmartParser.ParserBase): "stopOnFirstLine" : False, "parserOptions" : { "lineFilter" : None, - #"controlsections" : ["x_tinker_section_control_parameters"], - #"controlsave" : "sectioncontrol", + #"controlsections" : ["x_tinker_section_control_parameters"], + #"controlsave" : "sectioncontrol", #"controldict" : "stepcontrolDict", } }, @@ -2165,16 +2164,16 @@ class TINKERParser(SmartParser.ParserBase): "updateMatchDict" : False, "onlyCaseSensitive" : False, "stopOnFirstLine" : False, - "parserOptions" : { - "sectionname" : "x_tinker_section_control_parameters", - "sectionopen" : True, - "sectionopenattr" : "MDcurrentstep", - "sectionopenin" : "cntrlparmstep", - "sectionclose" : True, - "sectioncloseattr" : "MDcurrentstep", - "sectionclosein" : "cntrlparmstep", - "activatesection" : "sectioncontrol", - "lookupdict" : "stepcontrolDict" + "parserOptions" : { + "sectionname" : "x_tinker_section_control_parameters", + "sectionopen" : True, + "sectionopenattr" : "MDcurrentstep", + "sectionopenin" : "cntrlparmstep", + "sectionclose" : True, + "sectioncloseattr" : "MDcurrentstep", + "sectionclosein" : "cntrlparmstep", + "activatesection" : "sectioncontrol", + "lookupdict" : "stepcontrolDict" } }, # Optimization Step header reader @@ -2185,18 +2184,18 @@ class TINKERParser(SmartParser.ParserBase): #"waitlist" : [["min_init_parser"]], "stopOnMatchStr" : r"^\s*$", "quitOnMatchStr" : r"^\s*$", - "metaNameStart" : PARSERTAG + "_mdout_", + "metaNameStart" : PARSERTAG + "_mdout_", "matchNameList" : mddataNameList, "matchNameDict" : "mddataDict", "updateMatchDict" : True, "onlyCaseSensitive" : False, "stopOnFirstLine" : False, - "parserOptions" : { - "header" : True, - "headersave" : "minStepHeaderDict", - "wrap" : False, - "tablelines" : 0, - "tablestartsat" : r"\s*(?:QN|TN|CG|VM)\s*Iter", + "parserOptions" : { + "header" : True, + "headersave" : "minStepHeaderDict", + "wrap" : False, + "tablelines" : 0, + "tablestartsat" : r"\s*(?:QN|TN|CG|VM)\s*Iter", "tableendsat" : r"^\s*$", "lineFilter" : { 'QN Iter' : 'ITER1', @@ -2206,14 +2205,14 @@ class TINKERParser(SmartParser.ParserBase): 'F Value' : 'FVALUE', 'G RMS' : 'GRMS1', 'RMS G' : 'GRMS2', - 'F Move' : 'FMove', - 'X Move' : 'XMove', + 'F Move' : 'FMove', + 'X Move' : 'XMove', 'FG Call' : 'FGCall' }, "movetostopline" : True, #"parsercntrlattr" : "MDcurrentstep", #"parsercntrlin" : "steps", - #"lookupdict" : "stepcontrolDict" + #"lookupdict" : "stepcontrolDict" } }, # Optim output cycles reader @@ -2230,28 +2229,28 @@ class TINKERParser(SmartParser.ParserBase): #"quitOnMatchStr" : r"\s*(?:MD\s*Step|" # "Average\s*Values|" # "Instantaneous\s*Values)\s*", - "metaNameStart" : PARSERTAG + "_mdout_", + "metaNameStart" : PARSERTAG + "_mdout_", "matchNameList" : mddataNameList, "matchNameDict" : "mddataDict", "updateMatchDict" : True, "onlyCaseSensitive" : False, "stopOnFirstLine" : True, - "parserOptions" : { - "header" : False, - "headerList" : "minStepHeaderDict", - "wrap" : False, - "tablelines" : 0, - "maxtablelines" : 1, - "tablestartsat" : r"\s*[0-9]+\s*", + "parserOptions" : { + "header" : False, + "headerList" : "minStepHeaderDict", + "wrap" : False, + "tablelines" : 0, + "maxtablelines" : 1, + "tablestartsat" : r"\s*[0-9]+\s*", "tableendsat" : r"^\s*$", "lineFilter" : None, "movetostopline" : True, - "controlsections" : ["section_single_configuration_calculation"], - "controlsave" : "sectioncontrol", + "controlsections" : ["section_single_configuration_calculation"], + "controlsave" : "sectioncontrol", "controldict" : "stepcontrolDict", #"parsercntrlattr" : "MDcurrentstep", #"parsercntrlin" : "logsteps", - #"lookupdict" : "stepcontrolDict" + #"lookupdict" : "stepcontrolDict" } }, # energy save Parser @@ -2262,22 +2261,22 @@ class TINKERParser(SmartParser.ParserBase): #"waitlist" : [["md_step_parser"]], "stopOnMatchStr" : "AlwaysStop", "quitOnMatchStr" : "AlwaysStop", - "metaNameStart" : PARSERTAG + "_mdout_", + "metaNameStart" : PARSERTAG + "_mdout_", "matchNameList" : mddataNameList, "matchNameDict" : "mddataDict", "updateMatchDict" : False, "onlyCaseSensitive" : False, "stopOnFirstLine" : False, - "parserOptions" : { - "dictionary" : "mddataDict", + "parserOptions" : { + "dictionary" : "mddataDict", "dicttype" : "smartparser", # (standard or smartparser) - "readwritedict" : "write", + "readwritedict" : "write", "keyMapper" : {"F Value" : "E Potential"}, #"preprocess" : self.convertFloat, #"postprocess" : self.convertFloat, #"parsercntrlattr" : "MDcurrentstep", #"parsercntrlin" : "steps", - #"lookupdict" : "stepcontrolDict" + #"lookupdict" : "stepcontrolDict" } }, # thermostat save Parser @@ -2288,16 +2287,16 @@ class TINKERParser(SmartParser.ParserBase): #"waitlist" : [["md_step_parser"]], "stopOnMatchStr" : "AlwaysStop", "quitOnMatchStr" : "AlwaysStop", - "metaNameStart" : PARSERTAG + "_mdout_", + "metaNameStart" : PARSERTAG + "_mdout_", "matchNameList" : mddataNameList, "matchNameDict" : "mddataDict", "updateMatchDict" : False, "onlyCaseSensitive" : False, "stopOnFirstLine" : False, - "parserOptions" : { - "dictionary" : "stepcontrolDict", + "parserOptions" : { + "dictionary" : "stepcontrolDict", "dicttype" : "standard", # (standard or smartparser) - "readwritedict" : "write", + "readwritedict" : "write", "keyMapper" : {"MD Step" : "MDcurrentstep", "Dynamics Steps" : "MDcurrentstep", #"InputCoordStep" : "MDcurrentstep", @@ -2308,15 +2307,15 @@ class TINKERParser(SmartParser.ParserBase): "CG Iter" : "MDcurrentstep"}, "updatefunc" : "max", "updateattrs" : ["MDcurrentstep"], - "controlsections" : ["section_single_configuration_calculation"], - "controlsave" : "sectioncontrol", + "controlsections" : ["section_single_configuration_calculation"], + "controlsave" : "sectioncontrol", "controldict" : "stepcontrolDict", "controlattrs" : ["MDcurrentstep"], "preprocess" : self.convertInt, "postprocess" : self.convertInt, #"parsercntrlattr" : "MDcurrentstep", #"parsercntrlin" : "steps", - #"lookupdict" : "stepcontrolDict" + #"lookupdict" : "stepcontrolDict" } }, # Section Control Parser @@ -2333,16 +2332,16 @@ class TINKERParser(SmartParser.ParserBase): "updateMatchDict" : False, "onlyCaseSensitive" : True, "stopOnFirstLine" : False, - "parserOptions" : { - "sectionname" : "section_single_configuration_calculation", - "sectionopen" : True, - "sectionopenattr" : "MDcurrentstep", - "sectionopenin" : "steps", - "sectionclose" : True, - "sectioncloseattr" : "MDcurrentstep", - "sectionclosein" : "steps", - "activatesection" : "sectioncontrol", - "lookupdict" : "stepcontrolDict" + "parserOptions" : { + "sectionname" : "section_single_configuration_calculation", + "sectionopen" : True, + "sectionopenattr" : "MDcurrentstep", + "sectionopenin" : "steps", + "sectionclose" : True, + "sectioncloseattr" : "MDcurrentstep", + "sectionclosein" : "steps", + "activatesection" : "sectioncontrol", + "lookupdict" : "stepcontrolDict" } }, # Readline Control Parser @@ -2360,18 +2359,18 @@ class TINKERParser(SmartParser.ParserBase): "updateMatchDict" : False, "onlyCaseSensitive" : True, "stopOnFirstLine" : False, - "parserOptions" : { - "peeklineFirst" : False, + "parserOptions" : { + "peeklineFirst" : False, "waitatlineStr" : r"^\s*", - "controlwait" : None, - "controlattr" : "MDcurrentstep", - #"controlnextattr" : "MDnextstep", - #"controllast" : -1, - #"controlskip" : [0], - "controlin" : "steps", - "controlcounter" : "targetstep", + "controlwait" : None, + "controlattr" : "MDcurrentstep", + #"controlnextattr" : "MDnextstep", + #"controllast" : -1, + #"controlskip" : [0], + "controlin" : "steps", + "controlcounter" : "targetstep", "controldict" : "stepcontrolDict", - "lookupdict" : "stepcontrolDict" + "lookupdict" : "stepcontrolDict" } }, ] @@ -2388,7 +2387,7 @@ class TINKERParser(SmartParser.ParserBase): "quitOnMatchStr" : r"\s*(?:MD\s+Step|" "Average\s+Values|" "Instantaneous\s+Values)\s*", - "metaNameStart" : PARSERTAG + "_inout_control", + "metaNameStart" : PARSERTAG + "_inout_control", "matchNameList" : cntrlNameList, "matchNameDict" : "mdcntrlDict", "updateMatchDict" : False, @@ -2397,8 +2396,8 @@ class TINKERParser(SmartParser.ParserBase): "parserOptions" : { #"lineFilter" : None, #"movetostopline" : True, - "controlsections" : ["x_tinker_section_control_parameters"], - "controlsave" : "sectioncontrol", + "controlsections" : ["x_tinker_section_control_parameters"], + "controlsave" : "sectioncontrol", "controldict" : "stepcontrolDict", } }, @@ -2415,16 +2414,16 @@ class TINKERParser(SmartParser.ParserBase): "updateMatchDict" : False, "onlyCaseSensitive" : False, "stopOnFirstLine" : False, - "parserOptions" : { - "sectionname" : "x_tinker_section_control_parameters", - "sectionopen" : True, - "sectionopenattr" : "MDcurrentstep", - "sectionopenin" : "cntrlparmstep", - "sectionclose" : True, - "sectioncloseattr" : "MDcurrentstep", - "sectionclosein" : "cntrlparmstep", - "activatesection" : "sectioncontrol", - "lookupdict" : "stepcontrolDict" + "parserOptions" : { + "sectionname" : "x_tinker_section_control_parameters", + "sectionopen" : True, + "sectionopenattr" : "MDcurrentstep", + "sectionopenin" : "cntrlparmstep", + "sectionclose" : True, + "sectioncloseattr" : "MDcurrentstep", + "sectionclosein" : "cntrlparmstep", + "activatesection" : "sectioncontrol", + "lookupdict" : "stepcontrolDict" } }, # MD output average values reader @@ -2434,7 +2433,7 @@ class TINKERParser(SmartParser.ParserBase): "waitlist" : None, "stopOnMatchStr" : r"^\s*Density\s*", "quitOnMatchStr" : r"^\s*Density\s*", - "metaNameStart" : PARSERTAG + "_mdout_", + "metaNameStart" : PARSERTAG + "_mdout_", "matchNameList" : mddataNameList, "matchNameDict" : "mddataDict", "updateMatchDict" : True, @@ -2443,8 +2442,8 @@ class TINKERParser(SmartParser.ParserBase): "parserOptions" : { #"lineFilter" : None, "movetostopline" : True, - #"controlsections" : ["section_single_configuration_calculation"], - #"controlsave" : "sectioncontrol", + #"controlsections" : ["section_single_configuration_calculation"], + #"controlsave" : "sectioncontrol", #"controldict" : "stepcontrolDict", } }, @@ -2455,7 +2454,7 @@ class TINKERParser(SmartParser.ParserBase): "waitlist" : None, "stopOnMatchStr" : r"^\s*Coordinate\s*File\s*", "quitOnMatchStr" : r"^\s*Coordinate\s*File\s*", - "metaNameStart" : PARSERTAG + "_mdout_", + "metaNameStart" : PARSERTAG + "_mdout_", "matchNameList" : mddataNameList, "matchNameDict" : "mddataDict", "updateMatchDict" : True, @@ -2463,8 +2462,8 @@ class TINKERParser(SmartParser.ParserBase): "stopOnFirstLine" : False, "parserOptions" : { "movetostopline" : True, - #"controlsections" : ["section_single_configuration_calculation"], - #"controlsave" : "sectioncontrol", + #"controlsections" : ["section_single_configuration_calculation"], + #"controlsave" : "sectioncontrol", #"controldict" : "stepcontrolDict", } }, @@ -2475,7 +2474,7 @@ class TINKERParser(SmartParser.ParserBase): "waitlist" : None, "stopOnMatchStr" : r"^\s*$", "quitOnMatchStr" : r"^\s*$", - "metaNameStart" : PARSERTAG + "_mdout_", + "metaNameStart" : PARSERTAG + "_mdout_", "matchNameList" : mddataNameList, "matchNameDict" : "mddataDict", "updateMatchDict" : True, @@ -2483,8 +2482,8 @@ class TINKERParser(SmartParser.ParserBase): "stopOnFirstLine" : False, "parserOptions" : { "movetostopline" : True, - #"controlsections" : ["section_single_configuration_calculation"], - #"controlsave" : "sectioncontrol", + #"controlsections" : ["section_single_configuration_calculation"], + #"controlsave" : "sectioncontrol", #"controldict" : "stepcontrolDict", } }, @@ -2497,16 +2496,16 @@ class TINKERParser(SmartParser.ParserBase): ["md_insta_parser"]], "stopOnMatchStr" : "AlwaysStop", "quitOnMatchStr" : "AlwaysStop", - "metaNameStart" : PARSERTAG + "_mdout_", + "metaNameStart" : PARSERTAG + "_mdout_", "matchNameList" : mddataNameList, "matchNameDict" : "mddataDict", "updateMatchDict" : False, "onlyCaseSensitive" : False, "stopOnFirstLine" : False, - "parserOptions" : { - "dictionary" : "mddataDict", + "parserOptions" : { + "dictionary" : "mddataDict", "dicttype" : "smartparser", # (standard or smartparser) - "readwritedict" : "write", + "readwritedict" : "write", "keyMapper" : {"Total Energy" : "E Total", "Potential Energy" : "E Potential", "Kinetic Energy" : "E Kinetic", @@ -2516,7 +2515,7 @@ class TINKERParser(SmartParser.ParserBase): #"postprocess" : self.convertFloat, #"parsercntrlattr" : "MDcurrentstep", #"parsercntrlin" : "steps", - #"lookupdict" : "stepcontrolDict" + #"lookupdict" : "stepcontrolDict" } }, # MD STEP header reader @@ -2526,31 +2525,31 @@ class TINKERParser(SmartParser.ParserBase): "waitlist" : None, "stopOnMatchStr" : r"^\s*$", "quitOnMatchStr" : r"^\s*$", - "metaNameStart" : PARSERTAG + "_mdout_", + "metaNameStart" : PARSERTAG + "_mdout_", "matchNameList" : mddataNameList, "matchNameDict" : "mddataDict", "updateMatchDict" : True, "onlyCaseSensitive" : False, "stopOnFirstLine" : False, - "parserOptions" : { - "header" : True, - "headersave" : "mdStepHeaderDict", - "wrap" : False, - "tablelines" : 0, - "tablestartsat" : r"\s*MD\s*Step", + "parserOptions" : { + "header" : True, + "headersave" : "mdStepHeaderDict", + "wrap" : False, + "tablelines" : 0, + "tablestartsat" : r"\s*MD\s*Step", "tableendsat" : r"^\s*$", "lineFilter" : { 'MD Step': 'MD-Step', 'E Total': 'TOTAL', 'E Potential': 'POTENTIAL', - 'E Kinetic': 'KINETIC', - 'Temp': 'TEMP', + 'E Kinetic': 'KINETIC', + 'Temp': 'TEMP', 'Pres': 'PRESS' }, "movetostopline" : True, #"parsercntrlattr" : "MDcurrentstep", #"parsercntrlin" : "steps", - #"lookupdict" : "stepcontrolDict" + #"lookupdict" : "stepcontrolDict" } }, # MD output cycles reader @@ -2565,28 +2564,28 @@ class TINKERParser(SmartParser.ParserBase): "quitOnMatchStr" : r"\s*(?:MD\s*Step|" "Average\s*Values|" "Instantaneous\s*Values)\s*", - "metaNameStart" : PARSERTAG + "_mdout_", + "metaNameStart" : PARSERTAG + "_mdout_", "matchNameList" : mddataNameList, "matchNameDict" : "mddataDict", "updateMatchDict" : True, "onlyCaseSensitive" : False, "stopOnFirstLine" : True, - "parserOptions" : { - "header" : False, - "headerList" : "mdStepHeaderDict", - "wrap" : False, - "tablelines" : 0, - "maxtablelines" : 1, - "tablestartsat" : r"\s*[0-9]+\s*", + "parserOptions" : { + "header" : False, + "headerList" : "mdStepHeaderDict", + "wrap" : False, + "tablelines" : 0, + "maxtablelines" : 1, + "tablestartsat" : r"\s*[0-9]+\s*", "tableendsat" : r"^\s*$", "lineFilter" : None, "movetostopline" : True, - "controlsections" : ["section_single_configuration_calculation"], - "controlsave" : "sectioncontrol", + "controlsections" : ["section_single_configuration_calculation"], + "controlsave" : "sectioncontrol", "controldict" : "stepcontrolDict", #"parsercntrlattr" : "MDcurrentstep", #"parsercntrlin" : "logsteps", - #"lookupdict" : "stepcontrolDict" + #"lookupdict" : "stepcontrolDict" } }, # thermostat save Parser @@ -2597,16 +2596,16 @@ class TINKERParser(SmartParser.ParserBase): #"waitlist" : [["md_step_parser"]], "stopOnMatchStr" : "AlwaysStop", "quitOnMatchStr" : "AlwaysStop", - "metaNameStart" : PARSERTAG + "_mdout_", + "metaNameStart" : PARSERTAG + "_mdout_", "matchNameList" : mddataNameList, "matchNameDict" : "mddataDict", "updateMatchDict" : False, "onlyCaseSensitive" : False, "stopOnFirstLine" : False, - "parserOptions" : { - "dictionary" : "stepcontrolDict", + "parserOptions" : { + "dictionary" : "stepcontrolDict", "dicttype" : "standard", # (standard or smartparser) - "readwritedict" : "write", + "readwritedict" : "write", "keyMapper" : {"MD Step" : "MDcurrentstep", "Dynamics Steps" : "MDcurrentstep", #"InputCoordStep" : "MDcurrentstep", @@ -2617,15 +2616,15 @@ class TINKERParser(SmartParser.ParserBase): "CG Iter" : "MDcurrentstep"}, "updatefunc" : "max", "updateattrs" : ["MDcurrentstep"], - "controlsections" : ["section_single_configuration_calculation"], - "controlsave" : "sectioncontrol", + "controlsections" : ["section_single_configuration_calculation"], + "controlsave" : "sectioncontrol", "controldict" : "stepcontrolDict", "controlattrs" : ["MDcurrentstep"], "preprocess" : self.convertInt, "postprocess" : self.convertInt, #"parsercntrlattr" : "MDcurrentstep", #"parsercntrlin" : "steps", - #"lookupdict" : "stepcontrolDict" + #"lookupdict" : "stepcontrolDict" } }, # Section Control Parser @@ -2642,16 +2641,16 @@ class TINKERParser(SmartParser.ParserBase): "updateMatchDict" : False, "onlyCaseSensitive" : True, "stopOnFirstLine" : False, - "parserOptions" : { - "sectionname" : "section_single_configuration_calculation", - "sectionopen" : True, - "sectionopenattr" : "MDcurrentstep", - "sectionopenin" : "steps", - "sectionclose" : True, - "sectioncloseattr" : "MDcurrentstep", - "sectionclosein" : "steps", - "activatesection" : "sectioncontrol", - "lookupdict" : "stepcontrolDict" + "parserOptions" : { + "sectionname" : "section_single_configuration_calculation", + "sectionopen" : True, + "sectionopenattr" : "MDcurrentstep", + "sectionopenin" : "steps", + "sectionclose" : True, + "sectioncloseattr" : "MDcurrentstep", + "sectionclosein" : "steps", + "activatesection" : "sectioncontrol", + "lookupdict" : "stepcontrolDict" } }, # Readline Control Parser @@ -2669,18 +2668,18 @@ class TINKERParser(SmartParser.ParserBase): "updateMatchDict" : False, "onlyCaseSensitive" : True, "stopOnFirstLine" : False, - "parserOptions" : { - "peeklineFirst" : False, + "parserOptions" : { + "peeklineFirst" : False, "waitatlineStr" : r"^\s*", - "controlwait" : None, - "controlattr" : "MDcurrentstep", - #"controlnextattr" : "MDnextstep", - #"controllast" : -1, - #"controlskip" : [0], - "controlin" : "steps", - "controlcounter" : "targetstep", + "controlwait" : None, + "controlattr" : "MDcurrentstep", + #"controlnextattr" : "MDnextstep", + #"controllast" : -1, + #"controlskip" : [0], + "controlin" : "steps", + "controlcounter" : "targetstep", "controldict" : "stepcontrolDict", - "lookupdict" : "stepcontrolDict" + "lookupdict" : "stepcontrolDict" } }, ] @@ -2698,7 +2697,7 @@ class TINKERParser(SmartParser.ParserBase): #"quitOnMatchStr" : r"\s*(?:Molecular\s+Dynamics|Optimization)\s*", "stopOnMatchStr" : r"^\s*######+$", "quitOnMatchStr" : r"^\s*######+$", - "metaNameStart" : None, + "metaNameStart" : None, "matchNameList" : None, "matchNameDict" : None, "updateMatchDict" : False, @@ -2732,20 +2731,20 @@ class TINKERParser(SmartParser.ParserBase): "updateMatchDict" : False, "onlyCaseSensitive" : False, "stopOnFirstLine" : False, - "parserOptions" : { - "peeklineFirst" : True, + "parserOptions" : { + "peeklineFirst" : True, #"waitatlineStr" : "^\s*######+\s*$", "waitatlineStr" : None, - "controlwait" : None, - "controlattr" : "MDcurrentstep", - #"controlnextattr" : "MDnextstep", - #"controllast" : -1, - "controlskip" : [-1], - "controlin" : "opencntrlstep", - #"controlin" : "steps", - #"controlcounter" : "targetstep", + "controlwait" : None, + "controlattr" : "MDcurrentstep", + #"controlnextattr" : "MDnextstep", + #"controllast" : -1, + "controlskip" : [-1], + "controlin" : "opencntrlstep", + #"controlin" : "steps", + #"controlcounter" : "targetstep", #"controldict" : "stepcontrolDict", - #"lookupdict" : "stepcontrolDict" + #"lookupdict" : "stepcontrolDict" } }, ] @@ -2765,39 +2764,39 @@ class TINKERParser(SmartParser.ParserBase): SM(name='ProgramInfo', startReStr=r"^\s*#+\s*Version\s*" "(?P<"+PARSERTAG+"_mdin_finline>[a-zA-Z0-9:., ]+)\s*#+", - adHoc=lambda p: p.backend.addValue( - "program_version", + adHoc=lambda p: p.backend.addValue( + "program_version", ' '.join(p.lastMatch[ PARSERTAG+"_mdin_finline" ].replace('\n', ' ').strip().split()))), - SM(name='copyright', + SM(name='copyright', startReStr=r"^\s*#+\s*Copyright\s*\(c\)\s*", - coverageIgnore=True, - adHoc=lambda p: - self.adHoc_read_store_text_stop_parsing(p, + coverageIgnore=True, + adHoc=lambda p: + self.adHoc_read_store_text_stop_parsing(p, stopOnMatchStr=r"^\s*#+\s*#+\s*$", quitOnMatchStr=None, - metaNameStart=PARSERTAG+"_", - metaNameStore=PARSERTAG+"_program_copyright", + metaNameStart=PARSERTAG+"_", + metaNameStore=PARSERTAG+"_program_copyright", matchNameList=None, matchNameDict=None, onlyCaseSensitive=True, stopOnFirstLine=False, storeFirstLine=True, storeStopQuitLine=True, - onQuitRunFunction=lambda p: p.backend.addValue( - PARSERTAG+"_program_copyright", + onQuitRunFunction=lambda p: p.backend.addValue( + PARSERTAG+"_program_copyright", ' '.join(p.lastMatch[ PARSERTAG+"_program_copyright" ].replace('\n', ' ').replace('#', '').strip().split()) ) ) ), - SM(name='newRun', + SM(name='newRun', startReStr=r"^\s*$", #endReStr=r"^\s*$", #forwardMatch=True, - adHoc=lambda p: + adHoc=lambda p: self.adHoc_takingover_parsing(p, stopOnMatchStr=r"^\s*#####+\s*$", quitOnMatchStr=r"^\s*#####+\s*$", @@ -2814,6 +2813,24 @@ class TINKERParser(SmartParser.ParserBase): ] -if __name__ == "__main__": - parser = TINKERParser() - parser.parse() +class TINKERParserInterface(): + """ A proper class envolop for running this parser from within python. """ + def __init__(self, backend, **kwargs): + self.backend_factory = backend + + def parse(self, mainfile): + from unittest.mock import patch + logging.info('tinker parser started') + logging.getLogger('nomadcore').setLevel(logging.WARNING) + backend = self.backend_factory("tinker.nomadmetainfo.json") + parserInfo = {'name': 'tinker-parser', 'version': '1.0'} + context = TINKERParser() + with patch.object(sys, 'argv', ['<exe>', '--uri', 'nmd://uri', mainfile]): + mainFunction( + mainFileDescription=context.mainFileDescription(), + metaInfoEnv=None, + parserInfo=parserInfo, + cachingLevelForMetaName=context.cachingLevelForMetaName, + superContext=context, + superBackend=backend) + return backend diff --git a/tinkerparser/__init__.py b/tinkerparser/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f9b04ff01c66bde6f9dfac5e6beba995b0b7f871 --- /dev/null +++ b/tinkerparser/__init__.py @@ -0,0 +1 @@ +from .TINKERParser import TINKERParserInterface as TINKERParser \ No newline at end of file diff --git a/tinkerparser/metainfo/__init__.py b/tinkerparser/metainfo/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..34b5cf46b4281cc34f31bb65e70b6368640f25e7 --- /dev/null +++ b/tinkerparser/metainfo/__init__.py @@ -0,0 +1,13 @@ +import sys +from nomad.metainfo import Environment +from nomad.metainfo.legacy import LegacyMetainfoEnvironment +import tinkerparser.metainfo.tinker +import nomad.datamodel.metainfo.common +import nomad.datamodel.metainfo.public +import nomad.datamodel.metainfo.general + +m_env = LegacyMetainfoEnvironment() +m_env.m_add_sub_section(Environment.packages, sys.modules['tinkerparser.metainfo.tinker'].m_package) # type: ignore +m_env.m_add_sub_section(Environment.packages, sys.modules['nomad.datamodel.metainfo.common'].m_package) # type: ignore +m_env.m_add_sub_section(Environment.packages, sys.modules['nomad.datamodel.metainfo.public'].m_package) # type: ignore +m_env.m_add_sub_section(Environment.packages, sys.modules['nomad.datamodel.metainfo.general'].m_package) # type: ignore diff --git a/tinkerparser/metainfo/tinker.py b/tinkerparser/metainfo/tinker.py new file mode 100644 index 0000000000000000000000000000000000000000..60f932a6e7552ab7211bebacbbe4bbccac025597 --- /dev/null +++ b/tinkerparser/metainfo/tinker.py @@ -0,0 +1,1853 @@ +import numpy as np # pylint: disable=unused-import +import typing # pylint: disable=unused-import +from nomad.metainfo import ( # pylint: disable=unused-import + MSection, MCategory, Category, Package, Quantity, Section, SubSection, SectionProxy, + Reference +) +from nomad.metainfo.legacy import LegacyDefinition + +from nomad.datamodel.metainfo import public +from nomad.datamodel.metainfo import common + +m_package = Package( + name='tinker_nomadmetainfo_json', + description='None', + a_legacy=LegacyDefinition(name='tinker.nomadmetainfo.json')) + + +class x_tinker_mdin_input_output_files(MCategory): + ''' + Parameters of mdin belonging to x_tinker_section_control_parameters. + ''' + + m_def = Category( + a_legacy=LegacyDefinition(name='x_tinker_mdin_input_output_files')) + + +class x_tinker_mdin_control_parameters(MCategory): + ''' + Parameters of mdin belonging to x_tinker_section_control_parameters. + ''' + + m_def = Category( + a_legacy=LegacyDefinition(name='x_tinker_mdin_control_parameters')) + + +class x_tinker_mdin_method(MCategory): + ''' + Parameters of mdin belonging to section method. + ''' + + m_def = Category( + a_legacy=LegacyDefinition(name='x_tinker_mdin_method')) + + +class x_tinker_mdout_single_configuration_calculation(MCategory): + ''' + Parameters of mdout belonging to section_single_configuration_calculation. + ''' + + m_def = Category( + a_legacy=LegacyDefinition(name='x_tinker_mdout_single_configuration_calculation')) + + +class x_tinker_mdout_method(MCategory): + ''' + Parameters of mdin belonging to section method. + ''' + + m_def = Category( + a_legacy=LegacyDefinition(name='x_tinker_mdout_method')) + + +class x_tinker_mdout_run(MCategory): + ''' + Parameters of mdin belonging to settings run. + ''' + + m_def = Category( + categories=[public.settings_run], + a_legacy=LegacyDefinition(name='x_tinker_mdout_run')) + + +class x_tinker_mdin_run(MCategory): + ''' + Parameters of mdin belonging to settings run. + ''' + + m_def = Category( + categories=[public.settings_run], + a_legacy=LegacyDefinition(name='x_tinker_mdin_run')) + + +class x_tinker_section_input_output_files(MSection): + ''' + Section to store input and output file names + ''' + + m_def = Section(validate=False, a_legacy=LegacyDefinition(name='x_tinker_section_input_output_files')) + + +class x_tinker_section_control_parameters(MSection): + ''' + Section to store the input and output control parameters + ''' + + m_def = Section(validate=False, a_legacy=LegacyDefinition(name='x_tinker_section_control_parameters')) + + x_tinker_inout_file_structure = Quantity( + type=str, + shape=[], + description=''' + tinker input topology file. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_file_structure')) + + x_tinker_inout_file_trajectory = Quantity( + type=str, + shape=[], + description=''' + tinker output trajectory file. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_file_trajectory')) + + x_tinker_inout_file_traj_coord = Quantity( + type=str, + shape=[], + description=''' + tinker output trajectory file. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_file_traj_coord')) + + x_tinker_inout_file_traj_vel = Quantity( + type=str, + shape=[], + description=''' + tinker output file for velocities in the trajectory. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_file_traj_vel')) + + x_tinker_inout_file_traj_force = Quantity( + type=str, + shape=[], + description=''' + tinker output file for forces in the trajectory. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_file_traj_force')) + + x_tinker_inout_file_output_coord = Quantity( + type=str, + shape=[], + description=''' + tinker output coordinates file. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_file_output_coord')) + + x_tinker_inout_file_output_vel = Quantity( + type=str, + shape=[], + description=''' + tinker output velocities file. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_file_output_vel')) + + x_tinker_inout_file_output_force = Quantity( + type=str, + shape=[], + description=''' + tinker output forces file. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_file_output_force')) + + x_tinker_inout_file_input_coord = Quantity( + type=str, + shape=[], + description=''' + tinker input coordinates file. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_file_input_coord')) + + x_tinker_inout_file_input_vel = Quantity( + type=str, + shape=[], + description=''' + tinker input velocities file. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_file_input_vel')) + + x_tinker_inout_file_restart_coord = Quantity( + type=str, + shape=[], + description=''' + tinker restart coordinates file. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_file_restart_coord')) + + x_tinker_inout_file_restart_vel = Quantity( + type=str, + shape=[], + description=''' + tinker restart velocities file. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_file_restart_vel')) + + x_tinker_inout_file_output_log = Quantity( + type=str, + shape=[], + description=''' + tinker MD output log file. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_file_output_log')) + + x_tinker_inout_control_number_of_steps = Quantity( + type=str, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_number_of_steps')) + + x_tinker_inout_control_polar_eps = Quantity( + type=str, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_polar_eps')) + + x_tinker_inout_control_initial_temperature = Quantity( + type=str, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_initial_temperature')) + + x_tinker_inout_control_dielectric = Quantity( + type=str, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_dielectric')) + + x_tinker_inout_control_minimization = Quantity( + type=str, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_minimization')) + + x_tinker_inout_control_integrator = Quantity( + type=str, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_integrator')) + + x_tinker_inout_control_parameters = Quantity( + type=str, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_parameters')) + + x_tinker_inout_control_verbose = Quantity( + type=bool, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_verbose')) + + x_tinker_inout_control_a_axis = Quantity( + type=str, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_a_axis')) + + x_tinker_inout_control_b_axis = Quantity( + type=str, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_b_axis')) + + x_tinker_inout_control_c_axis = Quantity( + type=str, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_c_axis')) + + x_tinker_inout_control_alpha = Quantity( + type=str, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_alpha')) + + x_tinker_inout_control_beta = Quantity( + type=str, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_beta')) + + x_tinker_inout_control_gamma = Quantity( + type=str, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_gamma')) + + x_tinker_inout_control_tau_pressure = Quantity( + type=str, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_tau_pressure')) + + x_tinker_inout_control_tau_temperature = Quantity( + type=str, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_tau_temperature')) + + x_tinker_inout_control_debug = Quantity( + type=bool, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_debug')) + + x_tinker_inout_control_group = Quantity( + type=bool, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_group')) + + x_tinker_inout_control_group_inter = Quantity( + type=str, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_group_inter')) + + x_tinker_inout_control_vib_roots = Quantity( + type=str, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_vib_roots')) + + x_tinker_inout_control_spacegroup = Quantity( + type=str, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_spacegroup')) + + x_tinker_inout_control_digits = Quantity( + type=str, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_digits')) + + x_tinker_inout_control_printout = Quantity( + type=str, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_printout')) + + x_tinker_inout_control_enforce_chirality = Quantity( + type=bool, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_enforce_chirality')) + + x_tinker_inout_control_neighbor_list = Quantity( + type=bool, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_neighbor_list')) + + x_tinker_inout_control_vdw_cutoff = Quantity( + type=str, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_vdw_cutoff')) + + x_tinker_inout_control_vdw_correction = Quantity( + type=bool, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_vdw_correction')) + + x_tinker_inout_control_ewald = Quantity( + type=bool, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_ewald')) + + x_tinker_inout_control_ewald_cutoff = Quantity( + type=bool, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_ewald_cutoff')) + + x_tinker_inout_control_archive = Quantity( + type=bool, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_archive')) + + x_tinker_inout_control_barostat = Quantity( + type=str, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_barostat')) + + x_tinker_inout_control_aniso_pressure = Quantity( + type=bool, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_aniso_pressure')) + + x_tinker_inout_control_lights = Quantity( + type=bool, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_lights')) + + x_tinker_inout_control_randomseed = Quantity( + type=str, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_randomseed')) + + x_tinker_inout_control_saddlepoint = Quantity( + type=bool, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_saddlepoint')) + + x_tinker_inout_control_vdwtype = Quantity( + type=str, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_vdwtype')) + + x_tinker_inout_control_title = Quantity( + type=str, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_title')) + + x_tinker_inout_control_step_t = Quantity( + type=str, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_step_t')) + + x_tinker_inout_control_step_dt = Quantity( + type=str, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_step_dt')) + + x_tinker_inout_control_random_number_generator_seed = Quantity( + type=str, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_random_number_generator_seed')) + + x_tinker_inout_control_radiusrule = Quantity( + type=str, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_radiusrule')) + + x_tinker_inout_control_radiustype = Quantity( + type=str, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_radiustype')) + + x_tinker_inout_control_radiussize = Quantity( + type=str, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_radiussize')) + + x_tinker_inout_control_epsilonrule = Quantity( + type=str, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_epsilonrule')) + + x_tinker_inout_control_rattle = Quantity( + type=str, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_rattle')) + + x_tinker_inout_control_lambda = Quantity( + type=str, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_lambda')) + + x_tinker_inout_control_mutate = Quantity( + type=str, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_mutate')) + + x_tinker_inout_control_basin = Quantity( + type=str, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_basin')) + + x_tinker_inout_control_pme_grid = Quantity( + type=str, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_pme_grid')) + + x_tinker_inout_control_pme_order = Quantity( + type=str, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_pme_order')) + + x_tinker_inout_control_nstep = Quantity( + type=np.dtype(np.int32), + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_nstep')) + + x_tinker_inout_control_initial_configuration_file = Quantity( + type=str, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_initial_configuration_file')) + + x_tinker_inout_control_final_configuration_file = Quantity( + type=str, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_final_configuration_file')) + + x_tinker_inout_control_initial_trajectory_file = Quantity( + type=str, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_initial_trajectory_file')) + + x_tinker_inout_control_restart_file = Quantity( + type=str, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_restart_file')) + + x_tinker_inout_control_archive_file = Quantity( + type=str, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_archive_file')) + + x_tinker_inout_control_force_field_file = Quantity( + type=str, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_force_field_file')) + + x_tinker_inout_control_key_file = Quantity( + type=str, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_key_file')) + + x_tinker_inout_control_coordinate_file_list = Quantity( + type=str, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_coordinate_file_list')) + + x_tinker_inout_control_structure_file = Quantity( + type=str, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_structure_file')) + + x_tinker_inout_control_parameter_file = Quantity( + type=str, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_parameter_file')) + + x_tinker_inout_control_input_file = Quantity( + type=str, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_input_file')) + + x_tinker_inout_control_topology_file = Quantity( + type=str, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_topology_file')) + + x_tinker_inout_control_configuration_file = Quantity( + type=str, + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_configuration_file')) + + x_tinker_inout_control_number_of_parameter_files = Quantity( + type=np.dtype(np.int32), + shape=[], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_number_of_parameter_files')) + + x_tinker_inout_control_parameter_files = Quantity( + type=str, + shape=['x_tinker_inout_control_number_of_parameter_files'], + description=''' + tinker running environment and control parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_inout_control_parameter_files')) + + x_tinker_section_input_output_files = SubSection( + sub_section=SectionProxy('x_tinker_section_input_output_files'), + repeats=True, + a_legacy=LegacyDefinition(name='x_tinker_section_input_output_files')) + + +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, a_legacy=LegacyDefinition(name='x_tinker_section_atom_to_atom_type_ref')) + + x_tinker_atom_to_atom_type_ref = Quantity( + type=np.dtype(np.int64), + shape=['number_of_atoms_per_type'], + description=''' + Reference to the atoms of each atom type. + ''', + a_legacy=LegacyDefinition(name='x_tinker_atom_to_atom_type_ref')) + + +class x_tinker_section_single_configuration_calculation(MSection): + ''' + section for gathering values for MD steps + ''' + + m_def = Section(validate=False, a_legacy=LegacyDefinition(name='x_tinker_section_single_configuration_calculation')) + + +class section_system(public.section_system): + + m_def = Section(validate=False, extends_base_section=True, a_legacy=LegacyDefinition(name='section_system')) + + x_tinker_atom_positions_image_index = Quantity( + type=np.dtype(np.int32), + shape=['number_of_atoms', 3], + unit='dimensionless', + description=''' + PBC image flag index. + ''', + a_legacy=LegacyDefinition(name='x_tinker_atom_positions_image_index')) + + x_tinker_atom_positions_scaled = Quantity( + type=np.dtype(np.float64), + shape=['number_of_atoms', 3], + unit='dimensionless', + description=''' + Position of the atoms in a scaled format [0, 1]. + ''', + a_legacy=LegacyDefinition(name='x_tinker_atom_positions_scaled')) + + x_tinker_atom_positions_wrapped = Quantity( + type=np.dtype(np.float64), + shape=['number_of_atoms', 3], + unit='meter', + description=''' + Position of the atoms wrapped back to the periodic box. + ''', + a_legacy=LegacyDefinition(name='x_tinker_atom_positions_wrapped')) + + x_tinker_lattice_lengths = Quantity( + type=np.dtype(np.float64), + shape=[3], + description=''' + Lattice dimensions in a vector. Vector includes [a, b, c] lengths. + ''', + categories=[public.configuration_core], + a_legacy=LegacyDefinition(name='x_tinker_lattice_lengths')) + + x_tinker_lattice_angles = Quantity( + type=np.dtype(np.float64), + shape=[3], + description=''' + Angles of lattice vectors. Vector includes [alpha, beta, gamma] in degrees. + ''', + categories=[public.configuration_core], + a_legacy=LegacyDefinition(name='x_tinker_lattice_angles')) + + x_tinker_dummy = Quantity( + type=str, + shape=[], + description=''' + dummy + ''', + a_legacy=LegacyDefinition(name='x_tinker_dummy')) + + x_tinker_mdin_finline = Quantity( + type=str, + shape=[], + description=''' + finline in mdin + ''', + a_legacy=LegacyDefinition(name='x_tinker_mdin_finline')) + + x_tinker_traj_timestep_store = Quantity( + type=str, + shape=[], + description=''' + tmp + ''', + a_legacy=LegacyDefinition(name='x_tinker_traj_timestep_store')) + + x_tinker_traj_number_of_atoms_store = Quantity( + type=str, + shape=[], + description=''' + tmp + ''', + a_legacy=LegacyDefinition(name='x_tinker_traj_number_of_atoms_store')) + + x_tinker_traj_box_bound_store = Quantity( + type=str, + shape=[], + description=''' + tmp + ''', + a_legacy=LegacyDefinition(name='x_tinker_traj_box_bound_store')) + + x_tinker_traj_box_bounds_store = Quantity( + type=str, + shape=[], + description=''' + tmp + ''', + a_legacy=LegacyDefinition(name='x_tinker_traj_box_bounds_store')) + + x_tinker_traj_variables_store = Quantity( + type=str, + shape=[], + description=''' + tmp + ''', + a_legacy=LegacyDefinition(name='x_tinker_traj_variables_store')) + + x_tinker_traj_atoms_store = Quantity( + type=str, + shape=[], + description=''' + tmp + ''', + a_legacy=LegacyDefinition(name='x_tinker_traj_atoms_store')) + + +class section_sampling_method(public.section_sampling_method): + + m_def = Section(validate=False, extends_base_section=True, a_legacy=LegacyDefinition(name='section_sampling_method')) + + x_tinker_barostat_target_pressure = Quantity( + type=np.dtype(np.float64), + shape=[], + unit='pascal', + description=''' + MD barostat target pressure. + ''', + categories=[public.settings_molecular_dynamics, public.settings_barostat, public.settings_sampling], + a_legacy=LegacyDefinition(name='x_tinker_barostat_target_pressure')) + + x_tinker_barostat_tau = Quantity( + type=np.dtype(np.float64), + shape=[], + unit='second', + description=''' + MD barostat relaxation time. + ''', + categories=[public.settings_molecular_dynamics, public.settings_barostat, public.settings_sampling], + a_legacy=LegacyDefinition(name='x_tinker_barostat_tau')) + + x_tinker_barostat_type = Quantity( + type=str, + shape=[], + description=''' + MD barostat type, valid values are defined in the barostat_type wiki page. + ''', + categories=[public.settings_molecular_dynamics, public.settings_barostat, public.settings_sampling], + a_legacy=LegacyDefinition(name='x_tinker_barostat_type')) + + x_tinker_integrator_dt = Quantity( + type=np.dtype(np.float64), + shape=[], + unit='second', + description=''' + MD integration time step. + ''', + categories=[public.settings_molecular_dynamics, public.settings_integrator, public.settings_sampling], + a_legacy=LegacyDefinition(name='x_tinker_integrator_dt')) + + x_tinker_integrator_type = Quantity( + type=str, + shape=[], + description=''' + MD integrator type, valid values are defined in the integrator_type wiki page. + ''', + categories=[public.settings_molecular_dynamics, public.settings_integrator, public.settings_sampling], + a_legacy=LegacyDefinition(name='x_tinker_integrator_type')) + + x_tinker_periodicity_type = Quantity( + type=str, + shape=[], + description=''' + Periodic boundary condition type in the sampling (non-PBC or PBC). + ''', + categories=[public.settings_molecular_dynamics, public.settings_integrator, public.settings_sampling], + a_legacy=LegacyDefinition(name='x_tinker_periodicity_type')) + + x_tinker_langevin_gamma = Quantity( + type=np.dtype(np.float64), + shape=[], + unit='second', + description=''' + Langevin thermostat damping factor. + ''', + categories=[public.settings_molecular_dynamics, public.settings_sampling, public.settings_thermostat], + a_legacy=LegacyDefinition(name='x_tinker_langevin_gamma')) + + x_tinker_number_of_steps_requested = Quantity( + type=np.dtype(np.float64), + shape=[], + description=''' + Number of requested MD integration time steps. + ''', + categories=[public.settings_molecular_dynamics, public.settings_integrator, public.settings_sampling], + a_legacy=LegacyDefinition(name='x_tinker_number_of_steps_requested')) + + x_tinker_thermostat_level = Quantity( + type=str, + shape=[], + description=''' + MD thermostat level (see wiki: single, multiple, regional). + ''', + categories=[public.settings_molecular_dynamics, public.settings_sampling, public.settings_thermostat], + a_legacy=LegacyDefinition(name='x_tinker_thermostat_level')) + + x_tinker_thermostat_target_temperature = Quantity( + type=np.dtype(np.float64), + shape=[], + unit='kelvin', + description=''' + MD thermostat target temperature. + ''', + categories=[public.settings_molecular_dynamics, public.settings_sampling, public.settings_thermostat], + a_legacy=LegacyDefinition(name='x_tinker_thermostat_target_temperature')) + + x_tinker_thermostat_tau = Quantity( + type=np.dtype(np.float64), + shape=[], + unit='second', + description=''' + MD thermostat relaxation time. + ''', + categories=[public.settings_molecular_dynamics, public.settings_sampling, public.settings_thermostat], + a_legacy=LegacyDefinition(name='x_tinker_thermostat_tau')) + + x_tinker_thermostat_type = Quantity( + type=str, + shape=[], + description=''' + MD thermostat type, valid values are defined in the thermostat_type wiki page. + ''', + categories=[public.settings_molecular_dynamics, public.settings_sampling, public.settings_thermostat], + a_legacy=LegacyDefinition(name='x_tinker_thermostat_type')) + + +class section_atom_type(common.section_atom_type): + + m_def = Section(validate=False, extends_base_section=True, a_legacy=LegacyDefinition(name='section_atom_type')) + + x_tinker_atom_name = Quantity( + type=str, + shape=[], + description=''' + Atom name of an atom in topology definition. + ''', + a_legacy=LegacyDefinition(name='x_tinker_atom_name')) + + x_tinker_atom_type = Quantity( + type=str, + shape=[], + description=''' + Atom type of an atom in topology definition. + ''', + a_legacy=LegacyDefinition(name='x_tinker_atom_type')) + + x_tinker_atom_element = Quantity( + type=str, + shape=[], + description=''' + Atom type of an atom in topology definition. + ''', + a_legacy=LegacyDefinition(name='x_tinker_atom_element')) + + x_tinker_atom_type_element = Quantity( + type=str, + shape=[], + description=''' + Element symbol of an atom type. + ''', + a_legacy=LegacyDefinition(name='x_tinker_atom_type_element')) + + x_tinker_atom_type_radius = Quantity( + type=np.dtype(np.float64), + shape=[], + description=''' + van der Waals radius of an atom type. + ''', + a_legacy=LegacyDefinition(name='x_tinker_atom_type_radius')) + + number_of_atoms_per_type = Quantity( + type=int, + shape=[], + description=''' + Number of atoms involved in this type. + ''', + a_legacy=LegacyDefinition(name='number_of_atoms_per_type')) + + +class section_interaction(common.section_interaction): + + m_def = Section(validate=False, extends_base_section=True, a_legacy=LegacyDefinition(name='section_interaction')) + + x_tinker_interaction_atom_to_atom_type_ref = Quantity( + type=common.section_atom_type, + shape=['number_of_atoms_per_interaction'], + description=''' + Reference to the atom type of each interaction atoms. + ''', + a_legacy=LegacyDefinition(name='x_tinker_interaction_atom_to_atom_type_ref')) + + x_tinker_number_of_defined_pair_interactions = Quantity( + type=np.dtype(np.int32), + shape=[], + description=''' + Number of defined pair interactions (L-J pairs). + ''', + a_legacy=LegacyDefinition(name='x_tinker_number_of_defined_pair_interactions')) + + x_tinker_pair_interaction_atom_type_ref = Quantity( + type=common.section_atom_type, + shape=['x_tinker_number_of_defined_pair_interactions', 'number_of_atoms_per_interaction'], + description=''' + Reference to the atom type for pair interactions. + ''', + a_legacy=LegacyDefinition(name='x_tinker_pair_interaction_atom_type_ref')) + + x_tinker_pair_interaction_parameters = Quantity( + type=np.dtype(np.float64), + shape=['x_tinker_number_of_defined_pair_interactions', 2], + description=''' + Pair interactions parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_pair_interaction_parameters')) + + +class section_molecule_interaction(common.section_molecule_interaction): + + m_def = Section(validate=False, extends_base_section=True, a_legacy=LegacyDefinition(name='section_molecule_interaction')) + + x_tinker_molecule_interaction_atom_to_atom_type_ref = Quantity( + type=common.section_atom_type, + shape=['number_of_atoms_per_interaction'], + description=''' + Reference to the atom type of each molecule interaction atoms. + ''', + a_legacy=LegacyDefinition(name='x_tinker_molecule_interaction_atom_to_atom_type_ref')) + + x_tinker_number_of_defined_molecule_pair_interactions = Quantity( + type=np.dtype(np.int32), + shape=[], + description=''' + Number of defined pair interactions within a molecule (L-J pairs). + ''', + a_legacy=LegacyDefinition(name='x_tinker_number_of_defined_molecule_pair_interactions')) + + x_tinker_pair_molecule_interaction_parameters = Quantity( + type=np.dtype(np.float64), + shape=['number_of_defined_molecule_pair_interactions', 2], + description=''' + Molecule pair interactions parameters. + ''', + a_legacy=LegacyDefinition(name='x_tinker_pair_molecule_interaction_parameters')) + + x_tinker_pair_molecule_interaction_to_atom_type_ref = Quantity( + type=common.section_atom_type, + 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. + ''', + a_legacy=LegacyDefinition(name='x_tinker_pair_molecule_interaction_to_atom_type_ref')) + + +class section_run(public.section_run): + + m_def = Section(validate=False, extends_base_section=True, a_legacy=LegacyDefinition(name='section_run')) + + x_tinker_program_version_date = Quantity( + type=str, + shape=[], + description=''' + Program version date. + ''', + a_legacy=LegacyDefinition(name='x_tinker_program_version_date')) + + x_tinker_parallel_task_nr = Quantity( + type=np.dtype(np.float64), + shape=[], + description=''' + Program task no. + ''', + a_legacy=LegacyDefinition(name='x_tinker_parallel_task_nr')) + + x_tinker_build_osarch = Quantity( + type=str, + shape=[], + description=''' + Program Build OS/ARCH + ''', + a_legacy=LegacyDefinition(name='x_tinker_build_osarch')) + + x_tinker_output_created_by_user = Quantity( + type=str, + shape=[], + description=''' + Output file creator + ''', + a_legacy=LegacyDefinition(name='x_tinker_output_created_by_user')) + + x_tinker_most_severe_warning_level = Quantity( + type=str, + shape=[], + description=''' + Highest tinker warning level in the run. + ''', + a_legacy=LegacyDefinition(name='x_tinker_most_severe_warning_level')) + + x_tinker_program_build_date = Quantity( + type=str, + shape=[], + description=''' + Program Build date + ''', + a_legacy=LegacyDefinition(name='x_tinker_program_build_date')) + + x_tinker_program_citation = Quantity( + type=str, + shape=[], + description=''' + Program citations + ''', + a_legacy=LegacyDefinition(name='x_tinker_program_citation')) + + x_tinker_program_copyright = Quantity( + type=str, + shape=[], + description=''' + Program copyright + ''', + a_legacy=LegacyDefinition(name='x_tinker_program_copyright')) + + x_tinker_number_of_tasks = Quantity( + type=np.dtype(np.float64), + shape=[], + description=''' + Number of tasks in parallel program (MPI). + ''', + a_legacy=LegacyDefinition(name='x_tinker_number_of_tasks')) + + x_tinker_program_module_version = Quantity( + type=str, + shape=[], + description=''' + tinker program module version. + ''', + a_legacy=LegacyDefinition(name='x_tinker_program_module_version')) + + x_tinker_program_license = Quantity( + type=str, + shape=[], + description=''' + tinker program license. + ''', + a_legacy=LegacyDefinition(name='x_tinker_program_license')) + + x_tinker_xlo_xhi = Quantity( + type=str, + shape=[], + description=''' + test + ''', + a_legacy=LegacyDefinition(name='x_tinker_xlo_xhi')) + + x_tinker_data_file_store = Quantity( + type=str, + shape=[], + description=''' + Filename of data file + ''', + a_legacy=LegacyDefinition(name='x_tinker_data_file_store')) + + x_tinker_program_working_path = Quantity( + type=str, + shape=[], + description=''' + tmp + ''', + a_legacy=LegacyDefinition(name='x_tinker_program_working_path')) + + x_tinker_program_execution_host = Quantity( + type=str, + shape=[], + description=''' + tmp + ''', + a_legacy=LegacyDefinition(name='x_tinker_program_execution_host')) + + x_tinker_program_execution_path = Quantity( + type=str, + shape=[], + description=''' + tmp + ''', + a_legacy=LegacyDefinition(name='x_tinker_program_execution_path')) + + x_tinker_program_module = Quantity( + type=str, + shape=[], + description=''' + tmp + ''', + a_legacy=LegacyDefinition(name='x_tinker_program_module')) + + x_tinker_program_execution_date = Quantity( + type=str, + shape=[], + description=''' + tmp + ''', + a_legacy=LegacyDefinition(name='x_tinker_program_execution_date')) + + x_tinker_program_execution_time = Quantity( + type=str, + shape=[], + description=''' + tmp + ''', + a_legacy=LegacyDefinition(name='x_tinker_program_execution_time')) + + x_tinker_mdin_header = Quantity( + type=str, + shape=[], + description=''' + tmp + ''', + a_legacy=LegacyDefinition(name='x_tinker_mdin_header')) + + x_tinker_mdin_wt = Quantity( + type=str, + shape=[], + description=''' + tmp + ''', + a_legacy=LegacyDefinition(name='x_tinker_mdin_wt')) + + x_tinker_section_control_parameters = SubSection( + sub_section=SectionProxy('x_tinker_section_control_parameters'), + repeats=True, + a_legacy=LegacyDefinition(name='x_tinker_section_control_parameters')) + + +class section_topology(common.section_topology): + + m_def = Section(validate=False, extends_base_section=True, a_legacy=LegacyDefinition(name='section_topology')) + + x_tinker_input_units_store = Quantity( + type=str, + shape=[], + 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. + ''', + a_legacy=LegacyDefinition(name='x_tinker_input_units_store')) + + x_tinker_data_bond_types_store = Quantity( + type=np.dtype(np.int32), + shape=[], + description=''' + store temporarly + ''', + a_legacy=LegacyDefinition(name='x_tinker_data_bond_types_store')) + + x_tinker_data_bond_count_store = Quantity( + type=np.dtype(np.int32), + shape=[], + description=''' + store temporarly + ''', + a_legacy=LegacyDefinition(name='x_tinker_data_bond_count_store')) + + x_tinker_data_angle_count_store = Quantity( + type=np.dtype(np.int32), + shape=[], + description=''' + store temporarly + ''', + a_legacy=LegacyDefinition(name='x_tinker_data_angle_count_store')) + + x_tinker_data_atom_types_store = Quantity( + type=np.dtype(np.int32), + shape=[], + description=''' + store temporarly + ''', + a_legacy=LegacyDefinition(name='x_tinker_data_atom_types_store')) + + x_tinker_data_dihedral_count_store = Quantity( + type=np.dtype(np.int32), + shape=[], + description=''' + store temporarly + ''', + a_legacy=LegacyDefinition(name='x_tinker_data_dihedral_count_store')) + + x_tinker_data_angles_store = Quantity( + type=str, + shape=[], + description=''' + store temporarly + ''', + a_legacy=LegacyDefinition(name='x_tinker_data_angles_store')) + + x_tinker_data_angle_list_store = Quantity( + type=str, + shape=[], + description=''' + tmp + ''', + a_legacy=LegacyDefinition(name='x_tinker_data_angle_list_store')) + + x_tinker_data_bond_list_store = Quantity( + type=str, + shape=[], + description=''' + tmp + ''', + a_legacy=LegacyDefinition(name='x_tinker_data_bond_list_store')) + + x_tinker_data_dihedral_list_store = Quantity( + type=str, + shape=[], + description=''' + tmp + ''', + a_legacy=LegacyDefinition(name='x_tinker_data_dihedral_list_store')) + + x_tinker_data_dihedral_coeff_list_store = Quantity( + type=str, + shape=[], + description=''' + tmp + ''', + a_legacy=LegacyDefinition(name='x_tinker_data_dihedral_coeff_list_store')) + + x_tinker_masses_store = Quantity( + type=str, + shape=[], + description=''' + tmp + ''', + a_legacy=LegacyDefinition(name='x_tinker_masses_store')) + + x_tinker_data_topo_list_store = Quantity( + type=str, + shape=[], + description=''' + tmp + ''', + a_legacy=LegacyDefinition(name='x_tinker_data_topo_list_store')) + + x_tinker_section_atom_to_atom_type_ref = SubSection( + sub_section=SectionProxy('x_tinker_section_atom_to_atom_type_ref'), + repeats=True, + a_legacy=LegacyDefinition(name='x_tinker_section_atom_to_atom_type_ref')) + + +class section_frame_sequence(public.section_frame_sequence): + + m_def = Section(validate=False, extends_base_section=True, a_legacy=LegacyDefinition(name='section_frame_sequence')) + + x_tinker_number_of_volumes_in_sequence = Quantity( + type=int, + shape=[], + description=''' + Gives the number of volumes in this sequence of frames, see + x_tinker_frame_sequence_volume. + ''', + a_legacy=LegacyDefinition(name='x_tinker_number_of_volumes_in_sequence')) + + x_tinker_number_of_density_in_sequence = Quantity( + type=int, + shape=[], + description=''' + Gives the number of densities in this sequence of frames, see + x_tinker_frame_sequence_density. + ''', + a_legacy=LegacyDefinition(name='x_tinker_number_of_density_in_sequence')) + + x_tinker_number_of_bond_energies_in_sequence = Quantity( + type=int, + shape=[], + description=''' + Gives the number of bond_energies in this sequence of frames, see + x_tinker_frame_sequence_bond_energy. + ''', + a_legacy=LegacyDefinition(name='x_tinker_number_of_bond_energies_in_sequence')) + + x_tinker_number_of_virial_energies_in_sequence = Quantity( + type=int, + shape=[], + description=''' + Gives the number of bond_energies in this sequence of frames, see + x_tinker_frame_sequence_virial_energy. + ''', + a_legacy=LegacyDefinition(name='x_tinker_number_of_virial_energies_in_sequence')) + + x_tinker_number_of_angle_energies_in_sequence = Quantity( + type=int, + shape=[], + description=''' + Gives the number of angle_energies in this sequence of frames, see + x_tinker_frame_sequence_angle_energy. + ''', + a_legacy=LegacyDefinition(name='x_tinker_number_of_angle_energies_in_sequence')) + + x_tinker_number_of_proper_dihedral_energies_in_sequence = Quantity( + type=int, + shape=[], + description=''' + Gives the number of proper_dihedral_energies in this sequence of frames, see + x_tinker_frame_sequence_proper_dihedral_energy. + ''', + a_legacy=LegacyDefinition(name='x_tinker_number_of_proper_dihedral_energies_in_sequence')) + + x_tinker_number_of_improper_dihedral_energies_in_sequence = Quantity( + type=int, + shape=[], + description=''' + Gives the number of improper_dihedral_energies in this sequence of frames, see + x_tinker_frame_sequence_improper_dihedral_energy. + ''', + a_legacy=LegacyDefinition(name='x_tinker_number_of_improper_dihedral_energies_in_sequence')) + + x_tinker_number_of_cross_dihedral_energies_in_sequence = Quantity( + type=int, + shape=[], + description=''' + Gives the number of cross_dihedral_energies in this sequence of frames, see + x_tinker_frame_sequence_cross_dihedral_energy. + ''', + a_legacy=LegacyDefinition(name='x_tinker_number_of_cross_dihedral_energies_in_sequence')) + + x_tinker_number_of_vdw_energies_in_sequence = Quantity( + type=int, + shape=[], + description=''' + Gives the number of vdw_energies in this sequence of frames, see + x_tinker_frame_sequence_vdw_energy. + ''', + a_legacy=LegacyDefinition(name='x_tinker_number_of_vdw_energies_in_sequence')) + + x_tinker_number_of_boundary_energies_in_sequence = Quantity( + type=int, + shape=[], + description=''' + Gives the number of boundary_energies in this sequence of frames, see + x_tinker_frame_sequence_boundary_energy. + ''', + a_legacy=LegacyDefinition(name='x_tinker_number_of_boundary_energies_in_sequence')) + + x_tinker_number_of_electrostatic_energies_in_sequence = Quantity( + type=int, + shape=[], + description=''' + Gives the number of electrostatic_energies in this sequence of frames, see + x_tinker_frame_sequence_electrostatic_energy. + ''', + a_legacy=LegacyDefinition(name='x_tinker_number_of_electrostatic_energies_in_sequence')) + + x_tinker_number_of_total_energies_in_sequence = Quantity( + type=int, + shape=[], + description=''' + Gives the number of total_energies in this sequence of frames, see + x_tinker_frame_sequence_total_energy. + ''', + a_legacy=LegacyDefinition(name='x_tinker_number_of_total_energies_in_sequence')) + + x_tinker_number_of_total_kinetic_energies_in_sequence = Quantity( + type=int, + shape=[], + description=''' + Gives the number of total_kinetic_energies in this sequence of frames, see + x_tinker_frame_sequence_total_kinetic_energy_frames. + ''', + a_legacy=LegacyDefinition(name='x_tinker_number_of_total_kinetic_energies_in_sequence')) + + x_tinker_number_of_misc_energies_in_sequence = Quantity( + type=int, + shape=[], + description=''' + Gives the number of misc_energies in this sequence of frames, see + x_tinker_frame_sequence_misc_energy. + ''', + a_legacy=LegacyDefinition(name='x_tinker_number_of_misc_energies_in_sequence')) + + x_tinker_frame_sequence_density_frames = Quantity( + type=np.dtype(np.int32), + shape=['x_tinker_number_of_density_in_sequence'], + description=''' + Array containing the strictly increasing indices of the frames the + x_tinker_frame_sequence_density values refers to. If not given it defaults to the + trivial mapping 0,1,... + ''', + a_legacy=LegacyDefinition(name='x_tinker_frame_sequence_density_frames')) + + x_tinker_frame_sequence_density = Quantity( + type=np.dtype(np.float64), + shape=['x_tinker_number_of_density_in_sequence'], + description=''' + Array containing the values of the density along this sequence of frames (i.e., a + trajectory, a frame is one section_single_configuration_calculation). If not all + frames have a value the indices of the frames that have a value are stored in + frame_sequence_density_frames. + ''', + a_legacy=LegacyDefinition(name='x_tinker_frame_sequence_density')) + + x_tinker_frame_sequence_cross_dihedral_energy_frames = Quantity( + type=np.dtype(np.int32), + shape=['x_tinker_number_of_cross_dihedral_energy_in_sequence'], + description=''' + Array containing the strictly increasing indices of the frames the + x_tinker_frame_sequence_cross_dihedral_energy values refers to. If not given it + defaults to the trivial mapping 0,1,... + ''', + a_legacy=LegacyDefinition(name='x_tinker_frame_sequence_cross_dihedral_energy_frames')) + + x_tinker_frame_sequence_cross_dihedral_energy = Quantity( + type=np.dtype(np.float64), + shape=['x_tinker_number_of_cross_dihedral_energy_in_sequence'], + description=''' + Array containing the values of the cross_dihedral_energy along this sequence of + frames (i.e., a trajectory, a frame is one + section_single_configuration_calculation). If not all frames have a value the + indices of the frames that have a value are stored in + frame_sequence_cross_dihedral_energy_frames. + ''', + a_legacy=LegacyDefinition(name='x_tinker_frame_sequence_cross_dihedral_energy')) + + x_tinker_frame_sequence_improper_dihedral_energy_frames = Quantity( + type=np.dtype(np.int32), + shape=['x_tinker_number_of_improper_dihedral_energy_in_sequence'], + description=''' + Array containing the strictly increasing indices of the frames the + x_tinker_frame_sequence_improper_dihedral_energy values refers to. If not given it + defaults to the trivial mapping 0,1,... + ''', + a_legacy=LegacyDefinition(name='x_tinker_frame_sequence_improper_dihedral_energy_frames')) + + x_tinker_frame_sequence_improper_dihedral_energy = Quantity( + type=np.dtype(np.float64), + shape=['x_tinker_number_of_improper_dihedral_energy_in_sequence'], + description=''' + Array containing the values of the improper_dihedral_energy along this sequence of + frames (i.e., a trajectory, a frame is one + section_single_configuration_calculation). If not all frames have a value the + indices of the frames that have a value are stored in + frame_sequence_improper_dihedral_energy_frames. + ''', + a_legacy=LegacyDefinition(name='x_tinker_frame_sequence_improper_dihedral_energy')) + + x_tinker_frame_sequence_proper_dihedral_energy_frames = Quantity( + type=np.dtype(np.int32), + shape=['x_tinker_number_of_proper_dihedral_energy_in_sequence'], + description=''' + Array containing the strictly increasing indices of the frames the + x_tinker_frame_sequence_proper_dihedral_energy values refers to. If not given it + defaults to the trivial mapping 0,1,... + ''', + a_legacy=LegacyDefinition(name='x_tinker_frame_sequence_proper_dihedral_energy_frames')) + + x_tinker_frame_sequence_proper_dihedral_energy = Quantity( + type=np.dtype(np.float64), + shape=['x_tinker_number_of_proper_dihedral_energy_in_sequence'], + description=''' + Array containing the values of the proper_dihedral_energy along this sequence of + frames (i.e., a trajectory, a frame is one + section_single_configuration_calculation). If not all frames have a value the + indices of the frames that have a value are stored in + frame_sequence_proper_dihedral_energy_frames. + ''', + a_legacy=LegacyDefinition(name='x_tinker_frame_sequence_proper_dihedral_energy')) + + x_tinker_frame_sequence_bond_energy_frames = Quantity( + type=np.dtype(np.int32), + shape=['x_tinker_number_of_bond_energies_in_sequence'], + description=''' + Array containing the strictly increasing indices of the frames the + x_tinker_frame_sequence_bond_energy values refers to. If not given it defaults to + the trivial mapping 0,1,... + ''', + a_legacy=LegacyDefinition(name='x_tinker_frame_sequence_bond_energy_frames')) + + x_tinker_frame_sequence_virial_energy_frames = Quantity( + type=np.dtype(np.int32), + shape=['x_tinker_number_of_virial_energies_in_sequence'], + description=''' + Array containing the strictly increasing indices of the frames the + x_tinker_frame_sequence_virial_energy values refers to. If not given it defaults + to the trivial mapping 0,1,... + ''', + a_legacy=LegacyDefinition(name='x_tinker_frame_sequence_virial_energy_frames')) + + x_tinker_frame_sequence_bond_energy = Quantity( + type=np.dtype(np.float64), + shape=['x_tinker_number_of_bond_energies_in_sequence'], + description=''' + Array containing the values of the bond_energy along this sequence of frames + (i.e., a trajectory, a frame is one section_single_configuration_calculation). If + not all frames have a value the indices of the frames that have a value are stored + in frame_sequence_bond_energy_frames. + ''', + a_legacy=LegacyDefinition(name='x_tinker_frame_sequence_bond_energy')) + + x_tinker_frame_sequence_virial_energy = Quantity( + type=np.dtype(np.float64), + shape=['x_tinker_number_of_virial_energies_in_sequence'], + description=''' + Array containing the values of the virial_energy along this sequence of frames + (i.e., a trajectory, a frame is one section_single_configuration_calculation). If + not all frames have a value the indices of the frames that have a value are stored + in frame_sequence_virial_energy_frames. + ''', + a_legacy=LegacyDefinition(name='x_tinker_frame_sequence_virial_energy')) + + x_tinker_frame_sequence_boundary_frames = Quantity( + type=np.dtype(np.int32), + shape=['x_tinker_number_of_boundary_energies_in_sequence'], + description=''' + Array containing the strictly increasing indices of the frames the + x_tinker_frame_sequence_boundary values refers to. If not given it defaults to the + trivial mapping 0,1,... + ''', + a_legacy=LegacyDefinition(name='x_tinker_frame_sequence_boundary_frames')) + + x_tinker_frame_sequence_boundary = Quantity( + type=np.dtype(np.float64), + shape=['x_tinker_number_of_boundary_energies_in_sequence'], + description=''' + Array containing the values of the boundary along this sequence of frames (i.e., a + trajectory, a frame is one section_single_configuration_calculation). If not all + frames have a value the indices of the frames that have a value are stored in + frame_sequence_boundary_frames. + ''', + a_legacy=LegacyDefinition(name='x_tinker_frame_sequence_boundary')) + + x_tinker_frame_sequence_angle_energy_frames = Quantity( + type=np.dtype(np.int32), + shape=['x_tinker_number_of_angle_energies_in_sequence'], + description=''' + Array containing the strictly increasing indices of the frames the + x_tinker_frame_sequence_angle_energy values refers to. If not given it defaults to + the trivial mapping 0,1,... + ''', + a_legacy=LegacyDefinition(name='x_tinker_frame_sequence_angle_energy_frames')) + + x_tinker_frame_sequence_angle_energy = Quantity( + type=np.dtype(np.float64), + shape=['x_tinker_number_of_angle_energies_in_sequence'], + description=''' + Array containing the values of the angle_energy along this sequence of frames + (i.e., a trajectory, a frame is one section_single_configuration_calculation). If + not all frames have a value the indices of the frames that have a value are stored + in frame_sequence_angle_energy_frames. + ''', + a_legacy=LegacyDefinition(name='x_tinker_frame_sequence_angle_energy')) + + x_tinker_frame_sequence_vdw_energy_frames = Quantity( + type=np.dtype(np.int32), + shape=['x_tinker_number_of_vdw_energies_in_sequence'], + description=''' + Array containing the strictly increasing indices of the frames the + x_tinker_frame_sequence_vdw_energy values refers to. If not given it defaults to + the trivial mapping 0,1,... + ''', + a_legacy=LegacyDefinition(name='x_tinker_frame_sequence_vdw_energy_frames')) + + x_tinker_frame_sequence_vdw_energy = Quantity( + type=np.dtype(np.float64), + shape=['x_tinker_number_of_vdw_energies_in_sequence'], + description=''' + Array containing the values of the vdw_energy along this sequence of frames (i.e., + a trajectory, a frame is one section_single_configuration_calculation). If not all + frames have a value the indices of the frames that have a value are stored in + frame_sequence_vdw_energy_frames. + ''', + a_legacy=LegacyDefinition(name='x_tinker_frame_sequence_vdw_energy')) + + x_tinker_frame_sequence_electrostatic_energy_frames = Quantity( + type=np.dtype(np.int32), + shape=['x_tinker_number_of_electrostatic_energies_in_sequence'], + description=''' + Array containing the strictly increasing indices of the frames the + x_tinker_frame_sequence_electrostatic_energy values refers to. If not given it + defaults to the trivial mapping 0,1,... + ''', + a_legacy=LegacyDefinition(name='x_tinker_frame_sequence_electrostatic_energy_frames')) + + x_tinker_frame_sequence_electrostatic_energy = Quantity( + type=np.dtype(np.float64), + shape=['x_tinker_number_of_electrostatic_energies_in_sequence'], + description=''' + Array containing the values of the electrostatic_energy along this sequence of + frames (i.e., a trajectory, a frame is one + section_single_configuration_calculation). If not all frames have a value the + indices of the frames that have a value are stored in + frame_sequence_electrostatic_energy_frames. + ''', + a_legacy=LegacyDefinition(name='x_tinker_frame_sequence_electrostatic_energy')) + + x_tinker_frame_sequence_total_energy_frames = Quantity( + type=np.dtype(np.int32), + shape=['x_tinker_number_of_total_energies_in_sequence'], + description=''' + Array containing the strictly increasing indices of the frames the + x_tinker_frame_sequence_total_energy values refers to. If not given it defaults to + the trivial mapping 0,1,... + ''', + a_legacy=LegacyDefinition(name='x_tinker_frame_sequence_total_energy_frames')) + + x_tinker_frame_sequence_total_energy = Quantity( + type=np.dtype(np.float64), + shape=['x_tinker_number_of_total_energies_in_sequence'], + description=''' + Array containing the values of the total_energy along this sequence of frames + (i.e., a trajectory, a frame is one section_single_configuration_calculation). If + not all frames have a value the indices of the frames that have a value are stored + in frame_sequence_total_energy_frames. + ''', + a_legacy=LegacyDefinition(name='x_tinker_frame_sequence_total_energy')) + + x_tinker_frame_sequence_total_kinetic_energy_frames = Quantity( + type=np.dtype(np.int32), + shape=['x_tinker_number_of_total_kinetic_energies_in_sequence'], + description=''' + Array containing the strictly increasing indices of the frames the + x_tinker_frame_sequence_total_kinetic_energy values refers to. If not given it + defaults to the trivial mapping 0,1,... + ''', + a_legacy=LegacyDefinition(name='x_tinker_frame_sequence_total_kinetic_energy_frames')) + + x_tinker_frame_sequence_total_kinetic_energy = Quantity( + type=np.dtype(np.float64), + shape=['x_tinker_number_of_total_kinetic_energies_in_sequence'], + description=''' + Array containing the values of the total_kinetic_energy along this sequence of + frames (i.e., a trajectory, a frame is one + section_single_configuration_calculation). If not all frames have a value the + indices of the frames that have a value are stored in + frame_sequence_total_kinetic_energy_frames. + ''', + a_legacy=LegacyDefinition(name='x_tinker_frame_sequence_total_kinetic_energy')) + + x_tinker_frame_sequence_misc_energy_frames = Quantity( + type=np.dtype(np.int32), + shape=['x_tinker_number_of_misc_energies_in_sequence'], + description=''' + Array containing the strictly increasing indices of the frames the + x_tinker_frame_sequence_misc_energy values refers to. If not given it defaults to + the trivial mapping 0,1,... + ''', + a_legacy=LegacyDefinition(name='x_tinker_frame_sequence_misc_energy_frames')) + + x_tinker_frame_sequence_misc_energy = Quantity( + type=np.dtype(np.float64), + shape=['x_tinker_number_of_misc_energies_in_sequence'], + description=''' + Array containing the values of the misc_energy along this sequence of frames + (i.e., a trajectory, a frame is one section_single_configuration_calculation). If + not all frames have a value the indices of the frames that have a value are stored + in frame_sequence_misc_energy_frames. + ''', + a_legacy=LegacyDefinition(name='x_tinker_frame_sequence_misc_energy')) + + x_tinker_frame_sequence_volume_frames = Quantity( + type=np.dtype(np.int32), + shape=['x_tinker_number_of_volumes_in_sequence'], + description=''' + Array containing the strictly increasing indices of the frames the + x_tinker_frame_sequence_volume values refers to. If not given it defaults to the + trivial mapping 0,1,... + ''', + a_legacy=LegacyDefinition(name='x_tinker_frame_sequence_volume_frames')) + + x_tinker_frame_sequence_volume = Quantity( + type=np.dtype(np.float64), + shape=['x_tinker_number_of_volumes_in_sequence'], + description=''' + Array containing the values of the volume along this sequence of frames (i.e., a + trajectory, a frame is one section_single_configuration_calculation). If not all + frames have a value the indices of the frames that have a value are stored in + frame_sequence_volume_frames. + ''', + a_legacy=LegacyDefinition(name='x_tinker_frame_sequence_volume')) + + +class section_single_configuration_calculation(public.section_single_configuration_calculation): + + m_def = Section(validate=False, extends_base_section=True, a_legacy=LegacyDefinition(name='section_single_configuration_calculation')) + + x_tinker_section_single_configuration_calculation = SubSection( + sub_section=SectionProxy('x_tinker_section_single_configuration_calculation'), + repeats=True, + a_legacy=LegacyDefinition(name='x_tinker_section_single_configuration_calculation')) + + +m_package.__init_metainfo__()