From a78ac2feb16996c046783eaba4cc1f42de45c263 Mon Sep 17 00:00:00 2001 From: Patrick Huck Date: Fri, 6 Dec 2024 15:21:51 -0800 Subject: [PATCH] add jcesr warning --- mp_api/client/mprester.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mp_api/client/mprester.py b/mp_api/client/mprester.py index 37b2237e..76a5b384 100644 --- a/mp_api/client/mprester.py +++ b/mp_api/client/mprester.py @@ -396,6 +396,15 @@ def __getattr__(self, attr): f"{self.__class__.__name__!r} object has no attribute {attr!r}" ) + def __getattribute__(self, attr): + if "jcesr" in attr: + warnings.warn( + "NOTE: You are accessing the unmaintained legacy molecules data, " + "please use MPRester.molecules.summary." + ) + + return super().__getattribute__(attr) + def __dir__(self): return dir(MPRester) + self._deprecated_attributes + ["materials", "molecules"]