Skip to content

MPRester.get_entries_in_chemsys returns duplicate entries for repeated element queries #735

Closed
@mattmcdermott

Description

@mattmcdermott

If a user accidentally provides a repeated element when querying for entries in a chemical system, then the current behavior of the MPRester.get_entries_in_chemsys method returns duplicate entries. I ran into this in a real application when I was querying for a much larger system and had a duplicate element added.

with MPRester() as mpr:
    entries = mpr.get_entries_in_chemsys("Ti-Ti")

print(len(entries))
print(len(set(entries)))

returns:

20
10

I will open a PR to delete duplicate elements from the user's request, as I think this should be the default behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions