From fef98f3d45a490c8a029d4f945a0fa5eba332d9f Mon Sep 17 00:00:00 2001 From: Ghislain Vaillant Date: Tue, 17 Sep 2024 13:35:50 +0200 Subject: [PATCH] WIP: More type check fixes --- medkit/core/operation.py | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/medkit/core/operation.py b/medkit/core/operation.py index 29057a28..fffc3980 100644 --- a/medkit/core/operation.py +++ b/medkit/core/operation.py @@ -34,22 +34,15 @@ class Operation(abc.ABC): >>> super().__init__(**init_args) """ - uid: str - _description: OperationDescription | None = None _prov_tracer: ProvTracer | None = None @abc.abstractmethod def __init__(self, uid: str | None = None, name: str | None = None, **kwargs): - if uid is None: - uid = generate_id() - if name is None: - name = self.__class__.__name__ - - self.uid = uid + self.uid = uid or generate_id() self._description = OperationDescription( uid=self.uid, class_name=self.__class__.__name__, - name=name, + name=name or self.__class__.__name__, config=kwargs, ) @@ -68,9 +61,9 @@ def description(self) -> OperationDescription: """Contains all the operation init parameters.""" return self._description - def check_sanity(self) -> bool: # noqa: B027 + def check_sanity(self) -> None: # TODO: add some checks - pass + return class DocOperation(Operation):