Commit 483f138f authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Merge branch 'about' into 'v1.0.0'

About

See merge request !156
parents 07effaf8 47c6c415
Pipeline #80862 canceled with stages
in 12 seconds
......@@ -2,12 +2,13 @@ import React, { useContext, useLayoutEffect, useRef, useCallback, useEffect } fr
import {ReactComponent as AboutSvg} from './about.svg'
import PropTypes from 'prop-types'
import Markdown from './Markdown'
import { appBase, optimadeBase, apiBase, debug, consent } from '../config'
import { appBase, optimadeBase, apiBase, debug, consent, aitoolkitEnabled, encyclopediaEnabled } from '../config'
import { apiContext } from './api'
import packageJson from '../../package.json'
import { domains } from './domains'
import { Grid, Card, CardContent, Typography, makeStyles, Link } from '@material-ui/core'
import { Link as RouterLink, useHistory } from 'react-router-dom'
import tutorials from './aitoolkit/tutorials'
export const CodeList = () => {
const {info} = useContext(apiContext)
......@@ -97,10 +98,18 @@ export default function About() {
history.push('/upload')
})
makeClickable('encyclopedia', () => {
window.location.href = 'https://encyclopedia.nomad-coe.eu/gui/#/search'
if (encyclopediaEnabled) {
window.location.href = `${appBase}/encyclopedia`
} else {
window.location.href = 'https://encyclopedia.nomad-coe.eu/gui/#/search'
}
})
makeClickable('analytics', () => {
window.location.href = 'https://nomad-lab.eu/AItutorials'
makeClickable('toolkit', () => {
if (aitoolkitEnabled) {
history.push('/aitoolkit')
} else {
window.location.href = 'https://nomad-lab.eu/tools/AItutorials'
}
})
makeClickable('search', () => {
history.push('/search')
......@@ -109,6 +118,7 @@ export default function About() {
useEffect(() => {
const statistics = (info && info.statistics) || {}
statistics.n_tutorials = tutorials.tutorials.length
const value = (key, unit) => {
const nominal = statistics[key]
let stringValue = null
......@@ -117,8 +127,10 @@ export default function About() {
stringValue = Math.floor(nominal / 1.0e+9) + ' bln.'
} else if (nominal >= 1.0e+6) {
stringValue = Math.floor(nominal / 1.0e+6) + ' mln.'
} else {
} else if (nominal >= 1.0e+3) {
stringValue = Math.floor(nominal / 1.0e+3) + ' tsd.'
} else {
stringValue = nominal.toString()
}
return `${stringValue || '...'} ${unit}`
} else {
......@@ -133,6 +145,12 @@ export default function About() {
value('n_calculations', 'results'),
value('n_quantities', 'quantities')
])
setText('encStats', [
value('n_materials', 'materials')
])
setText('toolkitStats', [
value('n_tutorials', 'notebooks')
])
}, [svg, info, setText])
return <div className={classes.root}>
......
......@@ -39,7 +39,7 @@ import {matomo} from '../index'
import { useCookies } from 'react-cookie'
import Markdown from './Markdown'
import { help as metainfoHelp, MetainfoPage } from './archive/MetainfoBrowser'
import AnalyticsPage from './analytics/AnalyticsPage'
import AIToolkitPage from './aitoolkit/AIToolkitPage'
export const ScrollContext = React.createContext({scrollParentRef: null})
......@@ -279,9 +279,9 @@ function MainMenu() {
icon={<UserDataIcon/>}
/>
{!oasis && aitoolkitEnabled && <MainMenuItem
title="Analytics"
path="/analytics"
tooltip="NOMAD's analytics (AI) toolkit tutorial jupyter notebooks"
title="AI Toolkit"
path="/aitoolkit"
tooltip="NOMAD's Artificial Intelligence Toolkit tutorial jupyter notebooks"
icon={<AnalyticsIcon/>}
/>}
<MainMenuItem
......@@ -559,9 +559,9 @@ const routes = {
path: '/metainfo',
component: MetainfoPage
},
'analytics': {
path: '/analytics',
component: AnalyticsPage
'aitoolkit': {
path: '/aitoolkit',
component: AIToolkitPage
}
}
......
This diff is collapsed.
......@@ -41,7 +41,7 @@ const useStyles = makeStyles(theme => ({
}
}))
export default function AnalyticsPage() {
export default function AIToolkitPage() {
const classes = useStyles()
const [expanded, setExpanded] = useQueryParam('expanded', StringParam)
const [queryParameters, setQueryParameters] = useQueryParams({
......@@ -96,12 +96,12 @@ export default function AnalyticsPage() {
return <Grid container spacing={2} className={classes.root}>
<Grid item xs={12}>
<Markdown>{`
# NOMAD Analytics (AI) Toolkit
# NOMAD Artificial Intelligence Toolkit
We develop and implement methods that identify correlations and structure in big data
of materials. This will enable scientists and engineers to decide which materials are
useful for specific applications or which new materials should be the focus of future studies.
The following tutorials are designed to get started with the Analytics Toolkit.
The following tutorials are designed to get started with the AI Toolkit.
To log in directly, click [here](https://analytics-toolkit.nomad-coe.eu/hub).
`}</Markdown>
......
......@@ -50,6 +50,7 @@ statistics_info_model = api.model('StatisticsInfo', {
'n_uploads': fields.Integer(description='Number of uploads in NOMAD'),
'n_quantities': fields.Integer(description='Accumulated number of quantities over all entries in the Archive'),
'n_calculations': fields.Integer(description='Accumulated number of calculations, e.g. total energy calculations in the Archive'),
'n_materials': fields.Integer(description='Number of materials in NOMAD')
# TODO
# 'raw_file_size': fields.Integer(description='Total amount of raw files in TB'),
# 'archive_file_size': fields.Integer(description='Total amount of binary archive data in TB')
......
......@@ -513,6 +513,8 @@ class SearchRequest:
'global_statistics:n_calculations', A('sum', field='dft.n_calculations'))
self._search.aggs.metric(
'global_statistics:n_quantities', A('sum', field='dft.n_quantities'))
self._search.aggs.metric(
'global_statistics:n_materials', A('cardinality', field='encyclopedia.material.material_id'))
return self
......
Supports Markdown
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