Querying phase diagram data

Hi, When I try to download data to construct the phase diagram by using the following query

data = MPRester(“my_api_key”).get_entries_in_chemsys([“Fe”, “P”, “O”], compatible_only=True)

It reports the following:


KeyError Traceback (most recent call last)
in
----> 1 data = MPRester(“DlBMToO6iyQfUv0N”).get_entries_in_chemsys([“Fe”, “P”, “O”], compatible_only=True)

~/anaconda3/lib/python3.8/site-packages/pymatgen/ext/matproj.py in get_entries_in_chemsys(self, elements, compatible_only, inc_structure, property_data, conventional_unit_cell)
709 all_chemsyses.append(’-’.join(sorted(els)))
710
–> 711 entries = self.get_entries({“chemsys”: {"$in": all_chemsyses}},
712 compatible_only=compatible_only,
713 inc_structure=inc_structure,

~/anaconda3/lib/python3.8/site-packages/pymatgen/ext/matproj.py in get_entries(self, chemsys_formula_id_criteria, compatible_only, inc_structure, property_data, conventional_unit_cell, sort_by_e_above_hull)
420 d[“potcar_symbols”] = [
421 "%s s" (d[“pseudo_potential”][“functional”], l)
–> 422 for l in d[“pseudo_potential”][“labels”]]
423 data = {“oxide_type”: d[“oxide_type”]}
424 if property_data:

KeyError: ‘labels’

It seems the labels are not as the key in the dictionary, but it works for next system like [“Hf”, “Ge”, “Te”]. Could you please provide some suggestions on this? Thanks.

1 Like

I have the same question,I dont know why

1 Like

This appears to be a bug in the latest updated on our server where it is not by default only querying valid materials. The result is you’re getting deprecated materials that fail in this way. We’re working on fixing this issue.

2 Likes

Thank you so much. Waiting for the fix.

This should be fixed now. Also, please reset your API key and don’t post it openly. It’s supposed to be a secret that you only use.

Thank you so much.

Thank you’