Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
parser-amber
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nomad-lab
parser-amber
Commits
4ac272a1
Commit
4ac272a1
authored
Apr 09, 2018
by
Berk Onat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding meta info for uri/file restrictions with section_restricted_uri
parent
06a9d552
Pipeline
#27065
passed with stage
in 6 minutes and 36 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
71 additions
and
1 deletion
+71
-1
parser/parser-amber/AMBERCommon.py
parser/parser-amber/AMBERCommon.py
+8
-0
parser/parser-amber/AMBERDictionary.py
parser/parser-amber/AMBERDictionary.py
+37
-0
parser/parser-amber/AMBERParser.py
parser/parser-amber/AMBERParser.py
+26
-1
No files found.
parser/parser-amber/AMBERCommon.py
View file @
4ac272a1
...
...
@@ -13,6 +13,12 @@ import json
import
os
import
re
PARSERNAME
=
"AMBER"
PROGRAMNAME
=
"amber"
PARSERVERSION
=
"0.0.3"
PARSERMETANAME
=
PARSERNAME
.
lower
()
PARSERTAG
=
'x_'
+
PARSERMETANAME
PARSER_INFO_DEFAULT
=
{
'name'
:
'amber-parser'
,
'version'
:
'0.0.1'
...
...
@@ -107,6 +113,7 @@ class AMBERParserBase(object):
def
__init__
(
self
,
cachingLevelForMetaName
=
None
,
coverageIgnoreList
=
None
,
re_program_name
=
None
):
self
.
metaStorage
=
mStore
.
Container
(
'section_run'
)
self
.
metaStorageRestrict
=
mStore
.
Container
(
'section_restricted_uri'
)
exclude_dict
=
{
'section_run'
:
[
'section_processor_info'
,
...
...
@@ -120,6 +127,7 @@ class AMBERParserBase(object):
META_INFO_PATH
)
self
.
metaStorage
.
build
(
jsonmetadata
,
'section_run'
,
exclude_dict
)
self
.
metaStorageRestrict
.
build
(
jsonmetadata
,
'section_restricted_uri'
,
exclude_dict
)
self
.
re_program_name
=
re_program_name
self
.
unitDict
=
get_unitDict
(
'si'
)
self
.
fileDict
=
get_fileListDict
()
...
...
parser/parser-amber/AMBERDictionary.py
View file @
4ac272a1
...
...
@@ -906,6 +906,41 @@ 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
,
activeSections
=
[
'section_restricted_uri'
]
),
'restricted_uri_files'
:
MetaInfoMap
(
startpage
,
subfunction
=
self
.
parameter_file_name
,
autoSections
=
True
,
activeSections
=
[
'section_restricted_uri'
]
),
'restricted_uri_license'
:
MetaInfoMap
(
startpage
,
value
=
'AMBER License'
,
autoSections
=
True
,
activeSections
=
[
'section_restricted_uri'
]
),
'restricted_uri_restriction'
:
MetaInfoMap
(
startpage
,
value
=
'any access'
,
autoSections
=
True
,
activeSections
=
[
'section_restricted_uri'
]
),
'restricted_uri_reason'
:
MetaInfoMap
(
startpage
,
value
=
'propriety license'
,
autoSections
=
True
,
activeSections
=
[
'section_restricted_uri'
]
),
'restricted_uri_issue_athority'
:
MetaInfoMap
(
startpage
,
value
=
'AMBER'
,
autoSections
=
True
,
activeSections
=
[
'section_restricted_uri'
]
),
}
# ------------------------------------------
# Definitions for section_frame_sequence
...
...
@@ -1227,6 +1262,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
==
'atom_type'
:
...
...
parser/parser-amber/AMBERParser.py
View file @
4ac272a1
...
...
@@ -8,6 +8,7 @@ from nomadcore.caching_backend import CachingLevel
from
nomadcore.simple_parser
import
mainFunction
,
ParsingContext
from
nomadcore.simple_parser
import
SimpleMatcher
as
SM
from
AMBERDictionary
import
set_excludeList
,
set_includeList
,
get_updateDictionary
,
getList_MetaStrInDict
,
getDict_MetaStrInDict
from
nomadcore.smart_parser.SmartParserDictionary
import
isMetaStrInDict
from
contextlib
import
contextmanager
import
AMBERCommon
as
AmberC
import
trajectory_reader
as
TrajRead
...
...
@@ -218,6 +219,20 @@ class AMBERParser(AmberC.AMBERParserBase):
#else:
# return False
def
parameter_file_name
(
self
,
itemdict
):
""" Function to generate data for parameter files list
"""
working_dir_name
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
self
.
fName
))
parmmeta
=
isMetaStrInDict
(
"PARM"
,
self
.
fileDict
)
filename
=
[]
if
parmmeta
is
not
None
:
if
self
.
fileDict
[
parmmeta
].
value
is
not
None
:
filename
.
append
(
self
.
fileDict
[
parmmeta
].
value
)
if
filename
:
return
False
,
filename
,
itemdict
else
:
return
False
,
None
,
itemdict
def
topology_to_dictionary
(
self
):
""" This function generates self.topologyDict dictionary
and converts/stores all the topology information
...
...
@@ -478,7 +493,17 @@ class AMBERParser(AmberC.AMBERParserBase):
self
.
metaStorage
.
updateBackend
(
backend
,
startsection
=
[
'section_sampling_method'
],
autoopenclose
=
False
)
#backend.closeSection("section_sampling_method", self.secSamplingGIndex)
self
.
secRestrictGIndex
=
backend
.
openSection
(
"section_restricted_uri"
)
section_restrictions_Dict
=
get_updateDictionary
(
self
,
'restrictions'
)
updateDict
=
{
'startSection'
:
[[
'section_restricted_uri'
]],
'dictionary'
:
section_restrictions_Dict
}
self
.
metaStorageRestrict
.
update
(
updateDict
)
self
.
metaStorageRestrict
.
updateBackend
(
backend
,
startsection
=
[
'section_restricted_uri'
],
autoopenclose
=
False
)
backend
.
closeSection
(
"section_restricted_uri"
,
self
.
secRestrictGIndex
)
def
onOpen_section_topology
(
self
,
backend
,
gIndex
,
section
):
# keep track of the latest topology description 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