Commit dee70bee authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Merge branch 'v0.9.1' into 'master'

V0.9.1

See merge request !189
parents 50ab2622 684b3bad
Pipeline #83359 passed with stages
in 49 seconds
Subproject commit 4f08fd0ac2843c3a4763dfb567a3167fd118cb0a
Subproject commit d9091e62f3180d0d01abdcc75c552b185c6cc8fb
{
"name": "nomad-fair-gui",
"version": "0.9.0",
"version": "0.9.1",
"commit": "e98694e",
"private": true,
"dependencies": {
......
......@@ -9,7 +9,7 @@ window.nomadEnv = {
'matomoUrl': 'https://nomad-lab.eu/fairdi/stat',
'matomoSiteId': '2',
'version': {
'label': '0.9.0',
'label': '0.9.1',
'isBeta': false,
'isTest': true,
'usesBetaData': true,
......
......@@ -40,11 +40,19 @@ export class ErrorHandler extends React.Component {
return this.props.children
}
}
ErrorHandler.propTypes = ({
children: PropTypes.object,
message: PropTypes.string, // Fixed error message. Provide either this or errorHandler
errorHandler: PropTypes.func, // Function that is called once an error is caught. It recveives the error object as argument and should return an error message as string.
classes: PropTypes.object,
className: PropTypes.string
})
export function ErrorCard({message, className, classes}) {
const useStyles = makeStyles((theme) => {
return {
root: {
color: theme.palette.error.main
},
content: {
paddingBottom: '16px'
......@@ -73,7 +81,7 @@ export function ErrorCard({message, className, classes}) {
<CardContent className={[style.content, style['content:last-child']].join(' ')}>
<Box className={style.container}>
<Error className={style.errorIcon}/>
<Typography className={style.title} color="textSecondary" gutterBottom>
<Typography className={style.title} color="error" gutterBottom>
{message}
</Typography>
</Box>
......@@ -86,11 +94,3 @@ ErrorCard.propTypes = ({
classes: PropTypes.object,
className: PropTypes.string
})
ErrorHandler.propTypes = ({
children: PropTypes.object,
message: PropTypes.string, // Fixed error message. Provide either this or errorHandler
errorHandler: PropTypes.func, // Function that is called once an error is caught. It recveives the error object as argument and should return an error message as string.
classes: PropTypes.object,
className: PropTypes.string
})
......@@ -400,6 +400,10 @@ function Overview({section, def}) {
let positionsOnly = false
// Do not attempt to perform visualization if size is too big
if (!section.atom_species) {
// the section is incomplete, we leave the overview empty
return ''
}
const nAtoms = section.atom_species.length
if (nAtoms >= 300) {
return <ErrorCard
......@@ -519,7 +523,9 @@ function Section({section, def}) {
const filter = config.showCodeSpecific ? def => true : def => !def.name.startsWith('x_')
return <Content>
<Title def={def} data={section} kindLabel="section" />
<Overview def={def} section={section}></Overview>
<ErrorHandler message="The section overview could not be rendered, due to an unexpected error.">
<Overview def={def} section={section}></Overview>
</ErrorHandler>
<Compartment title="sub sections">
{def.sub_sections
.filter(subSectionDef => section[subSectionDef.name] || config.showAllDefined)
......
......@@ -8,6 +8,7 @@ import ArrowRightIcon from '@material-ui/icons/ArrowRight'
import ArrowDownIcon from '@material-ui/icons/ArrowDropDown'
import classNames from 'classnames'
import { useLocation, useRouteMatch, Link } from 'react-router-dom'
import { ErrorHandler } from '../ErrorHandler'
export class Adaptor {
constructor(e) {
......@@ -124,6 +125,9 @@ const useLaneStyles = makeStyles(theme => ({
display: 'block',
height: '100%',
overflowY: 'scroll'
},
error: {
margin: theme.spacing(1)
}
}))
function Lane({lane}) {
......@@ -133,7 +137,9 @@ function Lane({lane}) {
return <div className={classes.root}>
<div className={classes.container}>
<laneContext.Provider value={lane}>
{adaptor.render()}
<ErrorHandler message='This section could not be rendered, due to an unexpected error.' className={classes.error}>
{adaptor.render()}
</ErrorHandler>
</laneContext.Provider>
</div>
</div>
......
......@@ -307,7 +307,10 @@ class ArchiveQueryResource(Resource):
upload_files = None
current_upload_id = None
required_with_references = compute_required_with_referenced(required)
archive_is_complete = required_with_references is not None
archive_is_complete = False
if required_with_references is not None:
archive_is_complete = True
required = required_with_references
for entry in calcs:
with_embargo = entry['with_embargo']
......@@ -340,7 +343,7 @@ class ArchiveQueryResource(Resource):
try:
partial_archive = upload_partial_archives[calc_id]
partial_archive = filter_archive(
required_with_references, partial_archive, transform=lambda e: e)
required, partial_archive, transform=lambda e: e)
data.append({
'calc_id': calc_id,
......
......@@ -270,7 +270,7 @@ datacite = NomadConfig(
)
meta = NomadConfig(
version='0.9.0',
version='0.9.1',
commit=gitinfo.commit,
release='devel',
default_domain='dft',
......
......@@ -15,6 +15,7 @@
import numpy as np
from nomad.normalizing.normalizer import Normalizer
from nomad.datamodel import EntryArchive
from nomad.datamodel.metainfo.public import Workflow, GeometryOptimization, Phonon, Elastic,\
MolecularDynamics
......@@ -344,10 +345,6 @@ class WorkflowNormalizer(Normalizer):
if self.section_run is None:
return
workflow = self.entry_archive.section_workflow
if not workflow:
workflow = self.entry_archive.m_create(Workflow)
workflow_type = None
if self.entry_archive.section_workflow:
workflow_type = self.entry_archive.section_workflow.workflow_type
......@@ -358,6 +355,10 @@ class WorkflowNormalizer(Normalizer):
if not workflow_type:
return
workflow = self.entry_archive.section_workflow
if not workflow:
workflow = self.entry_archive.m_create(Workflow)
workflow.workflow_type = workflow_type
if workflow.workflow_type == 'geometry_optimization':
......@@ -371,3 +372,7 @@ class WorkflowNormalizer(Normalizer):
elif workflow.workflow_type == 'molecular_dynamics':
MolecularDynamicsNormalizer(self.entry_archive).normalize()
# remove the section workflow again, if the parser/normalizer could not produce a result
if workflow.calculation_result_ref is None:
self.entry_archive.m_remove_sub_section(EntryArchive.section_workflow, -1)
apiVersion: v1
appVersion: "0.9.0"
appVersion: "0.9.1"
description: A Helm chart for Kubernetes that only runs nomad services and uses externally hosted databases.
name: nomad
version: 0.9.0
version: 0.9.1
## Default values for nomad@FAIRDI
version:
label: "0.9.0"
label: "0.9.1"
isTest: false
isBeta: false
usesBetaData: false
......
......@@ -27,6 +27,12 @@ def workflow_archive():
return _archive
def test_no_workflow(workflow_archive):
vasp_archive = workflow_archive(
'parsers/vaspoutcar', 'tests/data/parsers/vasp_outcar/OUTCAR')
assert vasp_archive.section_workflow is None
def test_geometry_optimization_workflow(workflow_archive):
vasp_archive = workflow_archive(
'parsers/vasp', 'tests/data/normalizers/workflow/vasp/vasprun.xml')
......
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