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

Adapt to (upcoming) split of metadata/components #523

Closed tcompa closed 5 months ago

tcompa commented 12 months ago

Ref:

For most tasks, this will only require a change in the returned value:

# Current version of `metadiff.json`
{
  "num_levels": 10,
  "image": ["some_new_image"],
}

# Future version of `task_output.json`
{
  "meta": {
    "num_levels": 10,
  },
  "components": {
    "image": ["some_new_image"],
  }
}

This first update could be done at any time, since we plan to first release a backwards-compatible fractal-server version.

For the specific case of copy-ome-zarr, this will also require a (minor) update of this block:

    # List all plates
    in_path = Path(input_paths[0])
    list_plates = [
        p.as_posix()
        for p in Path(in_path).glob("*.zarr")
        if p.name in metadata["plate"]
    ]
    logger.info(f"{list_plates=}")

This second update would need to take place ASAP, since the new server will not include plate as part of the metadata that is passed as a task argument.