diff --git a/tests/integration/subchunkable/specs/exc/test_uint8_exc_skip_intermediaries_but_reduction_worker_type.cue b/tests/integration/subchunkable/specs/exc/test_uint8_exc_skip_intermediaries_but_reduction_worker_type.cue new file mode 100644 index 000000000..23fa003e3 --- /dev/null +++ b/tests/integration/subchunkable/specs/exc/test_uint8_exc_skip_intermediaries_but_reduction_worker_type.cue @@ -0,0 +1,39 @@ +#SRC_PATH: "assets/inputs/fafb_v15_img_128_128_40-2048-3072_2000-2050_uint8" +#DST_PATH: "assets/outputs/test_uint8_exc_skip_intermediaries_but_reduction_worker_type" + +#BBOX: { + "@type": "BBox3D.from_coords" + start_coord: [64 * 1024, 64 * 1024, 2000] + end_coord: [96 * 1024, 96 * 1024, 2005] + resolution: [4, 4, 40] +} + +#FLOW: { + "@type": "build_subchunkable_apply_flow" + fn: { + "@type": "lambda" + lambda_str: "lambda src: src" + } + processing_chunk_sizes: [[1024, 1024, 1], [512, 512, 1]] + processing_crop_pads: [[0, 0, 0], [0, 0, 0]] + processing_blend_pads: [[0, 0, 0], [0, 0, 0]] + skip_intermediaries: true + expand_bbox_processing: true + dst_resolution: [128, 128, 40] + bbox: #BBOX + op_kwargs: { + src: { + "@type": "build_cv_layer" + path: #SRC_PATH + } + } + dst: { + "@type": "build_cv_layer" + path: #DST_PATH + info_reference_path: #SRC_PATH + } + reduction_worker_type: "some_worker_type" +} + +"@type": "mazepa.execute" +target: #FLOW diff --git a/tests/integration/subchunkable/test_subchunkable.py b/tests/integration/subchunkable/test_subchunkable.py index 8c2e18c3e..9e29b1964 100644 --- a/tests/integration/subchunkable/test_subchunkable.py +++ b/tests/integration/subchunkable/test_subchunkable.py @@ -165,6 +165,7 @@ def test_subchunkable(cue_name, clear_temp_dir_and_info_cache): "test_uint8_exc_skip_intermediaries_but_blend_pad", "test_uint8_exc_skip_intermediaries_but_crop_pad", "test_uint8_exc_skip_intermediaries_but_defer", + "test_uint8_exc_skip_intermediaries_but_reduction_worker_type", "test_uint8_exc_not_skip_intermediaries_but_no_level_intermediaries_dirs", "test_uint8_exc_shrink_processing_chunk_and_expand_bbox_processing", "test_uint8_exc_bbox_non_integral_without_expand_bbox_resolution", diff --git a/zetta_utils/mazepa_layer_processing/common/subchunkable_apply_flow.py b/zetta_utils/mazepa_layer_processing/common/subchunkable_apply_flow.py index 419e941dd..829048ac6 100644 --- a/zetta_utils/mazepa_layer_processing/common/subchunkable_apply_flow.py +++ b/zetta_utils/mazepa_layer_processing/common/subchunkable_apply_flow.py @@ -476,6 +476,10 @@ def build_subchunkable_apply_flow( # pylint: disable=keyword-arg-before-vararg, max_reduction_chunk_size_ = max_reduction_chunk_size if skip_intermediaries: + if reduction_worker_type is not None: + raise ValueError( + "`reduction_worker_type` cannot be used when `skip_intermediaries` is True." + ) if level_intermediaries_dirs is not None: raise ValueError( "`level_intermediaries_dirs` was supplied even though "