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-orca
Commits
a9ff16e1
Commit
a9ff16e1
authored
Oct 16, 2016
by
Alarcon Villaseca, Sebastian (sebas81)
Browse files
fixing parsing, activating tests
parent
84bd4594
Changes
2
Hide whitespace changes
Inline
Side-by-side
parser/parser-orca/orca_parser.py
View file @
a9ff16e1
from
builtins
import
object
import
setup_paths
import
numpy
as
np
from
nomadcore.simple_parser
import
SimpleMatcher
,
mainFunction
from
nomadcore.local_meta_info
import
loadJsonFile
,
InfoKindEl
import
os
,
sys
,
json
,
logging
...
...
@@ -45,7 +46,7 @@ class OrcaContext(object):
pos
[:,
0
]
=
x
pos
[:,
1
]
=
y
pos
[:,
2
]
=
z
backend
.
addArrayValue
(
"atom_positions"
,
pos
)
backend
.
addArrayValue
s
(
"atom_positions"
,
pos
)
backend
.
addValue
(
"atom_labels"
,
value
[
"x_orca_atom_labels"
])
def
onClose_x_orca_final_geometry
(
self
,
backend
,
gIndex
,
value
):
...
...
@@ -56,7 +57,7 @@ class OrcaContext(object):
pos
[:,
0
]
=
x
pos
[:,
1
]
=
y
pos
[:,
2
]
=
z
backend
.
addArrayValue
(
"geometry_optimization_converged"
,
pos
)
backend
.
addArrayValue
s
(
"geometry_optimization_converged"
,
pos
)
backend
.
addValue
(
"atom_labels"
,
value
[
"x_orca_atom_labels_geo_opt"
])
# def onClose_x_orca_orbital_energies(self, backend, gIndex, value):
...
...
@@ -132,7 +133,7 @@ def buildSinglePointMatcher():
# Get atomic positions:
SM
(
name
=
'Atomic Coordinates'
,
startReStr
=
r
"CARTESIAN COORDINATES \(ANGSTROEM\)\s*"
,
sections
=
[
"x_orca_atom_positions"
],
sections
=
[
"x_orca_atom_positions"
,
"section_basis_set"
],
subMatchers
=
[
SM
(
r
"\s+(?P<x_orca_atom_labels>[a-zA-Z]+)\s+(?P<x_orca_atom_positions_x>[-+0-9.]+)\s+(?P<x_orca_atom_positions_y>[-+0-9.]+)\s+(?P<x_orca_atom_positions_z>[-+0-9.]+)"
,
repeats
=
True
)
]
...
...
@@ -239,7 +240,7 @@ def buildSinglePointMatcher():
# *****************************************************
SM
(
name
=
'Final step after convergence'
,
startReStr
=
r
"Setting up the final grid:"
,
sections
=
[
"section_scf_iteration"
],
sections
=
[
"section_scf_iteration"
,
"section_basis_set"
],
subMatchers
=
[
# Final DFT Grid generation:
SM
(
r
"\s+General Integration Accuracy\s+IntAcc\s*\.\.\.\s+(?P<x_orca_gral_integ_accuracy_final>[-+0-9.eEdD]+)"
),
...
...
src/test/scala/eu/nomad_lab/parsers/OrcaParserSpec.scala
View file @
a9ff16e1
...
...
@@ -5,10 +5,10 @@ import org.specs2.mutable.Specification
object
OrcaParserSpec
extends
Specification
{
"OrcaParserTest"
>>
{
"test with json-events"
>>
{
ParserRun
.
parse
(
OrcaParser
,
"parsers/orca/test/examples/"
,
"json-events"
)
must_==
ParseResult
.
ParseSuccess
ParserRun
.
parse
(
OrcaParser
,
"parsers/orca/test/examples/
output_files/orca3.2706823.out
"
,
"json-events"
)
must_==
ParseResult
.
ParseSuccess
}
"test with json"
>>
{
ParserRun
.
parse
(
OrcaParser
,
"parsers/orca/test/examples/"
,
"json"
)
must_==
ParseResult
.
ParseSuccess
ParserRun
.
parse
(
OrcaParser
,
"parsers/orca/test/examples/
output_files/orca3.2706823.out
"
,
"json"
)
must_==
ParseResult
.
ParseSuccess
}
}
}
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