Skip to content

Commit

Permalink
chore: add abstract decorator
Browse files Browse the repository at this point in the history
Signed-off-by: ThibaultFy <[email protected]>
  • Loading branch information
ThibaultFy committed Feb 27, 2024
1 parent be54e97 commit 33cea1d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions substrafl/nodes/protocol.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from abc import abstractmethod
from typing import Any
from typing import List
from typing import Protocol
Expand All @@ -16,15 +17,19 @@ class TrainDataNodeProtocol(Protocol):
data_manager_key: str
data_sample_keys: List[str]

@abstractmethod
def init_states(self, *args, **kwargs) -> LocalStateRef:
pass

@abstractmethod
def update_states(self, operation: RemoteDataOperation, *args, **kwargs) -> (LocalStateRef, Any):
pass

@abstractmethod
def register_operations(self, client: substra.Client, *args, **kwargs) -> Any:
pass

@abstractmethod
def summary(self) -> dict:
pass

Expand All @@ -35,12 +40,15 @@ class TestDataNodeProtocol(Protocol):
data_manager_key: str
data_sample_keys: List[str]

@abstractmethod
def update_states(self, operation: RemoteDataOperation, *args, **kwargs) -> None:
pass

@abstractmethod
def register_operations(self, client: substra.Client, *args, **kwargs) -> Any:
pass

@abstractmethod
def summary(self) -> dict:
pass

Expand All @@ -49,11 +57,14 @@ def summary(self) -> dict:
class AggregationNodeProtocol(Protocol):
organization_id: str

@abstractmethod
def update_states(self, operation: RemoteOperation, *args, **kwargs) -> Any:
pass

@abstractmethod
def register_operations(self, client: substra.Client, *args, **kwargs) -> Any:
pass

@abstractmethod
def summary(self) -> dict:
pass

0 comments on commit 33cea1d

Please sign in to comment.