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
7645b295
Commit
7645b295
authored
Apr 30, 2020
by
Lauri Himanen
Browse files
Fixed issue with selecting representative scc.
parent
5608c54b
Pipeline
#74140
passed with stages
in 33 minutes and 27 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nomad/normalizing/encyclopedia/encyclopedia.py
View file @
7645b295
...
...
@@ -260,7 +260,7 @@ class EncyclopediaNormalizer(Normalizer):
try
:
representative_scc_idx
=
self
.
section_run
.
m_cache
[
"representative_scc_idx"
]
representative_scc
=
self
.
section_run
.
section_single_configuration_calculation
[
representative_scc_idx
]
except
(
KeyError
,
IndexError
)
:
except
Exception
:
representative_scc
=
None
representative_scc_idx
=
None
...
...
nomad/normalizing/encyclopedia/properties.py
View file @
7645b295
...
...
@@ -116,7 +116,7 @@ class PropertiesNormalizer():
try
:
resolved_section
=
None
frame_sequences
=
self
.
backend
.
entry_archive
.
section_run
[
0
].
section_frame_sequence
for
frame_sequence
in
frame_sequences
:
for
frame_sequence
in
reversed
(
frame_sequences
)
:
thermodynamical_props
=
frame_sequence
.
section_thermodynamical_properties
for
thermodynamical_prop
in
thermodynamical_props
:
if
resolved_section
is
None
:
...
...
@@ -171,7 +171,7 @@ class PropertiesNormalizer():
return
representative_phonon_dos
=
None
for
dos
in
doses
:
for
dos
in
reversed
(
doses
)
:
kind
=
dos
.
dos_kind
energies
=
dos
.
dos_energies
values
=
dos
.
dos_values
...
...
nomad/normalizing/normalizer.py
View file @
7645b295
...
...
@@ -93,7 +93,6 @@ class SystemBasedNormalizer(Normalizer, metaclass=ABCMeta):
entry. The selection depends on the type of calculation.
'''
system
=
None
scc_idx
=
None
scc
=
None
# Try to find a frame sequence, only first found is considered
...
...
@@ -104,41 +103,36 @@ class SystemBasedNormalizer(Normalizer, metaclass=ABCMeta):
sampling_method
=
sec_sampling_method
.
sampling_method
frames
=
frame_seq
.
frame_sequence_local_frames_ref
if
sampling_method
==
"molecular_dynamics"
:
scc
=
frames
[
0
]
scc_idx
=
scc
.
m_parent_index
iscc
=
frames
[
0
]
else
:
scc
=
frames
[
-
1
]
scc_idx
=
scc
.
m_parent_index
system
=
scc
.
single_configuration_calculation_to_system_ref
if
system
is
None
:
frame_seqs
=
[]
iscc
=
frames
[
-
1
]
system
=
iscc
.
single_configuration_calculation_to_system_ref
if
system
is
not
None
:
scc
=
iscc
except
Exception
:
frame_seqs
=
[]
pass
# If no frame sequences detected, try to find valid scc by looping all
# available in reverse order until a valid one is found.
if
len
(
frame_seqs
)
==
0
:
if
system
is
None
:
try
:
sccs
=
self
.
section_run
.
section_single_configuration_calculation
for
scc
in
reversed
(
sccs
):
idx
=
scc
.
m_parent_index
isys
=
scc
.
single_configuration_calculation_to_system_ref
for
iscc
in
reversed
(
sccs
):
isys
=
iscc
.
single_configuration_calculation_to_system_ref
if
isys
is
not
None
:
scc_idx
=
idx
system
=
isys
scc
=
iscc
break
if
system
is
None
:
sccs
=
[]
except
Exception
:
sccs
=
[]
pass
# If no sccs exist, try to find systems
if
len
(
sccs
)
==
0
:
if
system
is
None
:
try
:
systems
=
self
.
section_run
.
section_system
system
=
systems
[
-
1
]
except
Exception
:
s
ccs
=
[]
s
ystem
=
None
if
system
is
None
:
self
.
logger
.
error
(
'no "representative" section system found'
)
...
...
@@ -148,7 +142,7 @@ class SystemBasedNormalizer(Normalizer, metaclass=ABCMeta):
)
if
scc
is
not
None
:
self
.
section_run
.
m_cache
[
"representative_scc_idx"
]
=
scc
_id
x
self
.
section_run
.
m_cache
[
"representative_scc_idx"
]
=
scc
.
m_parent_inde
x
if
system
is
not
None
:
self
.
section_run
.
m_cache
[
"representative_system_idx"
]
=
system
.
m_parent_index
...
...
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