diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 9f70ea2..93692ba 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -42,9 +42,6 @@ jobs: - name: Install some testing dependencies (hard-coded) run: python -m pip install pytest pytest-cov devtools jsonschema requests wget pooch - - name: Regenerate the manifest - run: python src/fractal_helper_tasks/dev/create_manifest.py - - name: Cache Pooch folder id: cache-pooch-folder uses: actions/cache@v3 @@ -53,13 +50,7 @@ jobs: key: pooch-cache - name: Check if manifest has changed - run: | - if [ -n "$(git diff --exit-code ./src/fractal_helper_tasks/__FRACTAL_MANIFEST__.json)" ]; then - echo "__FRACTAL_MANIFEST__.json has changed. Please run 'python src/fractal_helper_tasks/dev/create_manifest.py' and commit the changes." - exit 1 - else - echo "__FRACTAL_MANIFEST__.json has not changed." - fi + run: fractal-manifest check --package fractal-helper-tasks - name: Test tasks with pytest run: pytest --color=yes --cov --cov-report=xml --cov-report=term-missing -s --log-cli-level debug diff --git a/pyproject.toml b/pyproject.toml index 62e13ee..72f0504 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,7 +27,9 @@ authors = [ # Required Python version and dependencies requires-python = ">=3.10" dependencies = [ - "fractal-tasks-core==1.4.2","ngio==0.1.6", + "fractal-tasks-core==1.4.2", + "ngio==0.1.6", + "fractal-task-tools==0.0.12", ] # Optional dependencies (e.g. for `pip install -e ".[dev]"`, see diff --git a/src/fractal_helper_tasks/__FRACTAL_MANIFEST__.json b/src/fractal_helper_tasks/__FRACTAL_MANIFEST__.json index 1a3900f..07d7fde 100644 --- a/src/fractal_helper_tasks/__FRACTAL_MANIFEST__.json +++ b/src/fractal_helper_tasks/__FRACTAL_MANIFEST__.json @@ -10,6 +10,7 @@ "Singleton time dimension" ], "docs_info": "### Purpose\n- Removes a **singleton time (T) dimension** from an OME-Zarr image. \n- Creates a new OME-Zarr image with updated metadata and dimensions.\n- Optionally overwrites the input image if `overwrite_input` is set to True.\n\n### Outputs\n- A **new Zarr image** without the singleton T-dimension, stored with a configurable suffix. \n\n### Limitations\n- Only processes OME-Zarr images where the **T-axis is the first axis**. \n- Assumes the T-dimension is **singleton**; does not process non-singleton time axes. \n- Does not copy associated **label images** or **ROI tables** to the new Zarr structure. ", + "type": "parallel", "executable_parallel": "drop_t_dimension.py", "meta_parallel": { "cpus_per_task": 2, @@ -57,6 +58,7 @@ "2D to 3D workflows" ], "docs_info": "### Purpose\n- Converts a **2D segmentation** image into a **3D segmentation** by replicating the 2D segmentation across Z-slices. \n- Supports OME-Zarr datasets where **2D and 3D images** share the same base name but differ by suffixes. \n- Optionally copies associated ROI tables and adjusts them to align with the replicated Z-dimensions. \n\n### Outputs\n- A **3D segmentation label image** saved with a new name. \n- Updated **ROI tables** adjusted for Z-dimensions (optional). \n\n### Limitations\n- Only supports **same-base 2D and 3D Zarr names**; full flexibility in file names is not yet implemented. \n- Assumes **2D OME-Zarr images** and corresponding 3D images are stored in the same base folder and just differ with a suffix before the .zarr. \n", + "type": "parallel", "executable_parallel": "convert_2D_segmentation_to_3D.py", "meta_parallel": { "cpus_per_task": 2, @@ -144,6 +146,7 @@ "Many files" ], "docs_info": "### Purpose\n- Rechunks OME-Zarr to new chunking parameters: Changes whether the array is stored as many small files or few larger files.\n- Optionally applies the same rechunking to label images.\n\n### Outputs\n- A **new Zarr image** that is rechunked.\n", + "type": "parallel", "executable_parallel": "rechunk_zarr.py", "meta_parallel": { "cpus_per_task": 1, diff --git a/src/fractal_helper_tasks/convert_2D_segmentation_to_3D.py b/src/fractal_helper_tasks/convert_2D_segmentation_to_3D.py index 797b0c1..61192f7 100644 --- a/src/fractal_helper_tasks/convert_2D_segmentation_to_3D.py +++ b/src/fractal_helper_tasks/convert_2D_segmentation_to_3D.py @@ -273,7 +273,7 @@ def convert_2D_segmentation_to_3D( if __name__ == "__main__": - from fractal_tasks_core.tasks._utils import run_fractal_task + from fractal_task_tools.task_wrapper import run_fractal_task run_fractal_task( task_function=convert_2D_segmentation_to_3D, diff --git a/src/fractal_helper_tasks/dev/create_manifest.py b/src/fractal_helper_tasks/dev/create_manifest.py deleted file mode 100644 index b57cbf3..0000000 --- a/src/fractal_helper_tasks/dev/create_manifest.py +++ /dev/null @@ -1,15 +0,0 @@ -"""Manifest generation""" - -from fractal_tasks_core.dev.create_manifest import create_manifest - -if __name__ == "__main__": - """Generate JSON schemas for task arguments afresh, and write them - to the package manifest. - """ - PACKAGE = "fractal_helper_tasks" - AUTHORS = "Joel Luethi" - docs_link = "https://github.com/jluethi/fractal-helper-tasks" - if docs_link: - create_manifest(package=PACKAGE, authors=AUTHORS, docs_link=docs_link) - else: - create_manifest(package=PACKAGE, authors=AUTHORS) diff --git a/src/fractal_helper_tasks/dev/task_list.py b/src/fractal_helper_tasks/dev/task_list.py index 1fc85ae..4147767 100644 --- a/src/fractal_helper_tasks/dev/task_list.py +++ b/src/fractal_helper_tasks/dev/task_list.py @@ -1,7 +1,9 @@ """Fractal Task list for Fractal Helper Tasks.""" -from fractal_tasks_core.dev.task_models import ParallelTask +from fractal_task_tools.task_models import ParallelTask +AUTHORS = "Joel Luethi" +DOCS_LINK = "https://github.com/jluethi/fractal-helper-tasks" TASK_LIST = [ ParallelTask( name="Drop T Dimension", diff --git a/src/fractal_helper_tasks/drop_t_dimension.py b/src/fractal_helper_tasks/drop_t_dimension.py index 782c34b..cdf9a9b 100644 --- a/src/fractal_helper_tasks/drop_t_dimension.py +++ b/src/fractal_helper_tasks/drop_t_dimension.py @@ -117,7 +117,7 @@ def drop_t_dimension( if __name__ == "__main__": - from fractal_tasks_core.tasks._utils import run_fractal_task + from fractal_task_tools.task_wrapper import run_fractal_task run_fractal_task( task_function=drop_t_dimension, diff --git a/src/fractal_helper_tasks/rechunk_zarr.py b/src/fractal_helper_tasks/rechunk_zarr.py index 6d81470..205e8e4 100644 --- a/src/fractal_helper_tasks/rechunk_zarr.py +++ b/src/fractal_helper_tasks/rechunk_zarr.py @@ -136,7 +136,7 @@ def rechunk_zarr( if __name__ == "__main__": - from fractal_tasks_core.tasks._utils import run_fractal_task + from fractal_task_tools.task_wrapper import run_fractal_task run_fractal_task( task_function=rechunk_zarr,