Repository: fractal-analytics-platform/fractal-tasks-core (language: python)

Issue:
Update new datasets to Zenodo
As soon as #524 is merged (ref #339), the existing zarr datasets on Zenodo will be "wrong", in that they still have ROI tables with non-zero origins.

Through f2bb44f4ceabe0c15c4e4449c522bb33c900c370, we are fixing this issue with a workaround in the CI: after downloading from Zenodo, we load the FOV/well ROI tables and shift them by hand.

To do:
- [x] Update Zarr datasets
- [x] Remove workaround from pytest fixture


Discussion / hints:

Fix patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 41d6d1ba7..c63744dee 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,7 @@
 * Remove `has_args_schema` obsolete property from manifest (\#603).
 * Fix table selection in calculate registration image-based (\#615).
 * Testing:
+    * Use more recent Zenodo datasets, created with `fractal-tasks-core>=0.12` (\#623).
     * Use poetry 1.7.1 in GitHub actions (\#620).
     * Align with new Zenodo API (\#601).
     * Update `test_valid_manifest` (\#606).


Test patch:
diff --git a/tests/tasks/conftest.py b/tests/tasks/conftest.py
index d3a3d00e1..53bced15b 100644
--- a/tests/tasks/conftest.py
+++ b/tests/tasks/conftest.py
@@ -1,17 +1,12 @@
-import logging
 import os
 import shutil
 from pathlib import Path
 
-import anndata as ad
 import pooch
 import pytest
-import zarr
 from devtools import debug
 
 from ..conftest import *  # noqa
-from fractal_tasks_core.lib_regions_of_interest import reset_origin
-from fractal_tasks_core.lib_write import write_table
 
 
 @pytest.fixture(scope="session")
@@ -85,15 +80,15 @@ def zenodo_zarr(testdata_path: Path) -> list[str]:
     """
 
     # 1 Download Zarrs from Zenodo
-    DOI = "10.5281/zenodo.8091756"
+    DOI = "10.5281/zenodo.10257149"
     DOI_slug = DOI.replace("/", "_").replace(".", "_")
     platenames = ["plate.zarr", "plate_mip.zarr"]
     rootfolder = testdata_path / DOI_slug
     folders = [rootfolder / plate for plate in platenames]
 
     registry = {
-        "20200812-CardiomyocyteDifferentiation14-Cycle1.zarr.zip": "38b7894530f28fd6f55edf5272aaea104c11f36e28825446d23aff280f3a4290",  # noqa
-        "20200812-CardiomyocyteDifferentiation14-Cycle1_mip.zarr.zip": "7efddc0bd20b186c28ca8373b1f7af2d1723d0663fe9438969dc79da02539175",  # noqa
+        "20200812-CardiomyocyteDifferentiation14-Cycle1.zarr.zip": None,
+        "20200812-CardiomyocyteDifferentiation14-Cycle1_mip.zarr.zip": None,
     }
     base_url = f"doi:{DOI}"
     POOCH = pooch.create(
@@ -123,26 +118,6 @@ def zenodo_zarr(testdata_path: Path) -> list[str]:
             shutil.rmtree(str(folder))
         shutil.copytree(Path(zarr_full_path) / file_name, folder)
 
-        # 3) Modify the Zarr in tests/data to fit with expectations within
-        # fractal-tasks-core.
-        #
-        # Note: this currently consists in udating well/FOV ROI tables, by
-        # shifting their origin to 0.
-        # TODO: remove this fix, by uploading new zarrs to zenodo (ref 526).
-        image_group_path = folder / "B/03/0"
-        group_image = zarr.open_group(str(image_group_path))
-        for table_name in ["FOV_ROI_table", "well_ROI_table"]:
-            table_path = str(image_group_path / "tables" / table_name)
-            old_table = ad.read_zarr(table_path)
-            new_table = reset_origin(old_table)
-            write_table(
-                group_image,
-                table_name,
-                new_table,
-                overwrite=True,
-                logger=logging.getLogger(),
-            )
-
     return [str(f) for f in folders]