mp_api.client.routes.molecules.thermo.MoleculesThermoRester¶
- class mp_api.client.routes.molecules.thermo.MoleculesThermoRester(api_key: str | None = None, endpoint: str = 'https://api.materialsproject.org/', include_user_agent: bool = True, session: requests.Session | None = None, s3_resource: Any | None = None, debug: bool = False, monty_decode: bool = True, use_document_model: bool = True, timeout: int = 20, headers: dict = None, mute_progress_bars: bool = False)[source]¶
Bases:
BaseRester
[MoleculeThermoDoc
]Args: api_key (str): A String API key for accessing the MaterialsProject REST interface. Please obtain your API key at https://www.materialsproject.org/dashboard. If this is None, the code will check if there is a “PMG_MAPI_KEY” setting. If so, it will use that environment variable. This makes easier for heavy users to simply add this environment variable to their setups and MPRester can then be called without any arguments. endpoint (str): Url of endpoint to access the MaterialsProject REST interface. Defaults to the standard Materials Project REST address at “https://api.materialsproject.org”, but can be changed to other urls implementing a similar interface. include_user_agent (bool): If True, will include a user agent with the HTTP request including information on pymatgen and system version making the API request. This helps MP support pymatgen users, and is similar to what most web browsers send with each page request. Set to False to disable the user agent. session: requests Session object with which to connect to the API, for advanced usage only. debug: if True, print the URL for every request monty_decode: Decode the data using monty into python objects use_document_model: If False, skip the creating the document model and return data as a dictionary. This can be simpler to work with but bypasses data validation and will not give auto-complete for available fields. timeout: Time in seconds to wait until a request timeout error is thrown headers (dict): Custom headers for localhost connections.
- __init__(api_key: str | None = None, endpoint: str = 'https://api.materialsproject.org/', include_user_agent: bool = True, session: requests.Session | None = None, s3_resource: Any | None = None, debug: bool = False, monty_decode: bool = True, use_document_model: bool = True, timeout: int = 20, headers: dict = None, mute_progress_bars: bool = False)¶
Args: api_key (str): A String API key for accessing the MaterialsProject REST interface. Please obtain your API key at https://www.materialsproject.org/dashboard. If this is None, the code will check if there is a “PMG_MAPI_KEY” setting. If so, it will use that environment variable. This makes easier for heavy users to simply add this environment variable to their setups and MPRester can then be called without any arguments. endpoint (str): Url of endpoint to access the MaterialsProject REST interface. Defaults to the standard Materials Project REST address at “https://api.materialsproject.org”, but can be changed to other urls implementing a similar interface. include_user_agent (bool): If True, will include a user agent with the HTTP request including information on pymatgen and system version making the API request. This helps MP support pymatgen users, and is similar to what most web browsers send with each page request. Set to False to disable the user agent. session: requests Session object with which to connect to the API, for advanced usage only. debug: if True, print the URL for every request monty_decode: Decode the data using monty into python objects use_document_model: If False, skip the creating the document model and return data as a dictionary. This can be simpler to work with but bypasses data validation and will not give auto-complete for available fields. timeout: Time in seconds to wait until a request timeout error is thrown headers (dict): Custom headers for localhost connections.
Methods
__init__
([api_key, endpoint, ...])Args: api_key (str): A String API key for accessing the MaterialsProject REST interface.
count
([criteria])Return a count of total documents.
get_data_by_id
(document_id[, fields])Query the endpoint for a single document.
search
([molecule_ids, property_ids, charge, ...])Query molecules thermo docs using a variety of search criteria.
Attributes
available_fields
primary_key
s3_resource
session
suffix
supports_versions
- document_model¶
alias of
MoleculeThermoDoc
- search(molecule_ids: MPculeID | list[MPculeID] | None = None, property_ids: str | list[str] | None = None, charge: int | None = None, spin_multiplicity: int | None = None, level_of_theory: str | None = None, solvent: str | None = None, lot_solvent: str | None = None, correction_level_of_theory: str | None = None, correction_solvent: str | None = None, correction_lot_solvent: str | None = None, combined_lot_solvent: str | None = None, electronic_energy: tuple[float, float] | None = None, zero_point_energy: tuple[float, float] | None = None, total_enthalpy: tuple[float, float] | None = None, total_entropy: tuple[float, float] | None = None, translational_enthalpy: tuple[float, float] | None = None, rotational_enthalpy: tuple[float, float] | None = None, vibrational_enthalpy: tuple[float, float] | None = None, translational_entropy: tuple[float, float] | None = None, rotational_entropy: tuple[float, float] | None = None, vibrational_entropy: tuple[float, float] | None = None, free_energy: tuple[float, float] | None = None, formula: str | list[str] | None = None, elements: list[str] | None = None, exclude_elements: list[str] | None = None, chemsys: str | list[str] | None = None, num_chunks: int | None = None, chunk_size: int = 1000, all_fields: bool = True, fields: list[str] | None = None)[source]¶
Query molecules thermo docs using a variety of search criteria.
- Parameters:
molecule_ids (MPculeID, List[MPculeID]) – List of Materials Project Molecule IDs (MPculeIDs) to return data for.
property_ids (str, List[str]) – List of property IDs to return data for.
charge (Tuple[int, int]) – Minimum and maximum charge for the molecule.
spin_multiplicity (Tuple[int, int]) – Minimum and maximum spin for the molecule.
level_of_theory (str) – Desired level of theory (e.g. “wB97X-V/def2-TZVPPD/SMD”)
solvent (str) – Desired solvent (e.g. “SOLVENT=WATER”)
lot_solvent (str) – Desired combination of level of theory and solvent (e.g. “wB97X-V/def2-TZVPPD/SMD(SOLVENT=THF)”)
correction_level_of_theory (str) – Desired correction level of theory (e.g. “wB97X-V/def2-TZVPPD/SMD”)
correction_solvent (str) – Desired correction solvent (e.g. “SOLVENT=WATER”)
correction_lot_solvent (str) – Desired correction combination of level of theory and solvent (e.g. “wB97X-V/def2-TZVPPD/SMD(SOLVENT=THF)”)
combined_lot_solvent (str) – Desired combination of level of theory and solvent including both main thermo calculation and single-point energy correction (e.g. “wB97X-D/def2-SVPD/VACUUM//wB97X-V/def2-TZVPPD/SMD(SOLVENT=THF)”)
electronic_energy (Tuple[float, float]) – Minimum and maximum electronic energy
zero_point_energy (Tuple[float, float]) – Minimum and maximum zero-point energy
total_enthalpy (Tuple[float, float]) – Minimum and maximum total enthalpy
total_entropy (Tuple[float, float]) – Minimum and maximum total entropy
translational_enthalpy (Tuple[float, float]) – Minimum and maximum translational enthalpy
rotational_enthalpy (Tuple[float, float]) – Minimum and maximum rotational enthalpy
vibrational_enthalpy (Tuple[float, float]) – Minimum and maximum vibrational enthalpy
translational_entropy (Tuple[float, float]) – Minimum and maximum translational enthalpy
rotational_entropy (Tuple[float, float]) – Minimum and maximum rotational enthalpy
vibrational_entropy (Tuple[float, float]) – Minimum and maximum vibrational enthalpy
free_energy (Tuple[float, float]) – Minimum and maximum free energy
formula (str, List[str]) – An alphabetical formula or list of formulas (e.g. “C2 Li2 O4”, [“C2 H4”, “C2 H6”]).
elements (List[str]) – A list of elements.
exclude_elements (List(str)) – List of elements to exclude.
chemsys (str, List[str]) – A chemical system, list of chemical systems (e.g., Li-C-O, [C-O-H-N, Li-N]), or single formula (e.g., C2 H4).
num_chunks (int) – Maximum number of chunks of data to yield. None will yield all possible.
chunk_size (int) – Number of data entries per chunk.
all_fields (bool) – Whether to return all fields in the document. Defaults to True.
fields (List[str]) – List of fields in MoleculeDoc to return data for. Default is “molecule_id”, “property_id”, “solvent”, “method”, “last_updated” if all_fields is False.
- Returns:
([MoleculeThermoDoc]) List of molecule thermo documents