From ef36c01407aeccedbdfbbfa9f6ca0f8bb63d0efb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mose=20M=C3=BCller?= Date: Thu, 21 Dec 2023 10:30:59 +0100 Subject: [PATCH] updates serializer and state_manager to deal with serialized methods I need to get the access path from methods when generating the web_settings.json file. Thus, methods will not be skipped anymore, instead, the method checking if the attribute is loadable makes the distinction. --- src/pydase/data_service/state_manager.py | 3 +++ src/pydase/utils/serializer.py | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pydase/data_service/state_manager.py b/src/pydase/data_service/state_manager.py index b9c37c3..adc97c4 100644 --- a/src/pydase/data_service/state_manager.py +++ b/src/pydase/data_service/state_manager.py @@ -276,5 +276,8 @@ class StateManager: self.cache, full_access_path ) + if cached_serialization_dict["value"] == "method": + return False + # nested objects cannot be loaded return not serialized_dict_is_nested_object(cached_serialization_dict) diff --git a/src/pydase/utils/serializer.py b/src/pydase/utils/serializer.py index bbba9a7..07b2edf 100644 --- a/src/pydase/utils/serializer.py +++ b/src/pydase/utils/serializer.py @@ -363,9 +363,6 @@ def generate_serialized_data_paths( paths: list[str] = [] for key, value in data.items(): - if value["type"] == "method": - # ignoring methods - continue new_path = f"{parent_path}.{key}" if parent_path else key paths.append(new_path) if serialized_dict_is_nested_object(value):