fractal-analytics-platform / fractal-tasks-core

Main tasks for the Fractal analytics platform
https://fractal-analytics-platform.github.io/fractal-tasks-core/
BSD 3-Clause "New" or "Revised" License
14 stars 6 forks source link

Store main docstrings in the manifest #405

Closed tcompa closed 1 year ago

tcompa commented 1 year ago

Refs

tcompa commented 1 year ago

There need to exist new functions/scripts in in the dev subpackage, that implement the addition of docs_link and docs_info fields into each task of the manifest. I propose to follow the same logic that we use for parameters JSON Schemas:

What should actually be written in the manifest?

link

docs_link: either a link the the docs homepage, or to the specific function. Note: docs are not version-specific, so that they will be out-of-sync in the future. I'd rather include a generic homepage link.

docstring

I'd suggest that docs_info includes only the short/long function descriptions (i.e. the first block of the docstring), and not the parameters' descriptions (which are already stored in the JSON Schema).

mfranzon commented 1 year ago

In principle we can avoid new files creation because we can extend the function create_schema_for_single_task in fractal_tasks_core/dev/lib_args_schemas.py with an auxiliary function that put into the manifest docs_info and docs_link.

Is necessary another check? Does the function _compare_dicts in fractal_tasks_core/dev/check_args_schemas.py already checks for missing keys in task args?

tcompa commented 1 year ago

In principle we can avoid new files creation because we can extend the function create_schema_for_single_task in fractal_tasks_core/dev/lib_args_schemas.py with an auxiliary function that put into the manifest docs_info and docs_link.

Is necessary another check? Does the function _compare_dicts in fractal_tasks_core/dev/check_args_schemas.py already checks for missing keys in task args?

See https://github.com/fractal-analytics-platform/fractal-tasks-core/pull/486#issuecomment-1685779622. The two files are actually needed (or a single file, but with two different features).