From b7f20e88796fef91c97545fb702f048a0902a8b4 Mon Sep 17 00:00:00 2001 From: Aakash Ashok Naik <91958822+naik-aakash@users.noreply.github.com> Date: Thu, 18 Jul 2024 17:45:03 +0200 Subject: [PATCH] add additional fields as kwargs to PhononBSDOSDoc (#910) --- src/atomate2/common/schemas/phonons.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/atomate2/common/schemas/phonons.py b/src/atomate2/common/schemas/phonons.py index a594afa623..f05a89cd90 100644 --- a/src/atomate2/common/schemas/phonons.py +++ b/src/atomate2/common/schemas/phonons.py @@ -269,6 +269,7 @@ def from_forces_born( **kwargs: additional arguments """ + additional_fields = kwargs.get("additional_fields", {}) factor = get_factor(code) # This opens the opportunity to add support for other codes # that are supported by phonopy @@ -466,7 +467,7 @@ def from_forces_born( total_dft_energy / formula_units if total_dft_energy is not None else None ) - return cls.from_structure( + doc = cls.from_structure( structure=structure, meta_structure=structure, phonon_bandstructure=bs_symm_line, @@ -514,6 +515,8 @@ def from_forces_born( }, ) + return doc.model_copy(update=additional_fields) + @staticmethod def get_kpath( structure: Structure, kpath_scheme: str, symprec: float, **kpath_kwargs