Skip to content

Commit b5885f4

Browse files
committed
tmp fix to make it work whatever mpi4py is
1 parent 704567f commit b5885f4

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

src/icoco/problem.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
from enum import Enum
1616
from typing import List, Tuple
1717

18-
from .utils import MPIComm, medcoupling # type: ignore
18+
# from .utils import MPIComm, medcoupling # type: ignore
19+
from .utils import medcoupling # type: ignore
1920
from .exception import NotImplementedMethod
2021
from .version import get_icoco_version, get_version_int
2122

@@ -114,7 +115,7 @@ def setDataFile(self, datafile: str) -> None:
114115
raise NotImplementedMethod(prob=f"{self.__class__.__module__}.{self.__class__.__name__}",
115116
method="setDataFile")
116117

117-
def setMPIComm(self, mpicomm: MPIComm) -> None:
118+
def setMPIComm(self, mpicomm: 'MPIComm') -> None: # noqa: F821
118119
"""(Optional) Provide the MPI communicator to be used by the code for parallel computations.
119120
120121
This method must be called before initialize(). The communicator should include all the

src/icoco/utils.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ class MEDCouplingField: # pylint: disable=too-few-public-methods
2626
"""dummy class for MEDCouplingField type hinting"""
2727

2828

29-
try:
30-
from mpi4py.MPI import Intracomm as MPIComm # type: ignore # pylint: disable=unused-import
31-
except ModuleNotFoundError: # pragma: no cover
32-
class MPIComm: # pylint: disable=too-few-public-methods
33-
"""Basic class for type hinting when mi4py is not available"""
29+
# try:
30+
# from mpi4py.MPI import Intracomm as MPIComm # type: ignore # pylint: disable=unused-import
31+
# except ModuleNotFoundError: # pragma: no cover
32+
# class MPIComm: # pylint: disable=too-few-public-methods
33+
# """Basic class for type hinting when mi4py is not available"""
3434

3535

3636
class ICoCoMethods: # pylint: disable=too-few-public-methods

0 commit comments

Comments
 (0)