Commit add64443 authored by Lauri Himanen's avatar Lauri Himanen
Browse files

Fixed issue with handling completely missing SCCs.

parent f193e1c2
Pipeline #93153 passed with stages
in 61 minutes
......@@ -169,32 +169,34 @@ export default function DFTEntryOverview({data}) {
const section_run = archive.section_run[0]
let section_method = null
const sccs = section_run.section_single_configuration_calculation
for (let i = sccs.length - 1; i > -1; --i) {
const scc = sccs[i]
if (!e_dos && scc.section_dos) {
if (scc.section_dos[scc.section_dos.length - 1].dos_kind !== 'vibrational') {
e_dos = {
'section_system': scc.single_configuration_calculation_to_system_ref,
'section_method': scc.single_configuration_calculation_to_system_ref,
'section_dos': scc.section_dos[scc.section_dos.length - 1]
if (sccs) {
for (let i = sccs.length - 1; i > -1; --i) {
const scc = sccs[i]
if (!e_dos && scc.section_dos) {
if (scc.section_dos[scc.section_dos.length - 1].dos_kind !== 'vibrational') {
e_dos = {
'section_system': scc.single_configuration_calculation_to_system_ref,
'section_method': scc.single_configuration_calculation_to_system_ref,
'section_dos': scc.section_dos[scc.section_dos.length - 1]
}
}
}
}
if (!e_bs && scc.section_k_band) {
if (scc.section_k_band[scc.section_k_band.length - 1].band_structure_kind !== 'vibrational') {
e_bs = {
'section_system': scc.single_configuration_calculation_to_system_ref,
'section_method': scc.single_configuration_calculation_to_system_ref,
'section_k_band': scc.section_k_band[scc.section_k_band.length - 1]
if (!e_bs && scc.section_k_band) {
if (scc.section_k_band[scc.section_k_band.length - 1].band_structure_kind !== 'vibrational') {
e_bs = {
'section_system': scc.single_configuration_calculation_to_system_ref,
'section_method': scc.single_configuration_calculation_to_system_ref,
'section_k_band': scc.section_k_band[scc.section_k_band.length - 1]
}
}
}
}
if (section_method !== false) {
let iMethod = scc.single_configuration_to_calculation_method_ref
if (section_method === null) {
section_method = iMethod
} else if (iMethod !== section_method) {
section_method = false
if (section_method !== false) {
let iMethod = scc.single_configuration_to_calculation_method_ref
if (section_method === null) {
section_method = iMethod
} else if (iMethod !== section_method) {
section_method = false
}
}
}
}
......@@ -295,9 +297,17 @@ export default function DFTEntryOverview({data}) {
}
// Get method details. Any referenced core_setttings will also be taken
// into account
// into account. If there were no SCCs from which the method could be
// selected, simply select the last available method.
if (section_method) {
section_method = resolveRef(section_method, archive)
} else {
const methods = section_run.section_method
if (methods) {
section_method = methods[methods.length - 1]
}
}
if (section_method) {
const refs = section_method?.section_method_to_method_refs
if (refs) {
for (const ref of refs) {
......
......@@ -155,7 +155,6 @@ function GeoOptOverview({data, className, classes}) {
system={data.structures[0]}
aspectRatio={0.75}
options={{view: {fitMargin: 0.75}}}
positionsOnly={true}
positionsSubject={positionsSubject}
></Structure>
</Box>
......
......@@ -199,7 +199,7 @@ export const Structure = withErrorHandler(({
})
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [])
}, [positionsSubject])
const loadSystem = useCallback((system, refViewer) => {
// If the cell all zeroes, positions are assumed to be cartesian.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment