Skip to content

Commit

Permalink
Fix API key in pmgrc.yaml file not being respected for new MPRester.
Browse files Browse the repository at this point in the history
  • Loading branch information
Shyue Ping Ong committed Sep 21, 2022
1 parent 85e4514 commit 60f0b67
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pymatgen/ext/matproj.py
Original file line number Diff line number Diff line change
Expand Up @@ -1771,6 +1771,7 @@ def __new__(cls, *args, **kwargs):

if api_key is None:
api_key = SETTINGS.get("PMG_MAPI_KEY", "")
kwargs["api_key"] = api_key

if not api_key:
raise ValueError("Please supply an API key. See https://materialsproject.org/api for details.")
Expand Down

0 comments on commit 60f0b67

Please sign in to comment.