Skip to content

Commit

Permalink
Merge pull request #2117 from fractal-analytics-platform/2116-tcompa-…
Browse files Browse the repository at this point in the history
…could-we-add-some-metadata-to-fractal-tasks-mock-so-that-i-can-easily-test-the-filtering-end-to-end

Add new metadata to fractal-tasks-mock
  • Loading branch information
tcompa authored Dec 2, 2024
2 parents 934f035 + f9f2048 commit 6a98ca1
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

* Testing:
* Re-include a specific test previously skipped for Python 3.12 (\#2114).
* Add metadata to `fractal-tasks-mock` package (\#2117).
* Docs:
* Add info about working versions.

Expand Down
30 changes: 30 additions & 0 deletions tests/v2/fractal_tasks_mock/create_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,50 +16,78 @@
executable="fill_cellvoyager_ome_zarr.py",
meta_init={"key1": "value1"},
meta={"key2": "value2"},
category="Conversion",
modality="HCS",
tags=["Yokogawa", "Cellvoyager"],
),
CompoundTask(
name="create_ome_zarr_multiplex_compound",
executable_init="create_cellvoyager_ome_zarr_multiplex.py",
executable="fill_cellvoyager_ome_zarr.py",
category="Conversion",
modality="HCS",
tags=["Yokogawa", "Cellvoyager"],
),
CompoundTask(
name="MIP_compound",
input_types={"3D": True},
executable_init="new_ome_zarr.py",
executable="maximum_intensity_projection.py",
output_types={"3D": False},
category="Image Processing",
modality="HCS",
tags=["Preprocessing"],
),
ParallelTask(
name="illumination_correction",
input_types=dict(illumination_correction=False),
executable="illumination_correction.py",
output_types=dict(illumination_correction=True),
category="Image Processing",
tags=["Preprocessing"],
),
CompoundTask(
name="illumination_correction_compound",
input_types=dict(illumination_correction=False),
executable_init="illumination_correction_init.py",
executable="illumination_correction_compute.py",
output_types=dict(illumination_correction=True),
category="Image Processing",
tags=["Preprocessing"],
),
ParallelTask(
name="cellpose_segmentation",
executable="cellpose_segmentation.py",
category="Segmentation",
tags=[
"Deep Learning",
"Convolutional Neural Network",
"Instance Segmentation",
],
),
CompoundTask(
name="calculate_registration_compound",
executable_init="calculate_registration_init.py",
executable="calculate_registration_compute.py",
category="Registration",
modality="HCS",
tags=["Multiplexing"],
),
NonParallelTask(
name="find_registration_consensus",
executable="find_registration_consensus.py",
category="Registration",
modality="HCS",
tags=["Multiplexing"],
),
ParallelTask(
name="apply_registration_to_image",
input_types=dict(registration=False),
executable="apply_registration_to_image.py",
output_types=dict(registration=True),
category="Registration",
modality="HCS",
tags=["Multiplexing"],
),
NonParallelTask(
name="generic_task",
Expand All @@ -86,6 +114,7 @@


PACKAGE = "fractal_tasks_mock"
AUTHORS = "name1 surname1, name2 surname2"
CUSTOM_PYDANTIC_MODELS = [
("fractal_tasks_mock", "input_models.py", "InitArgsRegistration"),
("fractal_tasks_mock", "input_models.py", "InitArgsCellVoyager"),
Expand Down Expand Up @@ -138,6 +167,7 @@
task_list=TASK_LIST,
has_args_schemas=True,
args_schema_version="pydantic_v1",
authors=AUTHORS,
)

with open("src/fractal_tasks_mock/__FRACTAL_MANIFEST__.json", "w") as f:
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"args_schema_version": "pydantic_v1",
"authors": "name1 surname1, name2 surname2",
"has_args_schemas": true,
"manifest_version": "2",
"task_list": [
Expand Down Expand Up @@ -83,6 +84,7 @@
"title": "FillCellvoyagerOmeZarr",
"type": "object"
},
"category": "Conversion",
"docs_info": "This is task create_ome_zarr_compound.",
"docs_link": "https://example.org",
"executable_non_parallel": "create_cellvoyager_ome_zarr.py",
Expand All @@ -93,7 +95,12 @@
"meta_parallel": {
"key2": "value2"
},
"name": "create_ome_zarr_compound"
"modality": "HCS",
"name": "create_ome_zarr_compound",
"tags": [
"Yokogawa",
"Cellvoyager"
]
},
{
"args_schema_non_parallel": {
Expand Down Expand Up @@ -169,11 +176,17 @@
"title": "FillCellvoyagerOmeZarr",
"type": "object"
},
"category": "Conversion",
"docs_info": "This is task create_ome_zarr_multiplex_compound.",
"docs_link": "https://example.org",
"executable_non_parallel": "create_cellvoyager_ome_zarr_multiplex.py",
"executable_parallel": "fill_cellvoyager_ome_zarr.py",
"name": "create_ome_zarr_multiplex_compound"
"modality": "HCS",
"name": "create_ome_zarr_multiplex_compound",
"tags": [
"Yokogawa",
"Cellvoyager"
]
},
{
"args_schema_non_parallel": {
Expand Down Expand Up @@ -250,17 +263,22 @@
"title": "MaximumIntensityProjection",
"type": "object"
},
"category": "Image Processing",
"docs_info": "This is task MIP_compound.",
"docs_link": "https://example.org",
"executable_non_parallel": "new_ome_zarr.py",
"executable_parallel": "maximum_intensity_projection.py",
"input_types": {
"3D": true
},
"modality": "HCS",
"name": "MIP_compound",
"output_types": {
"3D": false
}
},
"tags": [
"Preprocessing"
]
},
{
"args_schema_parallel": {
Expand All @@ -284,6 +302,7 @@
"title": "IlluminationCorrection",
"type": "object"
},
"category": "Image Processing",
"docs_info": "This is task illumination_correction.",
"docs_link": "https://example.org",
"executable_parallel": "illumination_correction.py",
Expand All @@ -293,7 +312,10 @@
"name": "illumination_correction",
"output_types": {
"illumination_correction": true
}
},
"tags": [
"Preprocessing"
]
},
{
"args_schema_non_parallel": {
Expand Down Expand Up @@ -378,6 +400,7 @@
"title": "IlluminationCorrectionCompute",
"type": "object"
},
"category": "Image Processing",
"docs_info": "This is task illumination_correction_compound.",
"docs_link": "https://example.org",
"executable_non_parallel": "illumination_correction_init.py",
Expand All @@ -388,7 +411,10 @@
"name": "illumination_correction_compound",
"output_types": {
"illumination_correction": true
}
},
"tags": [
"Preprocessing"
]
},
{
"args_schema_parallel": {
Expand All @@ -406,10 +432,16 @@
"title": "CellposeSegmentation",
"type": "object"
},
"category": "Segmentation",
"docs_info": "This is task cellpose_segmentation.",
"docs_link": "https://example.org",
"executable_parallel": "cellpose_segmentation.py",
"name": "cellpose_segmentation"
"name": "cellpose_segmentation",
"tags": [
"Deep Learning",
"Convolutional Neural Network",
"Instance Segmentation"
]
},
{
"args_schema_non_parallel": {
Expand Down Expand Up @@ -480,11 +512,16 @@
"title": "CalculateRegistrationCompute",
"type": "object"
},
"category": "Registration",
"docs_info": "This is task calculate_registration_compound.",
"docs_link": "https://example.org",
"executable_non_parallel": "calculate_registration_init.py",
"executable_parallel": "calculate_registration_compute.py",
"name": "calculate_registration_compound"
"modality": "HCS",
"name": "calculate_registration_compound",
"tags": [
"Multiplexing"
]
},
{
"args_schema_non_parallel": {
Expand All @@ -511,10 +548,15 @@
"title": "FindRegistrationConsensus",
"type": "object"
},
"category": "Registration",
"docs_info": "This is task find_registration_consensus.",
"docs_link": "https://example.org",
"executable_non_parallel": "find_registration_consensus.py",
"name": "find_registration_consensus"
"modality": "HCS",
"name": "find_registration_consensus",
"tags": [
"Multiplexing"
]
},
{
"args_schema_parallel": {
Expand All @@ -538,16 +580,21 @@
"title": "ApplyRegistrationToImage",
"type": "object"
},
"category": "Registration",
"docs_info": "This is task apply_registration_to_image.",
"docs_link": "https://example.org",
"executable_parallel": "apply_registration_to_image.py",
"input_types": {
"registration": false
},
"modality": "HCS",
"name": "apply_registration_to_image",
"output_types": {
"registration": true
}
},
"tags": [
"Multiplexing"
]
},
{
"args_schema_non_parallel": {
Expand Down
10 changes: 7 additions & 3 deletions tests/v2/fractal_tasks_mock/task_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from typing import Optional

from pydantic import BaseModel
from pydantic import Field


class _BaseTask(BaseModel):
Expand All @@ -11,9 +12,12 @@ class Config:

name: str
executable: str
meta: Optional[dict[str, Any]]
input_types: Optional[dict[str, bool]]
output_types: Optional[dict[str, bool]]
meta: Optional[dict[str, Any]] = None
input_types: Optional[dict[str, bool]] = None
output_types: Optional[dict[str, bool]] = None
category: Optional[str] = None
modality: Optional[str] = None
tags: list[str] = Field(default_factory=list)


class CompoundTask(_BaseTask):
Expand Down

0 comments on commit 6a98ca1

Please sign in to comment.