Skip to content

Commit e2a6ec6

Browse files
authored
Merge pull request #25 from fractal-analytics-platform/use-fractal-task-tools
Use `fractal-task-tools`
2 parents 41043e6 + 05c59b7 commit e2a6ec6

File tree

8 files changed

+13
-30
lines changed

8 files changed

+13
-30
lines changed

.github/workflows/build_and_test.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ jobs:
4242
- name: Install some testing dependencies (hard-coded)
4343
run: python -m pip install pytest pytest-cov devtools jsonschema requests wget pooch
4444

45-
- name: Regenerate the manifest
46-
run: python src/fractal_helper_tasks/dev/create_manifest.py
47-
4845
- name: Cache Pooch folder
4946
id: cache-pooch-folder
5047
uses: actions/cache@v3
@@ -53,13 +50,7 @@ jobs:
5350
key: pooch-cache
5451

5552
- name: Check if manifest has changed
56-
run: |
57-
if [ -n "$(git diff --exit-code ./src/fractal_helper_tasks/__FRACTAL_MANIFEST__.json)" ]; then
58-
echo "__FRACTAL_MANIFEST__.json has changed. Please run 'python src/fractal_helper_tasks/dev/create_manifest.py' and commit the changes."
59-
exit 1
60-
else
61-
echo "__FRACTAL_MANIFEST__.json has not changed."
62-
fi
53+
run: fractal-manifest check --package fractal-helper-tasks
6354

6455
- name: Test tasks with pytest
6556
run: pytest --color=yes --cov --cov-report=xml --cov-report=term-missing -s --log-cli-level debug

pyproject.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ authors = [
2727
# Required Python version and dependencies
2828
requires-python = ">=3.10"
2929
dependencies = [
30-
"fractal-tasks-core==1.4.2","ngio==0.1.6",
30+
"fractal-tasks-core==1.4.2",
31+
"ngio==0.1.6",
32+
"fractal-task-tools==0.0.12",
3133
]
3234

3335
# Optional dependencies (e.g. for `pip install -e ".[dev]"`, see

src/fractal_helper_tasks/__FRACTAL_MANIFEST__.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"Singleton time dimension"
1111
],
1212
"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. ",
13+
"type": "parallel",
1314
"executable_parallel": "drop_t_dimension.py",
1415
"meta_parallel": {
1516
"cpus_per_task": 2,
@@ -57,6 +58,7 @@
5758
"2D to 3D workflows"
5859
],
5960
"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",
61+
"type": "parallel",
6062
"executable_parallel": "convert_2D_segmentation_to_3D.py",
6163
"meta_parallel": {
6264
"cpus_per_task": 2,
@@ -144,6 +146,7 @@
144146
"Many files"
145147
],
146148
"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",
149+
"type": "parallel",
147150
"executable_parallel": "rechunk_zarr.py",
148151
"meta_parallel": {
149152
"cpus_per_task": 1,

src/fractal_helper_tasks/convert_2D_segmentation_to_3D.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ def convert_2D_segmentation_to_3D(
273273

274274

275275
if __name__ == "__main__":
276-
from fractal_tasks_core.tasks._utils import run_fractal_task
276+
from fractal_task_tools.task_wrapper import run_fractal_task
277277

278278
run_fractal_task(
279279
task_function=convert_2D_segmentation_to_3D,

src/fractal_helper_tasks/dev/create_manifest.py

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/fractal_helper_tasks/dev/task_list.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
"""Fractal Task list for Fractal Helper Tasks."""
22

3-
from fractal_tasks_core.dev.task_models import ParallelTask
3+
from fractal_task_tools.task_models import ParallelTask
44

5+
AUTHORS = "Joel Luethi"
6+
DOCS_LINK = "https://github.com/jluethi/fractal-helper-tasks"
57
TASK_LIST = [
68
ParallelTask(
79
name="Drop T Dimension",

src/fractal_helper_tasks/drop_t_dimension.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def drop_t_dimension(
117117

118118

119119
if __name__ == "__main__":
120-
from fractal_tasks_core.tasks._utils import run_fractal_task
120+
from fractal_task_tools.task_wrapper import run_fractal_task
121121

122122
run_fractal_task(
123123
task_function=drop_t_dimension,

src/fractal_helper_tasks/rechunk_zarr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def rechunk_zarr(
136136

137137

138138
if __name__ == "__main__":
139-
from fractal_tasks_core.tasks._utils import run_fractal_task
139+
from fractal_task_tools.task_wrapper import run_fractal_task
140140

141141
run_fractal_task(
142142
task_function=rechunk_zarr,

0 commit comments

Comments
 (0)