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
f6443458
Commit
f6443458
authored
Jun 18, 2020
by
Markus Scheidgen
Browse files
Fixed missing optimade parameter in generated python code.
#361
parent
9b078c7c
Changes
1
Hide whitespace changes
Inline
Side-by-side
nomad/app/api/common.py
View file @
f6443458
...
...
@@ -336,18 +336,22 @@ def query_api_clientlib(**kwargs):
return
value
kwargs
=
{
query
=
{
key
:
normalize_value
(
key
,
value
)
for
key
,
value
in
kwargs
.
items
()
if
key
in
search
.
search_quantities
and
(
key
!=
'domain'
or
value
!=
config
.
meta
.
default_domain
)
}
for
key
in
[
'dft.optimade'
]:
if
key
in
kwargs
:
query
[
key
]
=
kwargs
[
key
]
out
=
io
.
StringIO
()
out
.
write
(
'from nomad import client, config
\n
'
)
out
.
write
(
'config.client.url =
\'
%s
\'\n
'
%
config
.
api_url
(
ssl
=
False
))
out
.
write
(
'results = client.query_archive(query={%s'
%
(
''
if
len
(
kwargs
)
==
0
else
'
\n
'
))
out
.
write
(
',
\n
'
.
join
([
'
\'
%s
\'
: %s'
%
(
key
,
pprint
.
pformat
(
value
,
compact
=
True
))
for
key
,
value
in
kwargs
.
items
()]))
for
key
,
value
in
query
.
items
()]))
out
.
write
(
'})
\n
'
)
out
.
write
(
'print(results)
\n
'
)
...
...
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