Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
nomad-lab
parser-gromos
Commits
d98e25e0
Commit
d98e25e0
authored
Apr 10, 2018
by
Berk Onat
Browse files
Adding restricted_uri info
parent
610e52ae
Pipeline
#27132
failed with stage
in 11 minutes and 1 second
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
parser/parser-gromos/GROMOSDictionary.py
View file @
d98e25e0
...
...
@@ -795,6 +795,49 @@ 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
=
'GROMOS 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
=
'GROMOS'
,
#autoSections=True,
activeInfo
=
True
,
activeSections
=
[
'section_restricted_uri'
]
),
}
# ------------------------------------------
# Definitions for section_frame_sequence
...
...
@@ -1427,6 +1470,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'
:
...
...
parser/parser-gromos/GROMOSParser.py
View file @
d98e25e0
...
...
@@ -269,8 +269,23 @@ class GROMOSParser(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
(
"structure"
,
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
gromos_input_output_files
(
self
,
backend
,
gIndex
,
section
):
"""Called with onClose_x_gromos_section_control_parameters to setup
topology and trajectory inputs/outputs
...
...
@@ -381,7 +396,7 @@ class GROMOSParser(SmartParser.ParserBase):
trajDone
=
True
self
.
newTraj
=
True
#
if atLeastOneFileExist:
if
atLeastOneFileExist
:
# updateDict = {
# 'startSection' : [[PARSERTAG+'_section_input_output_files']],
# 'dictionary' : self.fileDict
...
...
@@ -390,6 +405,17 @@ class GROMOSParser(SmartParser.ParserBase):
# 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
)
if
self
.
newTopo
:
if
topoDone
and
atLeastOneFileExist
:
...
...
@@ -554,6 +580,30 @@ class GROMOSParser(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
)
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment