Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
nomad-lab
parser-cp2k
Commits
b1ef5b11
Commit
b1ef5b11
authored
Jun 20, 2016
by
Lauri Himanen
Browse files
Added the program name and compilation host.
parent
62c3d6ad
Changes
2
Hide whitespace changes
Inline
Side-by-side
parser/parser-cp2k/cp2kparser/versions/cp2k262/commonmatcher.py
View file @
b1ef5b11
...
...
@@ -40,7 +40,7 @@ class CommonMatcher(object):
'x_cp2k_atoms'
:
CachingLevel
.
ForwardAndCache
,
'section_XC_functionals'
:
CachingLevel
.
ForwardAndCache
,
'self_interaction_correction_method'
:
CachingLevel
.
Cache
,
'x_cp2k_section_programinformation'
:
CachingLevel
.
ForwardAndCache
,
'x_cp2k_section_program
_
information'
:
CachingLevel
.
ForwardAndCache
,
'x_cp2k_section_quickstep_settings'
:
CachingLevel
.
ForwardAndCache
,
'x_cp2k_section_atomic_kind'
:
CachingLevel
.
ForwardAndCache
,
'x_cp2k_section_kind_basis_set'
:
CachingLevel
.
ForwardAndCache
,
...
...
@@ -92,15 +92,15 @@ class CommonMatcher(object):
]
),
SM
(
" CP2K\| version string:"
,
sections
=
[
'x_cp2k_section_programinformation'
],
sections
=
[
'x_cp2k_section_program
_
information'
],
forwardMatch
=
True
,
subMatchers
=
[
SM
(
" CP2K\| version string:\s+(?P<program_version>{})"
.
format
(
self
.
regex_eol
)),
SM
(
" CP2K\| source code revision number:\s+svn:(?P<x_cp2k_svn_revision>\d+)"
),
SM
(
" CP2K\| is freely available from{}"
.
format
(
self
.
regex_
word
)),
SM
(
" CP2K\| Program compiled at{}"
.
format
(
self
.
regex_
word
)),
SM
(
" CP2K\| Program compiled on{}"
.
format
(
self
.
regex_
word
)),
SM
(
" CP2K\| Program compiled for{}"
.
format
(
self
.
regex_
word
)),
SM
(
" CP2K\| is freely available from{}"
.
format
(
self
.
regex_
eol
)),
SM
(
" CP2K\| Program compiled at
\s+(?P<x_cp2k_program_compilation_datetime>
{}
)
"
.
format
(
self
.
regex_
eol
)),
SM
(
" CP2K\| Program compiled on
\s+(?P<program_compilation_host>
{}
)
"
.
format
(
self
.
regex_
eol
)),
SM
(
" CP2K\| Program compiled for{}"
.
format
(
self
.
regex_
eol
)),
SM
(
" CP2K\| Input file name\s+(?P<x_cp2k_input_filename>{})"
.
format
(
self
.
regex_eol
)),
]
),
...
...
@@ -346,6 +346,9 @@ class CommonMatcher(object):
except
:
pass
def
onClose_section_run
(
self
,
backend
,
gIndex
,
section
):
backend
.
addValue
(
"program_name"
,
"CP2K"
)
def
onClose_x_cp2k_section_quickstep_settings
(
self
,
backend
,
gIndex
,
section
):
backend
.
addValue
(
"program_basis_set_type"
,
"gaussian"
)
backend
.
addValue
(
"electronic_structure_method"
,
self
.
test_electronic_structure_method
)
...
...
@@ -383,7 +386,7 @@ class CommonMatcher(object):
backend
.
closeSection
(
"section_basis_set_atom_centered"
,
basisID
)
backend
.
closeSection
(
"section_method_atom_kind"
,
kindID
)
def
onClose_x_cp2k_section_programinformation
(
self
,
backend
,
gIndex
,
section
):
def
onClose_x_cp2k_section_program
_
information
(
self
,
backend
,
gIndex
,
section
):
input_file
=
section
.
get_latest_value
(
"x_cp2k_input_filename"
)
self
.
file_service
.
set_file_id
(
input_file
,
"input"
)
...
...
test/unittests/cp2k_2.6.2/run_tests.py
View file @
b1ef5b11
...
...
@@ -281,6 +281,14 @@ class TestEnergyForce(unittest.TestCase):
expected_result
=
convert_unit
(
np
.
array
(
-
32.2320848878
),
"hartree"
)
self
.
assertTrue
(
np
.
array_equal
(
result
[
0
],
expected_result
))
def
test_program_name
(
self
):
result
=
self
.
results
[
"program_name"
]
self
.
assertEqual
(
result
,
"CP2K"
)
def
test_program_compilation_host
(
self
):
result
=
self
.
results
[
"program_compilation_host"
]
self
.
assertEqual
(
result
,
"lenovo700"
)
def
test_scf_max_iteration
(
self
):
result
=
self
.
results
[
"scf_max_iteration"
]
self
.
assertEqual
(
result
,
300
)
...
...
@@ -1024,19 +1032,19 @@ if __name__ == '__main__':
suites
=
[]
# suites.append(unittest.TestLoader().loadTestsFromTestCase(TestErrors))
# suites.append(unittest.TestLoader().loadTestsFromTestCase(TestXCFunctional))
#
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestEnergyForce))
suites
.
append
(
unittest
.
TestLoader
().
loadTestsFromTestCase
(
TestStressTensorMethods
))
suites
.
append
(
unittest
.
TestLoader
().
loadTestsFromTestCase
(
TestSelfInteractionCorrectionMethod
))
suites
.
append
(
unittest
.
TestLoader
().
loadTestsFromTestCase
(
TestConfigurationPeriodicDimensions
))
suites
.
append
(
unittest
.
TestLoader
().
loadTestsFromTestCase
(
TestSCFConvergence
))
suites
.
append
(
unittest
.
TestLoader
().
loadTestsFromTestCase
(
TestForceFiles
))
suites
.
append
(
unittest
.
TestLoader
().
loadTestsFromTestCase
(
TestPreprocessor
))
suites
.
append
(
unittest
.
TestLoader
().
loadTestsFromTestCase
(
TestGeoOpt
))
suites
.
append
(
unittest
.
TestLoader
().
loadTestsFromTestCase
(
TestGeoOptTrajFormats
))
suites
.
append
(
unittest
.
TestLoader
().
loadTestsFromTestCase
(
TestGeoOptOptimizers
))
suites
.
append
(
unittest
.
TestLoader
().
loadTestsFromTestCase
(
TestGeoOptTrajectory
))
suites
.
append
(
unittest
.
TestLoader
().
loadTestsFromTestCase
(
TestMD
))
suites
.
append
(
unittest
.
TestLoader
().
loadTestsFromTestCase
(
TestMDEnsembles
))
suites
.
append
(
unittest
.
TestLoader
().
loadTestsFromTestCase
(
TestElectronicStructureMethod
))
suites
.
append
(
unittest
.
TestLoader
().
loadTestsFromTestCase
(
TestEnergyForce
))
#
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestStressTensorMethods))
#
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestSelfInteractionCorrectionMethod))
#
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestConfigurationPeriodicDimensions))
#
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestSCFConvergence))
#
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestForceFiles))
#
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestPreprocessor))
#
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestGeoOpt))
#
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestGeoOptTrajFormats))
#
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestGeoOptOptimizers))
#
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestGeoOptTrajectory))
#
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestMD))
#
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestMDEnsembles))
#
suites.append(unittest.TestLoader().loadTestsFromTestCase(TestElectronicStructureMethod))
alltests
=
unittest
.
TestSuite
(
suites
)
unittest
.
TextTestRunner
(
verbosity
=
0
).
run
(
alltests
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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