Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/utils/communication/comm_utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from enum import Enum
from utils.communication.grpc.main import GRPCCommunication
from typing import Any, Dict, List, Tuple, TYPE_CHECKING
from typing import Any, Dict, Union, List, Tuple, TYPE_CHECKING
# from utils.communication.mpi import MPICommUtils
# from mpi4py import MPI

Expand Down Expand Up @@ -54,7 +54,7 @@ def get_rank(self) -> int:
"Rank not implemented for communication type", self.comm_type
)

def send(self, dest: str | int | List[str | int], data: Any, tag: int = 0):
def send(self, dest: Union[str, int, List[Union[str, int]]], data: Any, tag: int = 0):
if isinstance(dest, list):
for d in dest:
self.comm.send(dest=int(d), data=data)
Expand Down
4 changes: 2 additions & 2 deletions src/utils/communication/interface.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from abc import ABC, abstractmethod
from typing import Any, List
from typing import Any, Union, List


class CommunicationInterface(ABC):
Expand All @@ -11,7 +11,7 @@ def initialize(self):
pass

@abstractmethod
def send(self, dest: str | int, data: Any):
def send(self, dest: Union[str, int], data: Any):
pass

@abstractmethod
Expand Down