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