diff --git a/parser/parser-amber/AMBERCommon.py b/parser/parser-amber/AMBERCommon.py index 37532a973a518a03ad01f4b7c569f48d58dd933f..ef9141fb201d34aae614b87ba116b908e415f6c3 100644 --- a/parser/parser-amber/AMBERCommon.py +++ b/parser/parser-amber/AMBERCommon.py @@ -132,12 +132,6 @@ class AMBERParserBase(object): self.extraDict = get_nameListDict('extra') self.parserInfo = PARSER_INFO_DEFAULT.copy() self.metaInfoEnv = get_metaInfo(self) -# self.cachingLevelForMetaName = { -# 'x_amber_trajectory_file_detect': CachingLevel.Cache, -# 'x_amber_geometry_optimization_cdetect': CachingLevel.Cache, -# 'x_amber_section_MD_detect': CachingLevel.Ignore, -# 'x_amber_single_configuration_calculation_detect': CachingLevel.Cache, -# } self.coverageIgnoreList = [ # ignore empty lines r"\s*", diff --git a/parser/parser-amber/AMBERParser.py b/parser/parser-amber/AMBERParser.py index 5ea9cae71ec223a556ac612156f356dd7fe25ff6..6730b734961ae9335070686a61d1ecbfa1fb70bb 100644 --- a/parser/parser-amber/AMBERParser.py +++ b/parser/parser-amber/AMBERParser.py @@ -207,7 +207,6 @@ class AMBERParser(AmberC.AMBERParserBase): if self.topology: self.topologyTable, self.topologyBonds = self.topology.to_dataframe() self.topologyDict = self.topologyTable.to_dict(orient='list') - #print(self.atompositions) self.topologyFormat = topoformat self.trajectoryFormat = trajformat #if trajformat or topoformat: @@ -397,9 +396,6 @@ class AMBERParser(AmberC.AMBERParserBase): # write trajectory #valuesDict = section.simpleValues -# samplingGIndex = backend.openSection("section_sampling_method") -# backend.addValue("sampling_method", sampling_method) -# backend.closeSection("section_sampling_method", samplingGIndex) frameSequenceGIndex = backend.openSection("section_frame_sequence") self.metaStorage.updateBackend(backend, startsection=['section_frame_sequence'], @@ -436,7 +432,6 @@ class AMBERParser(AmberC.AMBERParserBase): if self.fileDict[k].activeInfo: self.fileDict[k].value = v[-1] atLeastOneFileExist = True - #backend.superBackend.addValue(k, v[-1]) if atLeastOneFileExist: self.initializeFileHandlers() @@ -457,7 +452,6 @@ class AMBERParser(AmberC.AMBERParserBase): """Trigger called when section_method is closed. """ # input method - #if gIndex == self.inputMethodIndex: pass def onOpen_section_sampling_method(self, backend, gIndex, section): @@ -628,11 +622,9 @@ class AMBERParser(AmberC.AMBERParserBase): 'dictionary' : section_singlecalc_Dict } self.metaStorage.update(updateDict) - #self.secSingleGIndex = backend.openSection("section_single_configuration_calculation") self.metaStorage.updateBackend(backend.superBackend, startsection=['section_single_configuration_calculation'], autoopenclose=False) - #backend.closeSection("section_single_configuration_calculation", self.secSingleGIndex) self.onOpen_section_system(backend, None, None) self.onClose_section_system(backend, None, None) backend.superBackend.closeSection("section_single_configuration_calculation", self.secSingleGIndex) @@ -689,7 +681,6 @@ class AMBERParser(AmberC.AMBERParserBase): newLine = parser.fIn.readline() lastLine = ' = '.join([ "%s" % str(line) for line in zip(lastLine, newLine)]) for cName, key in getDict_MetaStrInDict(matchNameDict).items(): - #key = metaNameStart + cName.lower().replace(" ", "").replace("-", "") reDict={key:value for value in re.compile(r"(?:\s%s|^%s|,%s)\s*=\s*(?:'|\")?(?P<%s>[\-+0-9.a-zA-Z:]+)(?:'|\")?\s*,?" % (cName, cName, cName, key)).findall(lastLine)} @@ -705,13 +696,10 @@ class AMBERParser(AmberC.AMBERParserBase): else: matchNameDict[k].value=v matchNameDict[k].activeInfo=True - #parser.backend.addValue(k, v) return False def adHoc_read_namelist_stop_parsing(self, parser, stopOnMatchStr, quitOnMatchStr, metaNameStart, matchNameList, matchNameDict, onlyCaseSensitive, stopOnFirstLine): -# currentContext = parser.context[len(parser.context) - 1] -# currentMatcherId = currentContext.compiledMatcher.matcher.index. lastLine = parser.fIn.fInLine self.firstLine = 0 # Check the captured line has Fortran namelist variables and store them. @@ -726,10 +714,7 @@ class AMBERParser(AmberC.AMBERParserBase): matchNameDict, onlyCaseSensitive, stopOnFirstLine) is not True: while True: -# lastLine = parser.fIn.readline() lastLine = self.peekline(parser) -# self.lastfInLine = lastLine -# self.lastfInMatcher = currentMatcherId self.firstLine += 1 if not lastLine: break @@ -951,21 +936,6 @@ class AMBERParser(AmberC.AMBERParserBase): subMatchers=mdoutKeywordsSimpleMatchers ) - - ######################################## - # subMatcher for MD geometry that was used for the finished SCF cycle (see word 'preceding' in the description) - #geometryMDSubMatcher = SM (name = 'GeometryMD', - # startReStr = r"\s*(?:A|Final a)tomic structure \(and velocities\) as used in the preceding time step:", - # sections = ['section_system'], - # subMatchers = [ - # SM (r"\s*x \[A\]\s*y \[A\]\s*z \[A\]\s*Atom"), - # SM (startReStr = r"\s*atom\s+(?P<x_fhi_aims_geometry_atom_positions_x__angstrom>[-+0-9.]+)\s+(?P<x_fhi_aims_geometry_atom_positions_y__angstrom>[-+0-9.]+)\s+(?P<x_fhi_aims_geometry_atom_positions_z__angstrom>[-+0-9.]+)\s+(?P<x_fhi_aims_geometry_atom_labels>[a-zA-Z]+)", - # repeats = True, - # subMatchers = [ - # SM (r"\s*velocity\s+(?P<x_fhi_aims_geometry_atom_velocity_x__angstrom_ps_1>[-+0-9.]+)\s+(?P<x_fhi_aims_geometry_atom_velocity_y__angstrom_ps_1>[-+0-9.]+)\s+(?P<x_fhi_aims_geometry_atom_velocity_z__angstrom_ps_1>[-+0-9.]+)") - # ]) - # ]) - ######################################## # submatcher for MD mddataNameList=getList_MetaStrInDict(self.mddataDict) diff --git a/parser/parser-amber/MetaInfoStorage.py b/parser/parser-amber/MetaInfoStorage.py index a7ffd62455f664170155088777ca393634f14cc5..b8504cf4785e03c4755782a18b9968cdd4643dbf 100644 --- a/parser/parser-amber/MetaInfoStorage.py +++ b/parser/parser-amber/MetaInfoStorage.py @@ -249,12 +249,6 @@ class Container(object): elif "subfunction" in item: subfunc = item.subfunction storeValue, updateValue, item = subfunc(item) - #subfunc = item.functionbase - #storeValue, updateValue, item = eval(item.subfunction % item, - # globals(), - # #subfunc.__class__().__dict__ - # {k: getattr(subfunc.__class__(), k) for k in dir(subfunc.__class__())} - # ) elif "value" in item: updateValue = item['value'] if "postfunction" in item: @@ -655,9 +649,6 @@ class JsonMetaInfo(object): if itemname not in nameList: nameList.append(itemname) for name in searchList: - #if (('section' in name or - # 'settings' in name or - # 'configuration_core' in name) and if (set([name]) not in set(nameList) and self.isparent(name)): siblings.append(name) @@ -728,7 +719,7 @@ if __name__ == "__main__": for container in run.Containers: if 'section_topology' in container.Name: select = container - #select.Color = 4 + select.Color = 4 #select.PrintOnlyActive = 1 run.PrintOnlyNames = 1 print(run)