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-exciting-fairdi
Compare Revisions
4f08fd0ac2843c3a4763dfb567a3167fd118cb0a...d9091e62f3180d0d01abdcc75c552b185c6cc8fb
Commits (1)
Relaxed error handling on opening aux files.
· d9091e62
Markus Scheidgen
authored
Oct 01, 2020
d9091e62
Hide whitespace changes
Inline
Side-by-side
excitingparser/parser_exciting.py
View file @
d9091e62
...
...
@@ -317,7 +317,9 @@ class ExcitingParserContext(object):
self
.
bsetype
=
'RPA'
elif
dummyBse
==
'IP'
:
self
.
bsetype
=
'IP'
name
=
"EXCITON_BSE"
+
self
.
bsetype
+
'_SCR'
else
:
self
.
bsetype
=
'UNKNOWN'
name
=
'EXCITON_BSE%s_SCR'
%
self
.
bsetype
# nameEps = "EPSILON_BSE" + self.bsetype + '_SCR'
if
files
[
len
(
name
):
len
(
name
)
+
4
]
==
'full'
:
self
.
screentype
=
'full'
...
...
@@ -370,37 +372,40 @@ class ExcitingParserContext(object):
loss
.
append
([[],[]])
# lossDummy.append([])
outputXSFile
=
os
.
path
.
join
(
dirPath
,
"EXCITON_BSE"
+
self
.
bsetype
+
'_SCR'
+
self
.
screentype
+
"_OC"
+
self
.
tensorComp
[
i
]
+
".OUT"
)
outputEpsFile
=
os
.
path
.
join
(
dirPath
,
"EPSILON_BSE"
+
self
.
bsetype
+
'_SCR'
+
self
.
screentype
+
"_OC"
+
self
.
tensorComp
[
i
]
+
".OUT"
)
outputSigmaFile
=
os
.
path
.
join
(
dirPath
,
"SIGMA_BSE"
+
self
.
bsetype
+
'_SCR'
+
self
.
screentype
+
"_OC"
+
self
.
tensorComp
[
i
]
+
".OUT"
)
outputLossFile
=
os
.
path
.
join
(
dirPath
,
"LOSS_BSE"
+
self
.
bsetype
+
'_SCR'
+
self
.
screentype
+
"_OC"
+
self
.
tensorComp
[
i
]
+
".OUT"
)
# - - - - -
try
:
with
open
(
outputXSFile
)
as
g
:
xsParser
=
exciting_parser_xs
.
XSParser
()
xsParser
.
parseExciton
(
outputXSFile
,
backend
,
excNum
,
excEn
,
excBindEn
,
osclStr
,
transCoeff
)
#, dftMethodSectionGindex = self.secMethodIndex,
except
FileNotFoundError
:
logger
.
warning
(
"File not found: {}"
.
format
(
outputXSFile
))
except
Exception
as
err
:
logger
.
error
(
"Exception on {}"
.
format
(
__file__
),
exc_info
=
err
)
# - - - - -
try
:
with
open
(
outputEpsFile
)
as
g
:
epsParser
=
exciting_parser_eps
.
EPSParser
()
epsParser
.
parseEpsilon
(
outputEpsFile
,
backend
,
epsEn
,
epsilon
)
#, dftMethodSectionGindex = self.secMethodIndex,
except
FileNotFoundError
:
logger
.
warning
(
"File not found: {}"
.
format
(
outputEpsFile
))
except
Exception
as
err
:
logger
.
error
(
"Exception on Exciting subparser"
,
exc_info
=
err
)
# - - - - -
try
:
with
open
(
outputSigmaFile
)
as
g
:
sigmaParser
=
exciting_parser_eps
.
EPSParser
()
sigmaParser
.
parseEpsilon
(
outputSigmaFile
,
backend
,
sigmaEn
,
sigma
)
#, dftMethodSectionGindex = self.secMethodIndex,
except
FileNotFoundError
:
logger
.
warning
(
"File not found: {}"
.
format
(
outputSigmaFile
))
outputXSFile
=
os
.
path
.
join
(
dirPath
,
"EXCITON_BSE"
+
self
.
bsetype
+
'_SCR'
+
self
.
screentype
+
"_OC"
+
self
.
tensorComp
[
i
]
+
".OUT"
)
outputEpsFile
=
os
.
path
.
join
(
dirPath
,
"EPSILON_BSE"
+
self
.
bsetype
+
'_SCR'
+
self
.
screentype
+
"_OC"
+
self
.
tensorComp
[
i
]
+
".OUT"
)
outputSigmaFile
=
os
.
path
.
join
(
dirPath
,
"SIGMA_BSE"
+
self
.
bsetype
+
'_SCR'
+
self
.
screentype
+
"_OC"
+
self
.
tensorComp
[
i
]
+
".OUT"
)
outputLossFile
=
os
.
path
.
join
(
dirPath
,
"LOSS_BSE"
+
self
.
bsetype
+
'_SCR'
+
self
.
screentype
+
"_OC"
+
self
.
tensorComp
[
i
]
+
".OUT"
)
# - - - - -
try
:
with
open
(
outputXSFile
)
as
g
:
xsParser
=
exciting_parser_xs
.
XSParser
()
xsParser
.
parseExciton
(
outputXSFile
,
backend
,
excNum
,
excEn
,
excBindEn
,
osclStr
,
transCoeff
)
#, dftMethodSectionGindex = self.secMethodIndex,
except
FileNotFoundError
:
logger
.
warning
(
"File not found: {}"
.
format
(
outputXSFile
))
except
Exception
as
err
:
logger
.
error
(
"Exception on {}"
.
format
(
__file__
),
exc_info
=
err
)
# - - - - -
try
:
with
open
(
outputEpsFile
)
as
g
:
epsParser
=
exciting_parser_eps
.
EPSParser
()
epsParser
.
parseEpsilon
(
outputEpsFile
,
backend
,
epsEn
,
epsilon
)
#, dftMethodSectionGindex = self.secMethodIndex,
except
FileNotFoundError
:
logger
.
warning
(
"File not found: {}"
.
format
(
outputEpsFile
))
except
Exception
as
err
:
logger
.
error
(
"Exception on Exciting subparser"
,
exc_info
=
err
)
# - - - - -
try
:
with
open
(
outputSigmaFile
)
as
g
:
sigmaParser
=
exciting_parser_eps
.
EPSParser
()
sigmaParser
.
parseEpsilon
(
outputSigmaFile
,
backend
,
sigmaEn
,
sigma
)
#, dftMethodSectionGindex = self.secMethodIndex,
except
FileNotFoundError
:
logger
.
warning
(
"File not found: {}"
.
format
(
outputSigmaFile
))
except
Exception
as
err
:
logger
.
error
(
"Exception on {}"
.
format
(
__file__
),
exc_info
=
err
)
except
Exception
as
err
:
logger
.
error
(
"
Exception
on {}"
.
format
(
__file__
),
exc_info
=
err
)
logger
.
error
(
'
Exception
while processing further outfiles.'
)
# with open(outputLossFile) as g:
...
...