create_full_molecule
- specatalog.helpers.full_entry.create_full_molecule(data, base_dir, molecular_formula_path, fmt)[source]
Create a complete molecule entry including database and file system operations.
The creation process is performed in an atomic manner with respect to the database. File system operations are first carried out in a temporary directory and are only committed to the final archive location after the database transaction has been completed successfully.
The following steps are executed: 1) Creation of the database entry 2) Creation of the measurement directory 3) Copying molecular structure file into the measurement directory
- Parameters:
data (molecule_model) – Molecule creation model containing all required metadata.
base_dir (Path) – Base directory of the measurement archive.
molecular_formula_path (Path) – Path to the molecular formula file without suffix.
fmt (str) – Suffix of the molecular formula file. E.g. “.pdf” or “.cdxml”
- Returns:
Result object indicating success or failure of the creation process. In case of success, the molecular ID is provided. In case of failure, the raised exception is included.
- Return type:
CreateMoleculeResult