Skip to content
GitLab
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
25050c0b
Commit
25050c0b
authored
May 05, 2020
by
Markus Scheidgen
Browse files
Minor fixes.
parent
b2db06da
Pipeline
#74375
failed with stages
in 19 minutes and 18 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
examples/client.py
View file @
25050c0b
...
...
@@ -13,11 +13,11 @@ query = ArchiveQuery(
'atoms'
:
[
'O'
]
},
required
=
{
'section_run'
:
{
'section_single_configuration_calculation[
0
]'
:
{
'section_run
[0]
'
:
{
'section_single_configuration_calculation[
-2
]'
:
{
'energy_total'
:
'*'
},
'section_system[
0
]'
:
'*'
'section_system[
-2
]'
:
'*'
}
},
per_page
=
10
,
...
...
nomad/app/api/archive.py
View file @
25050c0b
...
...
@@ -217,7 +217,7 @@ _archive_query_model = api.inherit('ArchiveSearch', search_model, {
'query'
:
fields
.
Nested
(
query_model
,
description
=
'The query used to find the requested entries.'
,
skip_none
=
True
),
'required'
:
fields
.
Raw
(
description
=
'A dictionary that defines what archive data to retrive.'
),
'query_schema'
:
fields
.
Raw
(
description
=
'Deprecated, use required instead.'
),
'raise_errors'
:
fields
.
Boolean
(
description
=
'Return 40
1
on missing archives or 500 on other errors instead of skipping the entry.'
)
'raise_errors'
:
fields
.
Boolean
(
description
=
'Return 40
4
on missing archives or 500 on other errors instead of skipping the entry.'
)
})
...
...
@@ -259,7 +259,7 @@ class ArchiveQueryResource(Resource):
else
:
required
=
data_in
.
get
(
'query_schema'
,
'*'
)
raise_error
=
data_in
.
get
(
'raise_error'
,
Tru
e
)
raise_error
s
=
data_in
.
get
(
'raise_error
s
'
,
Fals
e
)
except
Exception
:
abort
(
400
,
message
=
'bad parameter types'
)
...
...
@@ -328,15 +328,15 @@ class ArchiveQueryResource(Resource):
except
ArchiveQueryError
as
e
:
abort
(
400
,
str
(
e
))
except
KeyError
:
if
raise_error
:
abort
(
40
1
,
'Archive for entry %s does not exist'
%
calc_id
)
if
raise_error
s
:
abort
(
40
4
,
'Archive for entry %s does not exist'
%
calc_id
)
# We simply skip this entry
pass
except
Restricted
:
# TODO in reality this should not happen
pass
except
Exception
as
e
:
if
raise_error
:
if
raise_error
s
:
raise
e
common
.
logger
(
str
(
e
),
exc_info
=
e
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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