From b4f4de58406c9932a79be1b66cded17afdd7ba7e Mon Sep 17 00:00:00 2001 From: Carlo Pignedoli Date: Sat, 16 Mar 2024 09:43:04 +0100 Subject: [PATCH] Use `orm.Dict.get_dict()` to get the Python dictionary (#211) In earlier versions of AiiDA (I guess <2.5) the `get()` method is not yet implemented for the `orm.Dict` object. To support a wider range of AiiDA versions, we convert an `omr.Dict` to the regular Python dictionary. --- aiida_cp2k/workchains/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aiida_cp2k/workchains/base.py b/aiida_cp2k/workchains/base.py index 1f26b78..3ed3cae 100644 --- a/aiida_cp2k/workchains/base.py +++ b/aiida_cp2k/workchains/base.py @@ -65,7 +65,7 @@ def results(self): trajectories = self._collect_all_trajetories() if trajectories: self.report("Work chain completed successfully, collecting all trajectories") - if self.ctx.inputs.parameters.get("GLOBAL", {}).get("RUN_TYPE") == "GEO_OPT": + if self.ctx.inputs.parameters.get_dict().get("GLOBAL", {}).get("RUN_TYPE") == "GEO_OPT": output_trajectory = utils.merge_trajectory_data_non_unique(*trajectories) else: output_trajectory = utils.merge_trajectory_data_unique(*trajectories)