From 0e101e60bec74f3fea5401e9a771e7c082e288cf Mon Sep 17 00:00:00 2001 From: Maxim V4S Date: Thu, 8 Aug 2024 18:10:53 +0300 Subject: [PATCH] hotfix: parameters attribute --- qualibrate/q_runnnable.py | 8 ++++---- qualibrate/qualibration_node.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/qualibrate/q_runnnable.py b/qualibrate/q_runnnable.py index f66959f..2e0fad5 100644 --- a/qualibrate/q_runnnable.py +++ b/qualibrate/q_runnnable.py @@ -43,7 +43,7 @@ def __init__( self.mode = self.__class__.mode.model_copy() self.filepath: Optional[Path] = None - self.__parameters: Optional[CreateParametersType] = None + self._parameters: Optional[CreateParametersType] = None @abstractmethod def serialize(self, **kwargs: Any) -> Mapping[str, Any]: @@ -64,11 +64,11 @@ def run( @property def parameters(self) -> Optional[CreateParametersType]: - return self.__parameters + return self._parameters @parameters.setter def parameters(self, new_parameters: CreateParametersType) -> None: - if self.mode.external and self.__parameters is not None: + if self.mode.external and self._parameters is not None: return self.parameters_class.model_validate(new_parameters.model_dump()) - self.__parameters = new_parameters + self._parameters = new_parameters diff --git a/qualibrate/qualibration_node.py b/qualibrate/qualibration_node.py index 582894e..f4f6c59 100644 --- a/qualibrate/qualibration_node.py +++ b/qualibrate/qualibration_node.py @@ -69,7 +69,7 @@ def __init__( self.description = description - self.__parameters: Optional[NodeCreateParametersType] = None + self._parameters: Optional[NodeCreateParametersType] = None self._state_updates: dict[str, Any] = {} self.results: dict[Any, Any] = {} self.machine = None @@ -143,7 +143,7 @@ def run( try: self.mode.external = True self.mode.interactive = True - self.__parameters = parameters + self._parameters = parameters # TODO: raise exception if node file isn't specified self.run_node_file(self.filepath) finally: