From 4295a37744975331fbc5ce8b990dd93d327f0f11 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 1 Feb 2024 15:47:18 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- znframe/frame.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/znframe/frame.py b/znframe/frame.py index 8a52995..e4a4d61 100644 --- a/znframe/frame.py +++ b/znframe/frame.py @@ -183,7 +183,7 @@ def to_atoms(self) -> ase.Atoms: return atoms - def to_dict(self, built_in_types: bool = True, json_serializable = False) -> dict: + def to_dict(self, built_in_types: bool = True, json_serializable=False) -> dict: data = attrs.asdict(self, filter=lambda attr, _: attr.name != "recompute") if not built_in_types: data = _ndarray_to_list(data) @@ -222,7 +222,10 @@ def get_radius(value): def default_serializer(obj): for key, value in list(obj.items()): - if not isinstance(value, (int, float, str, list, dict, bool)) and value is not None: + if ( + not isinstance(value, (int, float, str, list, dict, bool)) + and value is not None + ): print("Warning: {} is not JSON serializable".format(type(value))) del obj[key] elif isinstance(value, dict):