Commit f6443458 authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Fixed missing optimade parameter in generated python code. #361

parent 9b078c7c
......@@ -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')
......
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