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-cp2k
Commits
acc8eead
Commit
acc8eead
authored
Jun 20, 2016
by
Mohamed, Fawzi Roberto (fawzi)
Browse files
python3: futurize step1
parent
e00bb0ce
Changes
6
Hide whitespace changes
Inline
Side-by-side
parser/parser-cp2k/cp2kparser/scalainterface.py
View file @
acc8eead
...
@@ -2,8 +2,9 @@
...
@@ -2,8 +2,9 @@
This is the access point to the parser for the scala layer in the
This is the access point to the parser for the scala layer in the
nomad project.
nomad project.
"""
"""
from
__future__
import
absolute_import
import
sys
import
sys
import
setup_paths
from
.
import
setup_paths
from
nomadcore.parser_backend
import
JsonParseEventsWriterBackend
from
nomadcore.parser_backend
import
JsonParseEventsWriterBackend
from
cp2kparser
import
CP2KParser
from
cp2kparser
import
CP2KParser
...
...
parser/parser-cp2k/cp2kparser/tools/xmlpreparser.py
View file @
acc8eead
...
@@ -12,6 +12,7 @@ The actual calculation input contents can later be added to this object. Then
...
@@ -12,6 +12,7 @@ The actual calculation input contents can later be added to this object. Then
the object can be queried for the results, or the default values defined by the
the object can be queried for the results, or the default values defined by the
cp2k_input.xml.
cp2k_input.xml.
"""
"""
from
__future__
import
print_function
import
xml.etree.cElementTree
as
ET
import
xml.etree.cElementTree
as
ET
import
logging
import
logging
...
@@ -68,7 +69,7 @@ def recursive_tree_generation(xml_element, for_metainfo=False, name_stack=[], ig
...
@@ -68,7 +69,7 @@ def recursive_tree_generation(xml_element, for_metainfo=False, name_stack=[], ig
]
]
name
=
"/"
.
join
(
name_stack
)
name
=
"/"
.
join
(
name_stack
)
if
"/"
.
join
(
name_stack
)
in
kept_print_settings
:
if
"/"
.
join
(
name_stack
)
in
kept_print_settings
:
print
"KEPT {}"
.
format
(
name
)
print
(
"KEPT {}"
.
format
(
name
)
)
ignore
=
False
ignore
=
False
else
:
else
:
return
return
...
...
parser/parser-cp2k/cp2kparser/versions/cp2k262/commonmatcher.py
View file @
acc8eead
from
__future__
import
absolute_import
import
re
import
re
import
numpy
as
np
import
numpy
as
np
import
logging
import
logging
...
@@ -5,7 +6,7 @@ from nomadcore.simple_parser import SimpleMatcher as SM
...
@@ -5,7 +6,7 @@ from nomadcore.simple_parser import SimpleMatcher as SM
from
nomadcore.simple_parser
import
extractOnCloseTriggers
from
nomadcore.simple_parser
import
extractOnCloseTriggers
from
nomadcore.caching_backend
import
CachingLevel
from
nomadcore.caching_backend
import
CachingLevel
from
nomadcore.unit_conversion.unit_conversion
import
convert_unit
from
nomadcore.unit_conversion.unit_conversion
import
convert_unit
from
inputparser
import
CP2KInputParser
from
.
inputparser
import
CP2KInputParser
logger
=
logging
.
getLogger
(
"nomad"
)
logger
=
logging
.
getLogger
(
"nomad"
)
...
...
parser/parser-cp2k/cp2kparser/versions/cp2k262/geooptparser.py
View file @
acc8eead
from
__future__
import
print_function
from
__future__
import
absolute_import
from
nomadcore.simple_parser
import
SimpleMatcher
as
SM
from
nomadcore.simple_parser
import
SimpleMatcher
as
SM
from
nomadcore.baseclasses
import
MainHierarchicalParser
from
nomadcore.baseclasses
import
MainHierarchicalParser
from
commonmatcher
import
CommonMatcher
from
.
commonmatcher
import
CommonMatcher
import
cp2kparser.generic.configurationreading
import
cp2kparser.generic.configurationreading
import
cp2kparser.generic.csvparsing
import
cp2kparser.generic.csvparsing
from
nomadcore.caching_backend
import
CachingLevel
from
nomadcore.caching_backend
import
CachingLevel
...
@@ -303,5 +305,5 @@ class CP2KGeoOptParser(MainHierarchicalParser):
...
@@ -303,5 +305,5 @@ class CP2KGeoOptParser(MainHierarchicalParser):
def
debug
(
self
):
def
debug
(
self
):
def
wrapper
(
parser
):
def
wrapper
(
parser
):
print
"DEBUG"
print
(
"DEBUG"
)
return
wrapper
return
wrapper
parser/parser-cp2k/cp2kparser/versions/cp2k262/mdparser.py
View file @
acc8eead
from
__future__
import
absolute_import
import
numpy
as
np
import
numpy
as
np
from
nomadcore.simple_parser
import
SimpleMatcher
as
SM
from
nomadcore.simple_parser
import
SimpleMatcher
as
SM
from
nomadcore.baseclasses
import
MainHierarchicalParser
from
nomadcore.baseclasses
import
MainHierarchicalParser
from
commonmatcher
import
CommonMatcher
from
.
commonmatcher
import
CommonMatcher
import
cp2kparser.generic.configurationreading
import
cp2kparser.generic.configurationreading
import
cp2kparser.generic.csvparsing
import
cp2kparser.generic.csvparsing
from
nomadcore.caching_backend
import
CachingLevel
from
nomadcore.caching_backend
import
CachingLevel
...
@@ -296,7 +297,7 @@ class CP2KMDParser(MainHierarchicalParser):
...
@@ -296,7 +297,7 @@ class CP2KMDParser(MainHierarchicalParser):
# Energy file
# Energy file
if
self
.
energy_iterator
is
not
None
:
if
self
.
energy_iterator
is
not
None
:
if
(
i_step
+
1
)
%
freqs
[
"energies"
][
0
]
==
0
:
if
(
i_step
+
1
)
%
freqs
[
"energies"
][
0
]
==
0
:
line
=
self
.
energy_iterator
.
next
(
)
line
=
next
(
self
.
energy_iterator
)
time
=
line
[
1
]
time
=
line
[
1
]
kinetic_energy
=
line
[
2
]
kinetic_energy
=
line
[
2
]
...
@@ -317,7 +318,7 @@ class CP2KMDParser(MainHierarchicalParser):
...
@@ -317,7 +318,7 @@ class CP2KMDParser(MainHierarchicalParser):
# Cell file
# Cell file
if
self
.
cell_iterator
is
not
None
:
if
self
.
cell_iterator
is
not
None
:
if
(
i_step
+
1
)
%
freqs
[
"cell"
][
0
]
==
0
:
if
(
i_step
+
1
)
%
freqs
[
"cell"
][
0
]
==
0
:
line
=
self
.
cell_iterator
.
next
(
)
line
=
next
(
self
.
cell_iterator
)
cell
=
np
.
reshape
(
line
,
(
3
,
3
))
cell
=
np
.
reshape
(
line
,
(
3
,
3
))
self
.
cache_service
[
"simulation_cell"
]
=
cell
self
.
cache_service
[
"simulation_cell"
]
=
cell
...
...
parser/parser-cp2k/cp2kparser/versions/cp2k262/singlepointparser.py
View file @
acc8eead
from
__future__
import
absolute_import
from
nomadcore.simple_parser
import
SimpleMatcher
as
SM
from
nomadcore.simple_parser
import
SimpleMatcher
as
SM
from
nomadcore.baseclasses
import
MainHierarchicalParser
from
nomadcore.baseclasses
import
MainHierarchicalParser
from
singlepointforceparser
import
CP2KSinglePointForceParser
from
.
singlepointforceparser
import
CP2KSinglePointForceParser
from
nomadcore.caching_backend
import
CachingLevel
from
nomadcore.caching_backend
import
CachingLevel
from
commonmatcher
import
CommonMatcher
from
.
commonmatcher
import
CommonMatcher
import
logging
import
logging
logger
=
logging
.
getLogger
(
"nomad"
)
logger
=
logging
.
getLogger
(
"nomad"
)
...
...
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