Skip to content

Commit

Permalink
add jcesr warning
Browse files Browse the repository at this point in the history
  • Loading branch information
tschaume committed Dec 6, 2024
1 parent c06e864 commit a78ac2f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions mp_api/client/mprester.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand Down

0 comments on commit a78ac2f

Please sign in to comment.