Skip to content

Commit

Permalink
import & mypy fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ankona committed Aug 29, 2024
1 parent 8314caa commit add944f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def backend_channel(self) -> t.Optional[str]:
:returns: a stringified channel descriptor"""
if self.MLI_NOTIFY_CONSUMERS in self:
return self[self.MLI_NOTIFY_CONSUMERS]
return str(self[self.MLI_NOTIFY_CONSUMERS])
return None

@backend_channel.setter
Expand All @@ -125,7 +125,7 @@ def worker_queue(self) -> t.Optional[str]:
:returns: a stringified channel descriptor"""
if self.MLI_WORKER_QUEUE in self:
return self[self.MLI_WORKER_QUEUE]
return str(self[self.MLI_WORKER_QUEUE])
return None

@worker_queue.setter
Expand Down
3 changes: 0 additions & 3 deletions tests/dragon/test_featurestore.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@

import pytest

from smartsim._core.mli.comm.channel.dragonfli import DragonFLIChannel
from smartsim.error.errors import SmartSimError

dragon = pytest.importorskip("dragon")

from smartsim._core.mli.comm.channel.dragonchannel import DragonCommChannel
Expand Down
4 changes: 2 additions & 2 deletions tests/dragon/test_protoclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@

import pytest

dragon = pytest.importorskip("dragon")

from smartsim._core.mli.comm.channel.dragonfli import DragonFLIChannel
from smartsim._core.mli.infrastructure.storage.backbonefeaturestore import (
BackboneFeatureStore,
Expand All @@ -41,8 +43,6 @@
from smartsim.error.errors import SmartSimError
from smartsim.log import get_logger

dragon = pytest.importorskip("dragon")

# isort: off
from dragon import fli
from dragon.channels import Channel
Expand Down
15 changes: 5 additions & 10 deletions tests/dragon/test_worker_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,16 @@

import pytest

from smartsim._core.mli.comm.channel.dragonchannel import DragonCommChannel
from smartsim._core.mli.infrastructure.storage.backbonefeaturestore import (
BackboneFeatureStore,
)
from smartsim._core.mli.mli_schemas.tensor.tensor_capnp import OutputDescriptor

torch = pytest.importorskip("torch")
dragon = pytest.importorskip("dragon")

import base64
import multiprocessing as mp

from smartsim._core.mli.infrastructure.storage.backbonefeaturestore import (
BackboneFeatureStore,
)
from smartsim._core.mli.mli_schemas.tensor.tensor_capnp import OutputDescriptor

try:
mp.set_start_method("dragon")
except Exception:
Expand All @@ -56,7 +54,6 @@
from dragon.data.ddict.ddict import DDict
from dragon.mpbridge.queues import DragonQueue

from smartsim._core.mli.comm.channel.channel import CommChannelBase
from smartsim._core.mli.comm.channel.dragonfli import DragonFLIChannel
from smartsim._core.mli.infrastructure.control.workermanager import (
EnvironmentConfigLoader,
Expand All @@ -65,12 +62,10 @@
from smartsim._core.mli.infrastructure.storage.dragonfeaturestore import (
DragonFeatureStore,
)
from smartsim._core.mli.infrastructure.storage.featurestore import FeatureStore
from smartsim._core.mli.infrastructure.worker.torch_worker import TorchWorker
from smartsim._core.mli.message_handler import MessageHandler
from smartsim.log import get_logger

from .featurestore import FileSystemFeatureStore
from .utils.channel import FileSystemCommChannel

logger = get_logger(__name__)
Expand Down

0 comments on commit add944f

Please sign in to comment.