Skip to content

Commit 8bbb56a

Browse files
committed
fix: Accept dtype_config instead of dtype_conversion in dtype_wrapper
The dtype_wrapper now expects dtype_config (the full dataclass) from OpenHCS and extracts the default_dtype_conversion field from it. This fixes the structural issue where dtype_config was being filtered before reaching ArrayBridge, preventing dtype conversion from working. Changes: - Extract dtype_config from kwargs instead of dtype_conversion - Get conversion mode from dtype_config.default_dtype_conversion - Maintains backward compatibility with None fallback
1 parent 0e29e6d commit 8bbb56a

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/arraybridge/decorators.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,12 @@ def _create_dtype_wrapper(func, mem_type: MemoryType, func_name: str):
168168

169169
@functools.wraps(func)
170170
def dtype_wrapper(image, *args, slice_by_slice: bool = False, **kwargs):
171-
# Get dtype_conversion from kwargs (injected by OpenHCS dtype_config)
172-
dtype_conversion = kwargs.pop('dtype_conversion', None)
173-
if dtype_conversion is None:
171+
# Get dtype_config from kwargs (injected by OpenHCS)
172+
dtype_config = kwargs.pop('dtype_config', None)
173+
if dtype_config is not None:
174+
# Extract the conversion mode from the config dataclass
175+
dtype_conversion = dtype_config.default_dtype_conversion
176+
else:
174177
dtype_conversion = DtypeConversion.PRESERVE_INPUT
175178

176179
# Store original dtype

0 commit comments

Comments
 (0)