Skip to content

Commit

Permalink
Normalize imports to match other modules
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrm-nvidia committed Feb 6, 2025
1 parent 70063a0 commit e2b99ae
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion icp/python/src/triton_distributed/icp/event_plane.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def __init__(self, event_topic: Union[List[str], str]):
"Invalid event_topic string. Only alphanumeric characters, underscores, and hyphens are allowed."
)
event_topic = ".".join(event_topic)
super().__init__(event_topic=event_topic)
self.event_topic = event_topic

def __str__(self):
return self.event_topic
Expand Down
2 changes: 1 addition & 1 deletion icp/python/src/triton_distributed/icp/nats_event_plane.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import nats

from triton_distributed.icp import EventMetadata, EventTopic
from triton_distributed.icp.event_plane import EventMetadata, EventTopic


class NatsEventPlane:
Expand Down
8 changes: 6 additions & 2 deletions icp/tests/python/event_plane/test_basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,16 @@

import pytest

from triton_distributed.icp import EventMetadata, EventTopic, NatsEventPlane
from triton_distributed.icp.nats_event_plane import (
EventMetadata,
EventTopic,
NatsEventPlane,
)


class TestEventTopic:
def test_from_string(self):
topic_str = "level1.level2"
topic_str = "level1"
event_topic = EventTopic(topic_str)
assert event_topic.event_topic == topic_str

Expand Down
6 changes: 5 additions & 1 deletion icp/tests/python/event_plane/test_publish_subscribe.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@

import pytest

from triton_distributed.icp import EventMetadata, EventTopic, NatsEventPlane
from triton_distributed.icp.nats_event_plane import (
EventMetadata,
EventTopic,
NatsEventPlane,
)


@pytest.mark.asyncio
Expand Down
3 changes: 2 additions & 1 deletion icp/tests/python/event_plane/test_specific_subscriptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
from typing import List

import pytest
from python.event_plane.publisher_subscriber_utils import (

from .event_plane.publisher_subscriber_utils import (
check_recieved_events,
gather_published_events,
run_publishers,
Expand Down

0 comments on commit e2b99ae

Please sign in to comment.