Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
nomad-lab
nomad-FAIR
Commits
8eeeff89
Commit
8eeeff89
authored
May 10, 2021
by
Alvin Noe Ladines
Browse files
Implemented basic siesta parser
parent
d9bfce2a
Changes
4
Hide whitespace changes
Inline
Side-by-side
siesta
@
d8e29864
Compare
c9e2bd0c
...
d8e29864
Subproject commit
c9e2bd0c179e85d881594c68cc2c0d53f3e59bf4
Subproject commit
d8e2986420f101011eddf3571f5bd6d076f972fd
nomad/parsing/file_parser/basic_parser.py
View file @
8eeeff89
...
...
@@ -197,10 +197,12 @@ class BasicParser(FairdiParser):
if
'atom_labels'
in
key
:
val
=
get_value
(
value
,
r
'([A-Z][a-z]*)\s'
,
'atom_labels'
)
val
=
[
val
]
if
isinstance
(
val
,
str
)
else
val
set_value
(
sec_system
,
'atom_labels'
,
val
,
shape
=
(
len
(
val
)),
dtype
=
str
)
if
'atom_atom_number'
in
key
:
val
=
get_value
(
value
,
r
'(\d+)\s'
,
'atom_atom_number'
)
val
=
[
val
]
if
isinstance
(
val
,
str
)
else
val
set_value
(
sec_system
,
'atom_atom_number'
,
val
,
shape
=
(
len
(
val
)),
dtype
=
np
.
int32
)
set_value
(
sec_system
,
'atom_labels'
,
[
chemical_symbols
[
int
(
n
)]
for
n
in
sec_system
.
atom_atom_number
],
shape
=
(
len
(
val
)))
...
...
nomad/parsing/parsers.py
View file @
8eeeff89
...
...
@@ -65,6 +65,7 @@ from molcasparser import MolcasParser
from
mopacparser
import
MopacParser
from
namdparser
import
NAMDParser
from
onetepparser
import
OnetepParser
from
siestaparser
import
SiestaParser
try
:
# these packages are not available without parsing extra, which is ok, if the
...
...
@@ -190,13 +191,7 @@ parsers = [
mainfile_mime_re
=
r
'application/octet-stream'
),
GulpParser
(),
LegacyParser
(
name
=
'parsers/siesta'
,
code_name
=
'Siesta'
,
code_homepage
=
'https://departments.icmab.es/leem/siesta/'
,
parser_class_name
=
'siestaparser.SiestaParser'
,
mainfile_contents_re
=
(
r
'(Siesta Version: siesta-|SIESTA [0-9]\.[0-9]\.[0-9])|'
r
'(\*\s*WELCOME TO SIESTA\s*\*)'
)
),
SiestaParser
(),
ElkParser
(),
ElasticParser
(),
GamessParser
(),
...
...
tests/normalizing/test_system.py
View file @
8eeeff89
...
...
@@ -73,7 +73,8 @@ parser_exceptions = {
'parsers/band'
:
[
'dft.system'
],
'parsers/qbox'
:
[
'dft.xc_functional'
],
'parsers/cpmd'
:
[
'formula'
,
'dft.basis_set'
,
'dft.xc_functional'
,
'dft.system'
],
'parser/onetep'
:
[
'formula'
,
'dft.basis_set'
,
'dft.xc_functional'
,
'dft.system'
]
'parser/onetep'
:
[
'formula'
,
'dft.basis_set'
,
'dft.xc_functional'
,
'dft.system'
],
'parsers/siesta'
:
[
'dft.basis_set'
,
'dft.xc_functional'
,
'dft.system'
]
}
'''
Keys that the normalizer for certain parsers might not produce. In an ideal world this
...
...
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