dara.schema module#

Pydantic document schemas for jobflow jobs.

pydantic model PhaseSearchDocument[source]#

Bases: BaseModel

Phase search document schema. This is used to store the results of a phase search job.

Show JSON schema
{
   "title": "PhaseSearchDocument",
   "type": "object",
   "properties": {
      "task_label": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": "phase_search",
         "description": "The name of the task.",
         "title": "Task Label"
      },
      "last_updated": {
         "description": "Timestamp of when the document was last updated.",
         "title": "Last Updated",
         "type": "string"
      },
      "results": {
         "default": null,
         "title": "Results"
      },
      "foms": {
         "anyOf": [
            {
               "items": {
                  "items": {
                     "items": {
                        "type": "number"
                     },
                     "type": "array"
                  },
                  "type": "array"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The FOMs of the results.",
         "title": "Foms"
      },
      "lattice_strains": {
         "anyOf": [
            {
               "items": {
                  "items": {
                     "items": {
                        "type": "number"
                     },
                     "type": "array"
                  },
                  "type": "array"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The lattice strains of the results.",
         "title": "Lattice Strains"
      },
      "missing_peaks": {
         "anyOf": [
            {
               "items": {
                  "items": {
                     "items": {
                        "type": "number"
                     },
                     "type": "array"
                  },
                  "type": "array"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The missing peaks of the results.",
         "title": "Missing Peaks"
      },
      "extra_peaks": {
         "anyOf": [
            {
               "items": {
                  "items": {
                     "items": {
                        "type": "number"
                     },
                     "type": "array"
                  },
                  "type": "array"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The extra peaks of the results.",
         "title": "Extra Peaks"
      },
      "final_result": {
         "default": null,
         "title": "Final Result"
      },
      "best_rwp": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The best (lowest) Rwp.",
         "title": "Best Rwp"
      },
      "xrd_data": {
         "description": "The input XRD data.",
         "properties": {
            "@class": {
               "enum": [
                  "XRDData"
               ],
               "type": "string"
            },
            "@module": {
               "enum": [
                  "dara.xrd"
               ],
               "type": "string"
            },
            "@version": {
               "type": "string"
            }
         },
         "required": [
            "@class",
            "@module"
         ],
         "title": "Xrd Data",
         "type": "object"
      },
      "input_cifs": {
         "anyOf": [
            {
               "items": {
                  "properties": {
                     "@class": {
                        "enum": [
                           "Cif"
                        ],
                        "type": "string"
                     },
                     "@module": {
                        "enum": [
                           "dara.cif"
                        ],
                        "type": "string"
                     },
                     "@version": {
                        "type": "string"
                     }
                  },
                  "required": [
                     "@class",
                     "@module"
                  ],
                  "type": "object"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The input CIFs.",
         "title": "Input Cifs"
      },
      "precursors": {
         "anyOf": [
            {
               "items": {
                  "type": "string"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The precursor formulas.",
         "title": "Precursors"
      },
      "phase_predictor": {
         "anyOf": [
            {
               "properties": {
                  "@class": {
                     "enum": [
                        "PhasePredictor"
                     ],
                     "type": "string"
                  },
                  "@module": {
                     "enum": [
                        "dara.prediction.core"
                     ],
                     "type": "string"
                  },
                  "@version": {
                     "type": "string"
                  }
               },
               "required": [
                  "@class",
                  "@module"
               ],
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The phase predictor.",
         "title": "Phase Predictor"
      },
      "predict_kwargs": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The kwargs for the phase predictor.",
         "title": "Predict Kwargs"
      },
      "search_kwargs": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The kwargs for the search.",
         "title": "Search Kwargs"
      },
      "final_refinement_params": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The final refinement parameters.",
         "title": "Final Refinement Params"
      },
      "run_final_refinement": {
         "default": null,
         "description": "Whether to run final refinement.",
         "title": "Run Final Refinement",
         "type": "boolean"
      },
      "cifs_folder_name": {
         "default": null,
         "description": "The name of the folder containing the CIFs.",
         "title": "Cifs Folder Name",
         "type": "string"
      },
      "grouped_phases": {
         "anyOf": [
            {
               "items": {
                  "items": {
                     "items": {
                        "maxItems": 2,
                        "minItems": 2,
                        "prefixItems": [
                           {
                              "properties": {
                                 "@class": {
                                    "enum": [
                                       "Composition"
                                    ],
                                    "type": "string"
                                 },
                                 "@module": {
                                    "enum": [
                                       "pymatgen.core.composition"
                                    ],
                                    "type": "string"
                                 },
                                 "@version": {
                                    "type": "string"
                                 }
                              },
                              "required": [
                                 "@class",
                                 "@module"
                              ],
                              "type": "object"
                           },
                           {
                              "items": {
                                 "type": "string"
                              },
                              "type": "array"
                           }
                        ],
                        "type": "array"
                     },
                     "type": "array"
                  },
                  "type": "array"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The groupped phases.",
         "title": "Grouped Phases"
      }
   },
   "required": [
      "xrd_data"
   ]
}

Fields:
field best_rwp: Optional[float] = None#

The best (lowest) Rwp.

field cifs_folder_name: str = None#

The name of the folder containing the CIFs.

field extra_peaks: Optional[list[list[list[float]]]] = None#

The extra peaks of the results.

field final_refinement_params: Optional[dict] = None#

The final refinement parameters.

field final_result: Optional[RefinementResult] = None#

The result of the re-refinement of the best result.

field foms: Optional[list[list[list[float]]]] = None#

The FOMs of the results.

field grouped_phases: Optional[list[list[list[tuple[Composition, list[str]]]]]] = None#

The groupped phases.

field input_cifs: Optional[list[Cif]] = None#

The input CIFs.

field last_updated: str [Optional]#

Timestamp of when the document was last updated.

field lattice_strains: Optional[list[list[list[float]]]] = None#

The lattice strains of the results.

field missing_peaks: Optional[list[list[list[float]]]] = None#

The missing peaks of the results.

field phase_predictor: Optional[PhasePredictor] = None#

The phase predictor.

field precursors: Optional[list[str]] = None#

The precursor formulas.

field predict_kwargs: Optional[dict] = None#

The kwargs for the phase predictor.

field results: Optional[list[tuple[Union[list[Cif], list[list[Cif]]], RefinementResult]]] = None#

The result of the refinement.

field run_final_refinement: bool = None#

Whether to run final refinement.

field search_kwargs: Optional[dict] = None#

The kwargs for the search.

field task_label: Optional[str] = 'phase_search'#

The name of the task.

field xrd_data: XRDData [Required]#

The input XRD data.

pydantic model RefinementDocument[source]#

Bases: BaseModel

Refinement document schema. This is used to store the results of a refinement job.

Show JSON schema
{
   "title": "RefinementDocument",
   "type": "object",
   "properties": {
      "task_label": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": "refine",
         "description": "The name of the task.",
         "title": "Task Label"
      },
      "last_updated": {
         "description": "Timestamp of when the document was last updated.",
         "title": "Last Updated",
         "type": "string"
      },
      "result": {
         "default": null,
         "title": "Result"
      },
      "rwp": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The Rwp of the refinement.",
         "title": "Rwp"
      },
      "xrd_data": {
         "description": "The input XRD data.",
         "properties": {
            "@class": {
               "enum": [
                  "XRDData"
               ],
               "type": "string"
            },
            "@module": {
               "enum": [
                  "dara.xrd"
               ],
               "type": "string"
            },
            "@version": {
               "type": "string"
            }
         },
         "required": [
            "@class",
            "@module"
         ],
         "title": "Xrd Data",
         "type": "object"
      },
      "refinement_params": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The refinement parameters.",
         "title": "Refinement Params"
      },
      "phase_params": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The phase parameters.",
         "title": "Phase Params"
      },
      "instrument_name": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The instrument name.",
         "title": "Instrument Name"
      }
   },
   "required": [
      "xrd_data"
   ]
}

Fields:
field instrument_name: Optional[str] = None#

The instrument name.

field last_updated: str [Optional]#

Timestamp of when the document was last updated.

field phase_params: Optional[dict] = None#

The phase parameters.

field refinement_params: Optional[dict] = None#

The refinement parameters.

field result: RefinementResult [Required]#

The result of the refinement.

field rwp: Optional[float] = None#

The Rwp of the refinement.

field task_label: Optional[str] = 'refine'#

The name of the task.

field xrd_data: XRDData [Required]#

The input XRD data.