From 4377f11beb7d452fce1e9a4f5540f36c1e615c7a Mon Sep 17 00:00:00 2001 From: Jason Munro Date: Tue, 1 Feb 2022 14:47:36 -0800 Subject: [PATCH] Format endpoint in MPRester (#502) * Format endpoint in MPRester * Fix warning * Fix mypy * Fix warnings formatting * Fix whitespace --- src/mp_api/client.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mp_api/client.py b/src/mp_api/client.py index 77325142..62b07033 100644 --- a/src/mp_api/client.py +++ b/src/mp_api/client.py @@ -126,14 +126,18 @@ def __init__( try: self.contribs = Client(api_key) - except Exception: + except Exception as error: self.contribs = None + warnings.warn(f"Problem loading MPContribs client: {error}") self._all_resters = [] if notify_db_version: raise NotImplementedError("This has not yet been implemented.") + if not self.endpoint.endswith("/"): + self.endpoint += "/" + for cls in BaseRester.__subclasses__(): rester = cls(