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-siesta
Commits
6edd89b1
Commit
6edd89b1
authored
Jul 13, 2016
by
Ask Hjorth Larsen
Browse files
enable more tests and fix sections when parsing structure relaxations
parent
f3f4cfae
Changes
2
Hide whitespace changes
Inline
Side-by-side
parser/parser-siesta/main.py
View file @
6edd89b1
...
...
@@ -255,29 +255,25 @@ infoFileDescription = SM(
name
=
'name&version'
,
required
=
True
),
SM
(
r
'reinit: System Label:\s*\S*'
,
name
=
'syslabel'
,
forwardMatch
=
True
,
adHoc
=
context
.
set_label
),
SM
(
r
''
,
weak
=
True
,
forwardMatch
=
True
,
name
=
'system section'
,
sections
=
[
'section_system'
],
subMatchers
=
[
ArraySM
(
r
'siesta: Atomic coordinates \(Bohr\) and species'
,
r
'siesta:\s*\S+\s+\S+\s+\S+\s+\S+\s+\S+'
,
add_positions_and_labels
),
ArraySM
(
r
'siesta: Automatic unit cell vectors \(Ang\):'
,
r
'siesta:\s*\S+\s*\S+\s*\S+'
,
get_array
(
'simulation_cell'
,
float
,
1
,
4
,
unit
=
'angstrom'
))
]),
SM
(
r
'\s*Single-point calculation|\s*Begin \S+ opt\.'
,
name
=
'singleconfig'
,
repeats
=
True
,
# XXX some of the matchers should not be in single config calculation
sections
=
[
'section_single_configuration_calculation'
],
sections
=
[
'section_single_configuration_calculation'
,
'section_system'
],
subFlags
=
SM
.
SubFlags
.
Sequenced
,
subMatchers
=
[
SM
(
r
''
,
weak
=
True
,
forwardMatch
=
True
,
name
=
'system section'
,
subMatchers
=
[
ArraySM
(
r
'siesta: Atomic coordinates \(Bohr\) and species'
,
r
'siesta:\s*\S+\s+\S+\s+\S+\s+\S+\s+\S+'
,
add_positions_and_labels
),
ArraySM
(
r
'siesta: Automatic unit cell vectors \(Ang\):'
,
r
'siesta:\s*\S+\s*\S+\s*\S+'
,
get_array
(
'simulation_cell'
,
float
,
1
,
4
,
unit
=
'angstrom'
))
]),
ArraySM
(
r
'outcoor: Atomic coordinates \(Ang\):'
,
r
'\s*\S+\s*\S+\s*\S+'
,
get_array
(
'atom_positions'
,
float
,
0
,
3
,
unit
=
'angstrom'
)),
#ArraySM(r'outcell: Unit cell vectors \(Ang\):',
# r'\s*\S+\s*\S+\s*\S+',
# build_cell),
SM
(
r
'\s*scf:\s*iscf'
,
name
=
'scf'
,
required
=
True
),
SM
(
r
'SCF cycle converged after\s*%s\s*iterations'
%
integer
(
'number_of_scf_iterations'
),
name
=
'scf-iterations'
),
...
...
@@ -291,9 +287,6 @@ infoFileDescription = SM(
# that pertains only to the last one, basically eigs and occs.
# Therefore we read a bit past the last config and try to trigger
# this as appropriate.
#SM(r'outcoor: Relaxed atomic coordinates',
# adHoc=read_eigenvalues),
#])
SM
(
r
''
,
weak
=
True
,
name
=
'After singleconfigs'
,
subFlags
=
SM
.
SubFlags
.
Sequenced
,
subMatchers
=
[
...
...
src/test/scala/eu/nomad_lab/parsers/SiestaParserSpec.scala
View file @
6edd89b1
...
...
@@ -4,11 +4,35 @@ import org.specs2.mutable.Specification
object
SiestaParserSpec
extends
Specification
{
"SiestaParserTest"
>>
{
"test with json-events"
>>
{
"test
H2O
with json-events"
>>
{
ParserRun
.
parse
(
SiestaParser
,
"parsers/siesta/test/examples/H2O/out"
,
"json-events"
)
must_==
ParseResult
.
ParseSuccess
}
"test with json"
>>
{
"test
H2O
with json"
>>
{
ParserRun
.
parse
(
SiestaParser
,
"parsers/siesta/test/examples/H2O/out"
,
"json"
)
must_==
ParseResult
.
ParseSuccess
}
"test H2O-relax with json-events"
>>
{
ParserRun
.
parse
(
SiestaParser
,
"parsers/siesta/test/examples/H2O-relax/out"
,
"json-events"
)
must_==
ParseResult
.
ParseSuccess
}
"test H2O-relax with json"
>>
{
ParserRun
.
parse
(
SiestaParser
,
"parsers/siesta/test/examples/H2O-relax/out"
,
"json"
)
must_==
ParseResult
.
ParseSuccess
}
"test Al-bulk with json-events"
>>
{
ParserRun
.
parse
(
SiestaParser
,
"parsers/siesta/test/examples/Al-bulk/out"
,
"json-events"
)
must_==
ParseResult
.
ParseSuccess
}
"test Al-bulk with json"
>>
{
ParserRun
.
parse
(
SiestaParser
,
"parsers/siesta/test/examples/Al-bulk/out"
,
"json"
)
must_==
ParseResult
.
ParseSuccess
}
"test Al-slab with json-events"
>>
{
ParserRun
.
parse
(
SiestaParser
,
"parsers/siesta/test/examples/Al-slab/out"
,
"json-events"
)
must_==
ParseResult
.
ParseSuccess
}
"test Al-slab with json"
>>
{
ParserRun
.
parse
(
SiestaParser
,
"parsers/siesta/test/examples/Al-slab/out"
,
"json"
)
must_==
ParseResult
.
ParseSuccess
}
"test Fe with json-events"
>>
{
ParserRun
.
parse
(
SiestaParser
,
"parsers/siesta/test/examples/Fe/out"
,
"json-events"
)
must_==
ParseResult
.
ParseSuccess
}
"test Fe with json"
>>
{
ParserRun
.
parse
(
SiestaParser
,
"parsers/siesta/test/examples/Fe/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