Skip to content

Commit

Permalink
hotfix: parameters attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
maxim-v4s committed Aug 8, 2024
1 parent 02c6115 commit 0e101e6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions qualibrate/q_runnnable.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand All @@ -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
4 changes: 2 additions & 2 deletions qualibrate/qualibration_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 0e101e6

Please sign in to comment.