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
39ec6027
Commit
39ec6027
authored
Sep 14, 2020
by
Markus Scheidgen
Browse files
Merge tag 'v0.8.9' into v1.0.0
parents
b7094ba6
239a3bce
Pipeline
#82171
passed with stages
in 21 minutes and 52 seconds
Changes
8
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Dockerfile
View file @
39ec6027
...
...
@@ -79,7 +79,7 @@ RUN \
find /usr/local/lib/python3.7/site-packages/
-name
'*.so'
-print
-exec
sh
-c
'file "{}" | grep -q "not stripped" && strip -s "{}"'
\;
# Built the GUI in the gui build image
FROM
node:
latest
as
gui_build
FROM
node:
14.8
as
gui_build
RUN
mkdir
-p
/app
WORKDIR
/app
ENV
PATH /app/node_modules/.bin:$PATH
...
...
gui/src/components/Histogram.js
View file @
39ec6027
...
...
@@ -62,7 +62,7 @@ export default function Histogram({
})
{
onClick
=
onClick
||
(()
=>
null
)
data
=
data
||
[]
numberOfValues
=
numberOfValues
||
data
.
length
numberOfValues
=
(
numberOfValues
&&
Math
.
min
(
data
.
length
,
numberOfValues
))
||
data
.
length
getValueLabel
=
getValueLabel
||
(
value
=>
value
.
name
)
title
=
title
||
'
Histogram
'
...
...
@@ -80,16 +80,16 @@ export default function Histogram({
useEffect
(()
=>
{
// TODO add proper treatment of not processed on server side and processing
console
.
log
(
'
###
'
,
data
)
if
(
data
[
data
.
length
-
1
]
&&
data
[
data
.
length
-
1
].
key
===
'
not processed
'
)
{
if
(
data
[
data
.
length
-
2
].
key
===
'
unavailable
'
)
{
data
[
data
.
length
-
2
].
value
=
data
[
data
.
length
-
1
].
value
data
=
data
.
slice
(
0
,
data
.
length
-
1
)
numberOfValues
-=
1
}
}
for
(
let
i
=
data
.
length
;
i
<
numberOfValues
;
i
++
)
{
let
numberOfValuesToRender
=
numberOfValues
//
if (data[data.length - 1] && data[data.length - 1].key === 'not processed') {
//
if (data[data.length -
2].key === 'unavailable') {
//
data[data.length - 2].value
+
= data[data.length - 1].value
//
data
.pop(
)
//
numberOfValues
ToRender
-= 1
//
}
//
}
for
(
let
i
=
data
.
length
;
i
<
numberOfValues
ToRender
;
i
++
)
{
data
.
push
({
key
:
`empty
${
i
}
`
,
name
:
''
,
value
:
0
})
}
...
...
gui/src/components/domains.js
View file @
39ec6027
...
...
@@ -206,8 +206,7 @@ export const domains = ({
supportsSort
:
true
},
'
ems.chemical
'
:
{
label
:
'
Chemical
'
,
supportsSort
:
true
label
:
'
Material name
'
},
'
ems.method
'
:
{
label
:
'
Method
'
,
...
...
gui/src/components/ems/EMSEntryOverview.js
View file @
39ec6027
...
...
@@ -45,7 +45,7 @@ export default class EMSEntryOverview extends React.Component {
return
(
<
Quantity
column
>
<
Quantity
quantity
=
"
ems.experiment_summary
"
label
=
"
summary
"
{...
this
.
props
}
/
>
{
data
.
ems
.
experiment_summary
&&
<
Quantity
quantity
=
"
ems.experiment_summary
"
label
=
"
summary
"
{...
this
.
props
}
/>
}
{
this
.
state
.
previewBroken
?
data
.
ems
.
entry_repository_url
&&
<
Quantity
label
=
"
preview
"
{...
this
.
props
}
>
<
Typography
noWrap
>
...
...
@@ -64,13 +64,13 @@ export default class EMSEntryOverview extends React.Component {
:
''
}
<
/Quantity
>
<
Quantity
quantity
=
"
ems.method
"
label
=
"
experimental method
"
noWrap
{...
this
.
props
}
/
>
<
Quantity
quantity
=
"
ems.experiment_location
"
label
=
"
experiment location
"
noWrap
{...
this
.
props
}
/
>
{
data
.
ems
.
experiment_location
&&
<
Quantity
quantity
=
"
ems.experiment_location
"
label
=
"
experiment location
"
noWrap
{...
this
.
props
}
/>
}
<
Quantity
label
=
"
experiment or experiment publish date
"
{...
this
.
props
}
>
<
Typography
noWrap
>
{
(
ems
&&
ems
.
origin_time
&&
new
Date
(
ems
.
origin_time
).
toLocaleDateString
())
||
'
unavailable
'
}
<
/Typography
>
<
/Quantity
>
<
Quantity
label
=
"
data
"
{...
this
.
props
}
>
<
Quantity
label
=
"
data
source
"
{...
this
.
props
}
>
<
Typography
noWrap
>
<
Link
target
=
"
external
"
href
=
{
ems
.
entry_repository_url
}
>
{
ems
.
repository_url
}
<
/Link
>
<
/Typography
>
...
...
gui/src/components/entry/EntryQuery.js
View file @
39ec6027
import
React
from
'
react
'
import
PropTypes
from
'
prop-types
'
import
{
withStyles
,
Typography
}
from
'
@material-ui/core
'
import
{
withStyles
,
Typography
,
Link
}
from
'
@material-ui/core
'
import
{
compose
}
from
'
recompose
'
import
{
withApi
,
DoesNotExist
}
from
'
../api
'
import
{
withRouter
}
from
'
react-router
'
...
...
@@ -22,7 +22,8 @@ class EntryQuery extends React.Component {
}
static
defaultState
=
{
doesNotExist
:
false
doesNotExist
:
false
,
queryParams
:
null
}
state
=
{...
EntryQuery
.
defaultState
}
...
...
@@ -43,7 +44,7 @@ class EntryQuery extends React.Component {
}
}).
catch
(
error
=>
{
if
(
error
.
name
===
'
DoesNotExist
'
)
{
this
.
setState
({
doesNotExist
:
true
})
this
.
setState
({
doesNotExist
:
true
,
queryParams
:
queryParams
})
}
else
{
this
.
props
.
raiseError
(
error
)
}
...
...
@@ -63,12 +64,19 @@ class EntryQuery extends React.Component {
render
()
{
const
{
classes
,
api
}
=
this
.
props
const
{
doesNotExist
}
=
this
.
state
const
{
doesNotExist
,
queryParams
}
=
this
.
state
let
message
=
'
loading ...
'
if
(
doesNotExist
)
{
if
(
api
.
isLoggedIn
)
{
console
.
log
(
queryParams
)
if
(
queryParams
&&
queryParams
[
'
external_id
'
]
&&
queryParams
[
'
external_id
'
].
startsWith
(
'
mp-
'
))
{
message
=
<
React
.
Fragment
>
This
particular
calculation
<
Link
href
=
{
`https://materialsproject.org/tasks/
${
queryParams
[
'
external_id
'
]}
#`
}
>
{
queryParams
[
'
external_id
'
]}
<
/Link> has not yet been provided to NOMAD by the Materials Project
.
<
/React.Fragment
>
}
else
if
(
api
.
isLoggedIn
)
{
message
=
`
This URL points to an entry that either does not exist, or that you are not
authorized to see.`
...
...
gui/src/config.js
View file @
39ec6027
...
...
@@ -75,8 +75,8 @@ export const formatQuantity = (x) => {
}
export
function
normalizeDisplayValue
(
value
)
{
if
(
value
===
'
not processed
'
)
{
return
'
unavailable
'
}
//
if (value === 'not processed') {
//
return 'unavailable'
//
}
return
value
}
nomad/datamodel/dft.py
View file @
39ec6027
...
...
@@ -143,7 +143,9 @@ class DFTMetadata(MSection):
xc_functional
=
Quantity
(
type
=
str
,
default
=
'not processed'
,
description
=
'The libXC based xc functional classification used in the simulation.'
,
a_search
=
Search
(
statistic_values
=
list
(
xc_treatments
.
values
())
+
[
'unavailable'
,
'not processed'
]))
a_search
=
Search
(
statistic_values
=
list
(
xc_treatments
.
values
())
+
[
'unavailable'
,
'not processed'
],
statistic_size
=
100
))
xc_functional_names
=
Quantity
(
type
=
str
,
default
=
[],
shape
=
[
'*'
],
...
...
nomad/metainfo/search_extension.py
View file @
39ec6027
...
...
@@ -190,5 +190,6 @@ class Search(Elastic):
def
statistic_values
(
self
,
values
):
self
.
_statistic_values
=
values
if
self
.
_statistic_values
is
not
None
:
self
.
statistic_size
=
len
(
self
.
_statistic_values
)
if
self
.
statistic_fixed_size
is
None
:
self
.
statistic_size
=
len
(
self
.
_statistic_values
)
self
.
statistic_fixed_size
=
len
(
self
.
_statistic_values
)
Write
Preview
Supports
Markdown
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