diff --git a/src/fractal_faim_hcs/__FRACTAL_MANIFEST__.json b/src/fractal_faim_hcs/__FRACTAL_MANIFEST__.json index 2fe6642..963eee8 100644 --- a/src/fractal_faim_hcs/__FRACTAL_MANIFEST__.json +++ b/src/fractal_faim_hcs/__FRACTAL_MANIFEST__.json @@ -91,7 +91,9 @@ "mem": 1000 }, "name": "Create OME-Zarr MD", - "output_type": "zarr" + "output_type": "zarr", + "docs_info": "Create OME-Zarr plate from MD Image Xpress files.", + "docs_link": "https://github.com/jluethi/fractal-faim-hcs" }, { "args_schema": { @@ -129,7 +131,7 @@ }, "memory_efficient": { "title": "Memory Efficient", - "default": true, + "default": false, "type": "boolean", "description": "Load images via dask (more memory efficient for 3D)" } @@ -151,7 +153,9 @@ "parallelization_level": "image" }, "name": "Convert MD to OME-Zarr", - "output_type": "zarr" + "output_type": "zarr", + "docs_info": "Converts the image data from the MD image Xpress into OME-Zarr.", + "docs_link": "https://github.com/jluethi/fractal-faim-hcs" } ] } diff --git a/src/fractal_faim_hcs/dev/new_args_schema.py b/src/fractal_faim_hcs/dev/new_args_schema.py index 69ad6cc..77bf3c1 100644 --- a/src/fractal_faim_hcs/dev/new_args_schema.py +++ b/src/fractal_faim_hcs/dev/new_args_schema.py @@ -16,41 +16,51 @@ """ import json +import logging +from importlib import import_module from pathlib import Path -import fractal_faim_hcs from fractal_tasks_core.dev.lib_args_schemas import ( create_schema_for_single_task, ) +from fractal_tasks_core.dev.lib_task_docs import create_docs_info + +PACKAGE = "fractal_faim_hcs" + if __name__ == "__main__": # Read manifest - manifest_path = Path(fractal_faim_hcs.__file__).parent / "__FRACTAL_MANIFEST__.json" + imported_package = import_module(PACKAGE) + manifest_path = Path(imported_package.__file__).parent / "__FRACTAL_MANIFEST__.json" with manifest_path.open("r") as f: manifest = json.load(f) - # Set or check global properties of manifest + # Set global properties of manifest manifest["has_args_schemas"] = True manifest["args_schema_version"] = "pydantic_v1" - # Loop over tasks and set or check args schemas + # Loop over tasks task_list = manifest["task_list"] for ind, task in enumerate(task_list): executable = task["executable"] - print(f"[{executable}] Start") - try: - schema = create_schema_for_single_task( - executable, package="fractal_faim_hcs" - ) - except AttributeError as e: - print(f"[{executable}] Skip, due to AttributeError") - print(e) - continue + logging.info(f"[{executable}] START") + # Create new JSON Schema for task arguments + schema = create_schema_for_single_task(executable, package=PACKAGE) manifest["task_list"][ind]["args_schema"] = schema - print("Schema added to manifest") + + # Update docs_info, based on task-function description + docs_info = create_docs_info(executable, package=PACKAGE) + docs_link = "https://github.com/jluethi/fractal-faim-hcs" + if docs_info: + manifest["task_list"][ind]["docs_info"] = docs_info + if docs_link: + manifest["task_list"][ind]["docs_link"] = docs_link + + logging.info(f"[{executable}] END (new schema/description/link)") print() with manifest_path.open("w") as f: json.dump(manifest, f, indent=2) f.write("\n") + logging.info(f"Up-to-date manifest stored in {manifest_path.as_posix()}")