Commit e1a54afa authored by Berk Onat's avatar Berk Onat

Adding restriction_uri info.

parent 4c4660c9
Pipeline #27122 passed with stage
in 10 minutes and 32 seconds
......@@ -783,7 +783,50 @@ def get_updateDictionary(self, defname):
activeSections=['section_energy_van_der_Waals']
),
}
# Info for section_restricted_uri
restrictions = {
'number_of_restricted_uri_files' : MetaInfoMap(startpage,
value=int(1),
#autoSections=True,
activeInfo=True,
activeSections=['section_restricted_uri']
),
'restricted_uri_files' : MetaInfoMap(startpage,
#autoSections=True,
activeInfo=True,
activeSections=['section_restricted_uri'],
subfunction={
'function' : self.parameter_file_name,
'supportDict' : self.fileDict,
},
),
'restricted_uri_license' : MetaInfoMap(startpage,
value='CHARMM License',
#autoSections=True,
activeInfo=True,
activeSections=['section_restricted_uri']
),
'restricted_uri_restriction' : MetaInfoMap(startpage,
value='any access',
#autoSections=True,
activeInfo=True,
activeSections=['section_restricted_uri']
),
'restricted_uri_reason' : MetaInfoMap(startpage,
value='propriety license',
#autoSections=True,
activeInfo=True,
activeSections=['section_restricted_uri']
),
'restricted_uri_issue_authority' : MetaInfoMap(startpage,
value='CHARMM',
#autoSections=True,
activeInfo=True,
activeSections=['section_restricted_uri']
),
}
# ------------------------------------------
# Definitions for section_frame_sequence
# ------------------------------------------
......@@ -1503,6 +1546,8 @@ def get_updateDictionary(self, defname):
dictionary = topology
elif defname == 'singleconfcalc':
dictionary = singleconfcalc
elif defname == 'restrictions':
dictionary = restrictions
elif defname == 'frameseq':
dictionary = frameseq
elif defname == 'frameseqend':
......
......@@ -66,6 +66,8 @@ class CHARMMParser(SmartParser.ParserBase):
set_Dictionaries(self)
self.metaInfoEnv = get_metaInfo(self)
self.secGIndexDict = {}
#self.metaStorageRestrict = mStore.Container('section_restricted_uri')
#self.metaStorageRestrict.build(jsonmetadata, 'section_restricted_uri', {})
self.cachingLevelForMetaName = {
PARSERTAG + '_trajectory_file_detect': CachingLevel.Cache,
......@@ -256,8 +258,25 @@ class CHARMMParser(SmartParser.ParserBase):
#self.initialize_values()
self.secRunOpen = False
self.metaStorage.reset({'startSection' : [['section_run']]})
self.metaStorageRestrict.reset({'startSection' : [['section_restricted_uri']]})
self.reset_values()
def parameter_file_name(self, filedict, itemdict):
""" Function to generate data for parameter files list
"""
working_dir_name = os.path.dirname(os.path.normpath(os.path.abspath(self.fName)))
parmmeta = isMetaStrInDict("prm_file",self.fileDict)
filename = []
if parmmeta is not None:
if self.fileDict[parmmeta].value is not None:
fname = self.fileDict[parmmeta].value
filename.append(fname.replace(working_dir_name, '.'+os.path.sep))
if filename:
return False, filename, itemdict
else:
return False, None, itemdict
def findUnitFileInIODict(self, theUnit):
theUnitList=[]
for secRun, secList in self.inputOutputCards.items():
......@@ -565,7 +584,7 @@ class CHARMMParser(SmartParser.ParserBase):
if self.fileDict[fKey+'stream'].value is None:
self.fileDict[fKey+'stream'].value = 'input coor card'
else:
self.fileDict[fKey+'stream'].value = elf.fileDict[
self.fileDict[fKey+'stream'].value = self.fileDict[
fKey+'stream'].value + ', input coor card'
if self.fileDict[fKey+'stream'].strDict is None:
self.fileDict[fKey+'stream'].strDict = self.latestTopoFile['topoStrDict']
......@@ -1096,6 +1115,38 @@ class CHARMMParser(SmartParser.ParserBase):
#self.stepcontrolDict.update({"follow" : followsteps})
self.onOpen_section_sampling_method(backend, None, None)
self.onClose_section_sampling_method(backend, None, None)
if self.topology:
if self.newTopo:
section_file_Dict = {}
section_file_Dict.update(self.fileDict)
updateDict = {
'startSection' : [[PARSERTAG+'_section_control_parameters']],
'dictionary' : section_file_Dict
}
self.metaStorage.update(updateDict)
self.metaStorage.updateBackend(backend.superBackend,
startsection=[PARSERTAG+'_section_control_parameters'],
autoopenclose=False)
#updateDict = {
# 'startSection' : [[PARSERTAG+'_section_input_output_files']],
# 'dictionary' : self.sectionInoutDict
# }
#self.metaStorage.update(updateDict)
#self.metaStorage.updateBackend(backend.superBackend,
# startsection=[PARSERTAG+'_section_input_output_files'],
# autoopenclose=False)
self.secRestrictGIndex = backend.superBackend.openSection("section_restricted_uri")
restrictionsDict = get_updateDictionary(self, 'restrictions')
updateDict = {
'startSection' : [['section_restricted_uri']],
'dictionary' : restrictionsDict
}
self.metaStorageRestrict.update(updateDict)
self.metaStorageRestrict.updateBackend(backend.superBackend,
startsection=['section_restricted_uri'],
autoopenclose=False)
backend.superBackend.closeSection("section_restricted_uri", self.secRestrictGIndex)
def onOpen_section_method(self, backend, gIndex, section):
# keep track of the latest method section
......@@ -2610,7 +2661,6 @@ class CHARMMParser(SmartParser.ParserBase):
cntrlNameList=getList_MetaStrInDict(self.metaDicts['cntrl'])
filecntrlNameList=getList_MetaStrInDict(self.metaDicts['filecntrl'])
fileNameList=getList_MetaStrInDict(self.metaDicts['file'])
extraNameList=getList_MetaStrInDict(self.metaDicts['extra'])
self.enerOutputSubParsers = [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment