smact.utils.crystal_space.download_compounds_with_mp_api module

smact.utils.crystal_space.download_compounds_with_mp_api module#

Utility functions for downloading compounds from the Materials Project.

smact.utils.crystal_space.download_compounds_with_mp_api.download_mp_data(mp_api_key: str | None = None, num_elements: int = 2, max_stoich: int = 8, save_dir: str | Path = 'data/binary/mp_api', request_interval: float = 0.1) → None[source]#

Downloads Materials Project data for all possible combinations of num_elements elements.

Uses elements with atomic numbers. When chemical formula is same, the one with lowest energy above hull is saved. The data is saved to a specified directory.

Parameters:
  • mp_api_key (str, optional) – the API key for Materials Project.

  • num_elements (int, optional) – the number of elements in each compound to consider. Defaults to 2.

  • max_stoich (int, optional) – the maximum integer of stoichiometric coefficient in chemical formula. Defaults to 8.

  • save_dir (str, optional) – the directory to save the downloaded data to. Defaults to “data/mp_api”.

  • request_interval (float, optional) – the time interval between API requests, in seconds. Defaults to 1.

Returns:

None