-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: chemsys
parameter not returning all entries in chemsys
#918
Comments
I've found the issue, it's that in if isinstance(elements, str):
elements = elements.split("-")
elements_set = set(elements) # remove duplicate elements
all_chemsyses = []
for i in range(len(elements_set)):
for els in itertools.combinations(elements_set, i + 1):
all_chemsyses.append("-".join(sorted(els))) I think for consistency it would be best for this handling to be applied for all uses of |
The only issue is there needs to be a way to query for a single chemical system, and not just always query for what in this case turns out to be a list (e.g. ["Cd-Te", "Cd", "Te"]. Since the original rester class had the |
Ok! |
Of course the responsibility lies with MP to make sure documentation is correct, but adding a note that the public docs accept PRs too if there is ever a quick change to suggest that might help provide clarification for other users: https://github.com/materialsproject/public-docs I confess I would have also found this confusing. I suspect the underlying reason is because |
Have changed the language of the docstring. Feel free to submit a PR if you feel it isn't enough @kavanase. |
For reference, this was 801c05c |
Code snippet
What happened?
Related to the bug report in #859
Using the
chemsys
parameter in thesearch()
method (specifically formpr.materials.summary.search
here but this affects allBaseRester.search()
methods), not all entries in the specified chemical system are actually being returned.Correct behaviour with legacy API:
But with the new API and setting
chemsys = "Cd-Te"
, only Cd_xTe_y entries are returned, and not Cd or Te-only entries (which should also be returned):Can test this for other material systems too, by just comparing the returned docs from
summary.search(chemsys="X-Y")
with the output of searching "X-Y" on the Materials Project website.Version
v0.41.2
Which OS?
Log output
No response
The text was updated successfully, but these errors were encountered: