Dear all,
I’m trying the new API with the python client mp-api in Version: 0.29.7 (via poetry/pip)
When I look at the available fields:
with MPRester(api_token) as m:
fields = m.summary.available_fields
print(fields)
I get:
['builder_meta', 'nsites', 'elements', 'nelements', 'composition', ....]
However, when I try to use it:
with MPRester(api_token) as m:
docs = m.summary.search(nelements=1,
fields=['material_id',
'formula_pretty',
'elements']
)
I get:
TypeError Traceback (most recent call last)
Cell In [5], line 3
1 # get all materials with only one element
2 with MPRester(api_token) as m:
----> 3 docs = m.summary.search(nelements=1,
4 fields=['material_id',
5 'formula_pretty',
6 'elements']
7 )
TypeError: SummaryRester.search() got an unexpected keyword argument 'nelements'
It works if I do, e.g. the following (including nelements in the "fields")
with MPRester(api_token) as m:
docs = m.summary.search(elements=['Al'],
fields=['material_id',
'formula_pretty',
'elements',
'nelements']
Any suggestion what I might be doing wrong would be much appreciated.
many thanks