Skip to content

Commit

Permalink
chore: add check for skip_intermediaries vs. reduction_worker_type
Browse files Browse the repository at this point in the history
  • Loading branch information
dodamih committed Feb 19, 2025
1 parent b7ae3d3 commit 4b46c35
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions tests/integration/subchunkable/test_subchunkable.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 "
Expand Down

0 comments on commit 4b46c35

Please sign in to comment.