From 3c52f5339178569f61f531fff4548d22b20daeb1 Mon Sep 17 00:00:00 2001 From: Matthew Horton Date: Tue, 26 Mar 2019 14:16:36 -0700 Subject: [PATCH] Update MPRester to warn if a non-standard endpoint is used --- pymatgen/ext/matproj.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pymatgen/ext/matproj.py b/pymatgen/ext/matproj.py index 380d31b1a3c..900ec8ac8d0 100644 --- a/pymatgen/ext/matproj.py +++ b/pymatgen/ext/matproj.py @@ -104,6 +104,10 @@ def __init__(self, api_key=None, endpoint=None): else: self.preamble = SETTINGS.get("PMG_MAPI_ENDPOINT", "https://materialsproject.org/rest/v2") + + if self.preamble != "https://materialsproject.org/rest/v2": + warnings.warn("Non-default endpoint used: {}".format(self.preamble)) + import requests if sys.version_info[0] < 3: try: