API server error for some queries

Sorry, in an effort to better quantify large queries we’ve introduced a server side bug we’re resolving that affects queries that don’t turn up any results (we don’t have any data for a ternary Ge-Se-O compound currently). Here’s a snippet that works for me for the time being. This is essentially how the MPRester.get_entries_in_chemsys method works, by taking combinations of the elements and querying them individually.

import itertools
from pymatgen import MPRester
m = MPRester()

elements = ["Ge", "Se", "O"]
entries = []
for i in range(len(elements)):
    for combo in itertools.combinations(elements, i + 1):
        try:
            entries.extend(m.query({"elements": {"$all": combo}, "nelements": i+1}, 
                                    properties=["material_id","structure",
                                                "final_energy_per_atom"]))
        except:
            pass
1 Like