Skip to content

Commit

Permalink
Add warning when accessing new molecules data
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason committed Jul 5, 2023
1 parent de162d5 commit da0f4df
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 @@ -293,6 +293,15 @@ def __exit__(self, exc_type, exc_val, exc_tb):
"""Support for "with" context."""
self.session.close()

def __getattribute__(self, attr):
if "molecules" in attr:
warnings.warn(
"NOTE: You are accessing a new set of molecules data to be officially released very soon. "
"This dataset includes many new properties, and is designed to be more easily expanded. "
"For the previous (legacy) molecules data, use the MPRester.legacy_jcesr rester. "
)
return super().__getattribute__(attr)

def __getattr__(self, attr):
if attr == "alloys":
raise MPRestError(
Expand Down

0 comments on commit da0f4df

Please sign in to comment.