From c93b927f45a69daa9577661cc57a6188da839654 Mon Sep 17 00:00:00 2001 From: Brian Guarraci Date: Thu, 14 Dec 2023 09:58:02 -0700 Subject: [PATCH] add NumpyEncoder attribution --- klongpy/ws/sys_fn_ws.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/klongpy/ws/sys_fn_ws.py b/klongpy/ws/sys_fn_ws.py index dac6708..b054fd8 100644 --- a/klongpy/ws/sys_fn_ws.py +++ b/klongpy/ws/sys_fn_ws.py @@ -32,6 +32,10 @@ class KGRemoteCloseConnectionException(KlongException): class NumpyEncoder(json.JSONEncoder): + """ + We need to translate NumPy objects into lists as needed: + https://stackoverflow.com/questions/26646362/numpy-array-is-not-json-serializable + """ def default(self, obj): if isinstance(obj, np.ndarray): return obj.tolist()