Skip to content

Commit 607f67c

Browse files
committed
Fix transport_mode handling to use config value instead of hardcoded IPC default
- Change _get_publisher signature to require transport_mode parameter - Update napari_stream.py and fiji_stream.py to use kwargs['transport_mode'] - Remove hardcoded TransportMode.IPC fallbacks This ensures the platform-aware default from config (TCP on Windows, IPC on Unix/Mac) is properly used instead of always defaulting to IPC.
1 parent 5e177a9 commit 607f67c

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/polystore/fiji_stream.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def save_batch(self, data_list: List[Any], file_paths: List[Union[str, Path]], *
7474
# Extract kwargs using generic polymorphic names
7575
host = kwargs.get('host', 'localhost')
7676
port = kwargs['port']
77-
transport_mode = kwargs.get('transport_mode', TransportMode.IPC)
77+
transport_mode = kwargs['transport_mode']
7878
transport_config = kwargs.get('transport_config')
7979
publisher = self._get_publisher(host, port, transport_mode, transport_config=transport_config)
8080
display_config = kwargs['display_config']

src/polystore/napari_stream.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def save_batch(self, data_list: List[Any], file_paths: List[Union[str, Path]], *
7575
# Extract kwargs using generic polymorphic names
7676
host = kwargs.get('host', 'localhost')
7777
port = kwargs['port']
78-
transport_mode = kwargs.get('transport_mode', TransportMode.IPC)
78+
transport_mode = kwargs['transport_mode']
7979
transport_config = kwargs.get('transport_config')
8080
publisher = self._get_publisher(host, port, transport_mode, transport_config=transport_config)
8181
display_config = kwargs['display_config']

src/polystore/streaming.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def __init__(self, transport_config=None):
5757
self._shared_memory_blocks = {}
5858
self._transport_config = transport_config or POLYSTORE_ZMQ_CONFIG
5959

60-
def _get_publisher(self, host: str, port: int, transport_mode: TransportMode = TransportMode.IPC, transport_config=None):
60+
def _get_publisher(self, host: str, port: int, transport_mode: TransportMode, transport_config=None):
6161
"""
6262
Lazy initialization of ZeroMQ publisher (common for all streaming backends).
6363
@@ -67,7 +67,7 @@ def _get_publisher(self, host: str, port: int, transport_mode: TransportMode = T
6767
Args:
6868
host: Host to connect to (ignored for IPC mode)
6969
port: Port to connect to
70-
transport_mode: IPC or TCP transport
70+
transport_mode: IPC or TCP transport (required - comes from config)
7171
7272
Returns:
7373
ZeroMQ publisher socket

0 commit comments

Comments
 (0)