From 5e2b0004f201bcc8da46ccbc15caea602eea637c Mon Sep 17 00:00:00 2001 From: "Lori A. Burns" Date: Tue, 1 Oct 2024 02:07:09 -0400 Subject: [PATCH] np return_result dict --- qcelemental/models/v2/types.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/qcelemental/models/v2/types.py b/qcelemental/models/v2/types.py index 942203a8..27ecb31a 100644 --- a/qcelemental/models/v2/types.py +++ b/qcelemental/models/v2/types.py @@ -11,6 +11,17 @@ def generate_caster(dtype): def cast_to_np(v): + # for driver=properties + if isinstance(v, dict): + vv = {} + for key, val in v.items(): + try: + val = np.asarray(val, dtype=dtype) + except ValueError: + raise ValueError(f"Could not cast {val} to NumPy Array!") + vv[key] = val + return vv + try: v = np.asarray(v, dtype=dtype) except ValueError: