From ad0bd95148e801084084f0e153b58516766c9635 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 | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/medkit/core/operation.py b/medkit/core/operation.py index 29057a28..6b0e6919 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 | generate_id() self._description = OperationDescription( uid=self.uid, class_name=self.__class__.__name__, - name=name, + name=name | self.__class__.__name__, config=kwargs, ) @@ -68,9 +61,10 @@ def description(self) -> OperationDescription: """Contains all the operation init parameters.""" return self._description - def check_sanity(self) -> bool: # noqa: B027 + @abc.abstractmethod + def check_sanity(self) -> bool: # TODO: add some checks - pass + ... class DocOperation(Operation):