From 16a3751c384311d5a1c7483ef0a8fd898975cf7a Mon Sep 17 00:00:00 2001 From: superstar54 Date: Sat, 14 Dec 2024 07:29:13 +0100 Subject: [PATCH] remove the calculator as it may not be JSON serializable --- src/aiida_pythonjob/data/atoms.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/aiida_pythonjob/data/atoms.py b/src/aiida_pythonjob/data/atoms.py index 262794d..946cde2 100644 --- a/src/aiida_pythonjob/data/atoms.py +++ b/src/aiida_pythonjob/data/atoms.py @@ -24,6 +24,9 @@ def __init__(self, value=None, **kwargs): @classmethod def atoms2dict(cls, atoms): + """Convert ASE Atoms to a dictionary.""" + # we remove the calculator as it may not be JSON serializable + atoms.calc = None data = atoms2dict(atoms) data.pop("unique_id") keys = list(data.keys())