Skip to content

Clarify top level get_entries method #848

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions mp_api/client/mprester.py
Original file line number Diff line number Diff line change
Expand Up @@ -658,10 +658,10 @@ def get_entries(
additional_criteria: dict = None,
) -> list[ComputedStructureEntry]:
"""Get a list of ComputedEntries or ComputedStructureEntries corresponding
to a chemical system or formula.

Note that by default this returns mixed GGA/GGA+U entries. For others,
pass GGA/GGA+U/R2SCAN, or R2SCAN as thermo_types in additional_criteria.
to a chemical system or formula. This returns entries for all thermo types
represented in the database. Each type corresponds to a different mixing scheme
(i.e. GGA/GGA+U, GGA/GGA+U/R2SCAN, R2SCAN). By default the thermo_type of the
entry is also returned.

Args:
chemsys_formula_mpids (str, List[str]): A chemical system, list of chemical systems
Expand Down Expand Up @@ -717,7 +717,11 @@ def get_entries(

entries = []

fields = ["entries"] if not property_data else ["entries"] + property_data
fields = (
["entries", "thermo_type"]
if not property_data
else ["entries", "thermo_type"] + property_data
)

if sort_by_e_above_hull:
docs = self.thermo.search(
Expand Down