Skip to content

Commit f60de91

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 (required, no fallback) - Get conversion mode from dtype_config.default_dtype_conversion
1 parent 0e29e6d commit f60de91

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/arraybridge/decorators.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,10 @@ 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:
174-
dtype_conversion = DtypeConversion.PRESERVE_INPUT
171+
# Get dtype_config from kwargs (injected by OpenHCS)
172+
dtype_config = kwargs.pop('dtype_config')
173+
# Extract the conversion mode from the config dataclass
174+
dtype_conversion = dtype_config.default_dtype_conversion
175175

176176
# Store original dtype
177177
original_dtype = getattr(image, "dtype", None)

0 commit comments

Comments
 (0)