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
normalizer-repo-tags
Commits
bc6bdbc3
Commit
bc6bdbc3
authored
Dec 06, 2017
by
Mohamed, Fawzi Roberto (fawzi)
Browse files
adding main file uri
parent
9a6d0b96
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/scala/eu/nomad_lab/normalizers/RepoTagsNormalizer.scala
View file @
bc6bdbc3
...
...
@@ -30,7 +30,9 @@ import eu.nomad_lab.h5.H5EagerScanner
import
eu.nomad_lab.h5.SectionH5
import
eu.nomad_lab.parsers.ExternalParserWrapper
import
eu.nomad_lab.JsonUtils
import
eu.nomad_lab.H5Lib
import
scala.collection.mutable.StringBuilder
import
util.control.NonFatal
object
RepoTagsNormalizer
extends
ExternalNormalizerGenerator
(
name
=
"RepoTagsNormalizer"
,
...
...
@@ -99,6 +101,19 @@ object RepoTagsNormalizer extends ExternalNormalizerGenerator(
val
nEnergyEvaluations
=
singleConfSections
.
lengthL
var
lastGeometry
:
Option
[
SectionH5
]
=
None
var
lastEnergy
:
Option
[
Double
]
=
None
val
cGroup
=
c
.
calculationGroup
val
mainFileUris
:
Seq
[
String
]
=
try
{
val
mainFileAttr
:
Long
=
H5Lib
.
attributeOpen
(
cGroup
,
attributeName
=
"mainFileUri"
,
attributeType
=
"C"
)
val
mainFiles
:
Array
[
String
]
=
H5Lib
.
attributeReadStr
(
mainFileAttr
)
H5Lib
.
attributeClose
(
mainFileAttr
)
mainFiles
.
toSeq
}
catch
{
case
NonFatal
(
e
)
=>
Seq
()
}
if
(
nEnergyEvaluations
>
0
)
{
val
lastEnergyEval
:
SectionH5
=
singleConfSections
(
nEnergyEvaluations
-
1
)
lastGeometry
=
lastEnergyEval
.
maybeValue
(
"single_configuration_calculation_to_system_ref"
).
map
(
_
.
longValue
)
match
{
...
...
@@ -118,6 +133,7 @@ object RepoTagsNormalizer extends ExternalNormalizerGenerator(
"electronic_structure_method": ${JsonUtils.normalizedStr(jn.JArray(electronicStructureMethods.map(jn.JString(_))(breakOut)))},
"section_single_confguration_calculation.length": ${nEnergyEvaluations},
"energy_total.last": ${lastEnergy.getOrElse("null")},
"main_file_uri": ${JsonUtils.normalizedStr(jn.JArray(mainFileUris.map(jn.JString(_))(breakOut)))},
"section_system.last": """
)
lastGeometry
match
{
case
None
=>
"null"
...
...
Write
Preview
Supports
Markdown
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