|
58 | 58 | from mp_api.client.core.client import QueryBuilderWithCache |
59 | 59 | from mp_api.client.core.schemas import _DictLikeAccess |
60 | 60 |
|
61 | | -DEFAULT_THERMOTYPE_CRITERIA = {"thermo_types": ["GGA_GGA+U_R2SCAN"]} |
| 61 | +DEFAULT_THERMOTYPE = ThermoType("GGA_GGA+U_R2SCAN") |
| 62 | +DEFAULT_THERMOTYPE_CRITERIA = {"thermo_types": [DEFAULT_THERMOTYPE.value]} |
62 | 63 |
|
63 | 64 | RESTER_LAYOUT = { |
64 | 65 | "molecules/core": LazyImport( |
@@ -1069,8 +1070,8 @@ def get_entries_in_chemsys( |
1069 | 1070 | (i.e., all LixOy, FexOy, LixFey, LixFeyOz, Li, Fe and O phases). Extremely |
1070 | 1071 | useful for creating phase diagrams of entire chemical systems. |
1071 | 1072 |
|
1072 | | - Note that by default this returns mixed GGA/GGA+U entries. For others, |
1073 | | - pass GGA/GGA+U/R2SCAN, or R2SCAN as thermo_types in additional_criteria. |
| 1073 | + Note that by default this returns mixed GGA/GGA+U/r2SCAN entries. For others, |
| 1074 | + pass GGA/GGA+U, or R2SCAN as thermo_types in additional_criteria. |
1074 | 1075 |
|
1075 | 1076 | Args: |
1076 | 1077 | elements (str or [str]): Parent chemical system string comprising element |
@@ -1594,8 +1595,26 @@ def _get_cohesive_energy( |
1594 | 1595 | def get_stability( |
1595 | 1596 | self, |
1596 | 1597 | entries: list[ComputedEntry | ComputedStructureEntry | PDEntry], |
1597 | | - thermo_type: str | ThermoType = ThermoType.GGA_GGA_U, |
| 1598 | + thermo_type: str | ThermoType = DEFAULT_THERMOTYPE, |
1598 | 1599 | ) -> list[dict[str, Any]] | None: |
| 1600 | + """Get the energy above hull of a list of entries. |
| 1601 | +
|
| 1602 | + Args: |
| 1603 | + entries (list of ComputedEntry or ComputedStructureEntry or PDEntry) : |
| 1604 | + List of entries with energy and composition information to compute |
| 1605 | + hull energies. |
| 1606 | + thermo_type (str or ThermoType) : The hull type to use. |
| 1607 | + Defaults to ThermoType.GGA_GGA_U_R2SCAN. |
| 1608 | +
|
| 1609 | + Returns: |
| 1610 | + list of dict: |
| 1611 | + { |
| 1612 | + "e_above_hull": float, # energy above the hull |
| 1613 | + "composition": dict[str,float], # composition as dict |
| 1614 | + "energy": float, # energy with mixing / corrections |
| 1615 | + "entry_id": str, # optional identifier |
| 1616 | + } |
| 1617 | + """ |
1599 | 1618 | chemsys: set[SpeciesLike] = { |
1600 | 1619 | ele for entry in entries for ele in entry.composition.elements |
1601 | 1620 | } |
@@ -1659,8 +1678,29 @@ def get_oxygen_evolution( |
1659 | 1678 | self, |
1660 | 1679 | material_id: str | MPID | AlphaID, |
1661 | 1680 | working_ion: str | Element, |
1662 | | - thermo_type: str | ThermoType = ThermoType.GGA_GGA_U, |
| 1681 | + thermo_type: str | ThermoType = DEFAULT_THERMOTYPE, |
1663 | 1682 | ) -> dict[str, np.ndarray]: |
| 1683 | + """Get the amount of O2 evolved at a range of temperatures. |
| 1684 | +
|
| 1685 | + Args: |
| 1686 | + material_id (str, MPID, or AlphaID) : identifier of the material to compute |
| 1687 | + working_ion (str or Element) : The working ion of the battery material |
| 1688 | + thermo_type (str or ThermoType) : The hull type to use. |
| 1689 | + Defaults to ThermoType.GGA_GGA_U_R2SCAN. |
| 1690 | +
|
| 1691 | + Returns: |
| 1692 | + dict of str to np.ndarray : |
| 1693 | + { |
| 1694 | + "mu": np.ndarray[float], # the chemical potential in eV/atom |
| 1695 | + "reaction": np.ndarray[str], # the redox reaction |
| 1696 | + "evolution": np.ndarray[float], # the number of O2 evolved in the redox, per formula unit |
| 1697 | + "temperature": np.ndarray[float], # the temperature in K |
| 1698 | + } |
| 1699 | +
|
| 1700 | + Raises: |
| 1701 | + ValueError : If no insertion electrode data for the combination of material_id |
| 1702 | + and working_ion could be found, or if the entry contains no oxygen. |
| 1703 | + """ |
1664 | 1704 | working_ion = ( |
1665 | 1705 | Element[working_ion] if isinstance(working_ion, str) else working_ion |
1666 | 1706 | ) |
|
0 commit comments