diff --git a/CHANGELOG.md b/CHANGELOG.md index bd61e7e39..fc0d3c3e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ # 1.5.0 * Tasks: - * Refactor `projection` task to use the new `ngio` API (\#937, \#943). + * Refactor `projection` task to use the new `ngio` API (\#937, \#943, \#944). * Refactor `copy_ome_zarr_plate` init task to support the upcoming flexibility. * Rely on `fractal-task-tools` for `run_fractal_task` wrapper (\#923). * Mark some existing tasks as _converter_ tasks(\#923). diff --git a/fractal_tasks_core/__FRACTAL_MANIFEST__.json b/fractal_tasks_core/__FRACTAL_MANIFEST__.json index 414749390..a727ebf26 100644 --- a/fractal_tasks_core/__FRACTAL_MANIFEST__.json +++ b/fractal_tasks_core/__FRACTAL_MANIFEST__.json @@ -676,9 +676,9 @@ "title": "Method", "description": "Choose which method to use for intensity projection along the Z axis. mip is the default and performs a maximum intensity projection. minip performs a minimum intensity projection, meanip a mean intensity projection and sumip a sum intensity projection." }, - "overwrite_images": { + "overwrite": { "default": false, - "title": "Overwrite Images", + "title": "Overwrite", "type": "boolean", "description": "If `True`, overwrite the MIP images if they are already present in the new OME-Zarr Plate." }, diff --git a/fractal_tasks_core/tasks/copy_ome_zarr_hcs_plate.py b/fractal_tasks_core/tasks/copy_ome_zarr_hcs_plate.py index 5c637176a..2a0439446 100644 --- a/fractal_tasks_core/tasks/copy_ome_zarr_hcs_plate.py +++ b/fractal_tasks_core/tasks/copy_ome_zarr_hcs_plate.py @@ -93,7 +93,7 @@ def copy_ome_zarr_hcs_plate( zarr_dir: str, method: DaskProjectionMethod = DaskProjectionMethod.MIP, # Advanced parameters - overwrite_images: bool = False, + overwrite: bool = False, re_initialize_plate: bool = False, ) -> dict[str, Any]: """ @@ -122,7 +122,7 @@ def copy_ome_zarr_hcs_plate( Z axis. mip is the default and performs a maximum intensity projection. minip performs a minimum intensity projection, meanip a mean intensity projection and sumip a sum intensity projection. - overwrite_images: If `True`, overwrite the MIP images if they are + overwrite: If `True`, overwrite the MIP images if they are already present in the new OME-Zarr Plate. re_initialize_plate: If `True`, re-initialize the plate, deleting all existing wells and images. If `False`, the task will only @@ -184,10 +184,10 @@ def copy_ome_zarr_hcs_plate( proj_image_path = f"{row}/{column}/{image_path}" if proj_image_path in proj_plate_images_paths: - if not overwrite_images: + if not overwrite: raise NgioFileExistsError( f"Image {proj_image_path} already exists in " - f"{proj_plate_url}. Set `overwrite_images=True` " + f"{proj_plate_url}. Set `overwrite=True` " "to overwrite it." ) logger.info( diff --git a/tests/tasks/test_import_ome_zarr.py b/tests/tasks/test_import_ome_zarr.py index d3e6cf872..079c4aaee 100644 --- a/tests/tasks/test_import_ome_zarr.py +++ b/tests/tasks/test_import_ome_zarr.py @@ -65,7 +65,7 @@ def test_import_ome_zarr_plate(tmp_path, zenodo_zarr): parallelization_list = copy_ome_zarr_hcs_plate( zarr_urls=zarr_urls, zarr_dir="tmp_out", - overwrite_images=True, + overwrite=True, re_initialize_plate=True, )["parallelization_list"] debug(parallelization_list) @@ -248,7 +248,7 @@ def test_import_ome_zarr_plate_no_ROI_tables(tmp_path, zenodo_zarr): parallelization_list = copy_ome_zarr_hcs_plate( zarr_urls=zarr_urls, zarr_dir="tmp_out", - overwrite_images=True, + overwrite=True, re_initialize_plate=True, )["parallelization_list"] debug(parallelization_list) diff --git a/tests/tasks/test_registration.py b/tests/tasks/test_registration.py index adae4cd47..29c762a41 100755 --- a/tests/tasks/test_registration.py +++ b/tests/tasks/test_registration.py @@ -290,7 +290,7 @@ def test_multiplexing_registration( parallelization_list = copy_ome_zarr_hcs_plate( zarr_urls=zarr_urls_3D, zarr_dir=zarr_dir, - overwrite_images=True, + overwrite=True, re_initialize_plate=True, )["parallelization_list"] debug(parallelization_list) diff --git a/tests/tasks/test_unit_copy_hcs.py b/tests/tasks/test_unit_copy_hcs.py index 4b171b33c..46075b73b 100644 --- a/tests/tasks/test_unit_copy_hcs.py +++ b/tests/tasks/test_unit_copy_hcs.py @@ -56,7 +56,7 @@ def test_MIP( parallelization_list = copy_ome_zarr_hcs_plate( zarr_urls=zarr_urls, zarr_dir="tmp_out", - overwrite_images=True, + overwrite=True, re_initialize_plate=True, )["parallelization_list"] debug(parallelization_list) @@ -65,7 +65,7 @@ def test_MIP( parallelization_list_2 = copy_ome_zarr_hcs_plate( zarr_urls=zarr_urls, zarr_dir="tmp_out", - overwrite_images=True, + overwrite=True, re_initialize_plate=True, )["parallelization_list"] assert parallelization_list_2 == parallelization_list @@ -75,7 +75,7 @@ def test_MIP( _ = copy_ome_zarr_hcs_plate( zarr_urls=zarr_urls, zarr_dir="tmp_out", - overwrite_images=False, + overwrite=False, re_initialize_plate=False, ) diff --git a/tests/tasks/test_workflows.py b/tests/tasks/test_workflows.py index d90efa573..780b245ff 100644 --- a/tests/tasks/test_workflows.py +++ b/tests/tasks/test_workflows.py @@ -321,7 +321,7 @@ def test_MIP( parallelization_list = copy_ome_zarr_hcs_plate( zarr_urls=zarr_urls, zarr_dir=str(zarr_path), - overwrite_images=True, + overwrite=True, re_initialize_plate=True, )["parallelization_list"] debug(parallelization_list) @@ -330,7 +330,7 @@ def test_MIP( parallelization_list_2 = copy_ome_zarr_hcs_plate( zarr_urls=zarr_urls, zarr_dir=str(zarr_path), - overwrite_images=True, + overwrite=True, re_initialize_plate=True, )["parallelization_list"] assert parallelization_list_2 == parallelization_list @@ -416,7 +416,7 @@ def test_projection_methods( zarr_urls=zarr_urls, zarr_dir=str(zarr_path), method=method, - overwrite_images=True, + overwrite=True, re_initialize_plate=True, )["parallelization_list"] @@ -499,7 +499,7 @@ def test_MIP_subset_of_images( parallelization_list = copy_ome_zarr_hcs_plate( zarr_urls=zarr_urls, zarr_dir=str(zarr_dir), - overwrite_images=True, + overwrite=True, re_initialize_plate=True, )["parallelization_list"] debug(parallelization_list) diff --git a/tests/tasks/test_workflows_multiplexing.py b/tests/tasks/test_workflows_multiplexing.py index e49630d99..8b78b1134 100644 --- a/tests/tasks/test_workflows_multiplexing.py +++ b/tests/tasks/test_workflows_multiplexing.py @@ -393,7 +393,7 @@ def test_multiplexing_MIP( parallelization_list = copy_ome_zarr_hcs_plate( zarr_urls=zarr_urls, zarr_dir=str(zarr_dir), - overwrite_images=True, + overwrite=True, re_initialize_plate=True, )["parallelization_list"] debug(parallelization_list) diff --git a/tests/tasks_v2/test_projection_task.py b/tests/tasks_v2/test_projection_task.py index fe378bf14..6a117f059 100644 --- a/tests/tasks_v2/test_projection_task.py +++ b/tests/tasks_v2/test_projection_task.py @@ -13,7 +13,7 @@ def test_mip_task(cardiomyocyte_tiny_path: Path, tmp_path: Path) -> None: parallel_list = copy_ome_zarr_hcs_plate( zarr_urls=[image_url], zarr_dir=str(tmp_path / "tmp_out"), - overwrite_images=True, + overwrite=True, re_initialize_plate=True, ) diff --git a/tests/tasks_v2/test_unit_copy_ome_hcs_plate.py b/tests/tasks_v2/test_unit_copy_ome_hcs_plate.py index e4181d42a..09e7d6501 100644 --- a/tests/tasks_v2/test_unit_copy_ome_hcs_plate.py +++ b/tests/tasks_v2/test_unit_copy_ome_hcs_plate.py @@ -63,14 +63,14 @@ def test_flexibility_copy_hcs(tmp_path: Path): parallel_list_1 = copy_ome_zarr_hcs_plate( zarr_urls=[zarr_urls[0]], zarr_dir=subset_dir, - overwrite_images=True, + overwrite=True, re_initialize_plate=True, ) # Subset 2 _ = copy_ome_zarr_hcs_plate( zarr_urls=[zarr_urls[1]], zarr_dir=subset_dir, - overwrite_images=False, + overwrite=False, re_initialize_plate=False, ) @@ -82,7 +82,7 @@ def test_flexibility_copy_hcs(tmp_path: Path): parallel_list_all = copy_ome_zarr_hcs_plate( zarr_urls=zarr_urls, zarr_dir=all_dir, - overwrite_images=True, + overwrite=True, re_initialize_plate=True, ) zarr_url = parallel_list_all["parallelization_list"][0]["zarr_url"] @@ -100,7 +100,7 @@ def test_fail_overwrite(tmp_path: Path): copy_ome_zarr_hcs_plate( zarr_urls=zarr_urls, zarr_dir=str(tmp_path), - overwrite_images=False, + overwrite=False, re_initialize_plate=False, ) @@ -109,7 +109,7 @@ def test_fail_overwrite(tmp_path: Path): copy_ome_zarr_hcs_plate( zarr_urls=zarr_urls, zarr_dir=str(tmp_path), - overwrite_images=False, + overwrite=False, re_initialize_plate=True, ) @@ -117,7 +117,7 @@ def test_fail_overwrite(tmp_path: Path): copy_ome_zarr_hcs_plate( zarr_urls=zarr_urls, zarr_dir=str(tmp_path), - overwrite_images=False, + overwrite=False, re_initialize_plate=False, ) @@ -130,7 +130,7 @@ def test_new_plate_name(tmp_path: Path): zarr_urls=[zarr_urls[0]], zarr_dir=str(tmp_path), method=method, - overwrite_images=False, + overwrite=False, re_initialize_plate=False, ) @@ -148,7 +148,7 @@ def test_fail_not_plate_url(): copy_ome_zarr_hcs_plate( zarr_urls=["/tmp/plate.zarr"], zarr_dir="/tmp", - overwrite_images=False, + overwrite=False, re_initialize_plate=False, ) @@ -161,7 +161,7 @@ def test_reinit_true(tmp_path: Path): parallel_list_1 = copy_ome_zarr_hcs_plate( zarr_urls=[zarr_urls[0]], zarr_dir=str(tmp_path), - overwrite_images=True, + overwrite=True, re_initialize_plate=True, ) @@ -173,7 +173,7 @@ def test_reinit_true(tmp_path: Path): parallel_list_2 = copy_ome_zarr_hcs_plate( zarr_urls=[zarr_urls[1]], zarr_dir=str(tmp_path), - overwrite_images=False, + overwrite=False, re_initialize_plate=True, )