Open shyuep opened 11 months ago
The difference is that _search
can accept parameters defined by the raw API schema shown here. The arguments of search
are defined by us, and let us simplify how some of the querying is done for a more streamlined user experience. All of the parameters that can be passed are properly type hinted and documented in the docstring of search
for users to see. The intention is that people should just use search
.
Renaming _search
is definitely something we can do. Also happy to change things in the documentation, including the examples page to make things clearer. Are there any specific changes related to documenting the input arguments of search
you feel we should make?
I guess the basic question of what parameters can a method take? E.g. why does nelement not work with search
but works with _search
?
@munrojm @janosh
It is rather difficult to find examples on how to do most API queries. Getting to the API page requires multiple clicks on links and some of those links are circular.
Further, the difference between
search
and_search
is rather subtle. For instancempr.materials.search(nelements=2)
fails because nelements is apparently not a keyword, despite the documentation saying it is.But
mpr.materials._search(nelements=2)
inexplicably works._search
as the underlying method.search
._search
to something else, likequery
, or at least,search_advanced
.