retrieve_structure_from_materials_project#, use_task_id=False, reset_magnetic_moments=False)[source]#

Retrieve a Structure from Materials Project.

This job is useful for constructing a Flow that always will retrieve the most up-to-date data at the time the Flow runs.

The retrieved Structure will change between subsequent Materials Project database releases as old calculation tasks are removed and new, better, calculation tasks (e.g. with more accurate lattice parameters) are added.

Using this job requires that the system where the job runs has a connection to the outside internet. It also requires the Materials Project API key to be set appropriately via an environment variable or otherwise. Consult the Materials Project API documentation for more information.

  • material_id_or_task_id (str) – The material_id or the task_id for the data record being retrieved.

  • use_task_id (bool) – If true, will request the Structure from the specific calculation task in Materials Project. Structures retrieved in this way should not change even between new Materials Project database releases.

  • reset_magnetic_moments (bool) – If true, will remove any magnetic moment information or magnetic ordering on the Structure. Typically, this will mean that the Structure will then be initialized as ferromagnetic by any child jobs.


A Response with the Structure object as the output, and also the database version and specific task_id corresponding to that Structure object also stored

Return type: