Skip to content

Commit 41efe26

Browse files
authored
Merge pull request #454 from fractal-analytics-platform/update_zenodo
Update zenodo dataset for tests (ref #420)
2 parents 883c986 + afb44a9 commit 41efe26

File tree

2 files changed

+4
-27
lines changed

2 files changed

+4
-27
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
* Update Zenodo datasets used in tests (\#454).
2+
13
# 0.10.0
24

35
* Restructure the package and repository:

tests/conftest.py

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import json
2-
import logging
32
import os
43
import shutil
54
from pathlib import Path
@@ -70,7 +69,7 @@ def zenodo_images_multiplex(testdata_path, zenodo_images):
7069
@pytest.fixture(scope="session")
7170
def zenodo_zarr(testdata_path, tmpdir_factory):
7271

73-
doi = "10.5281/zenodo.7674545"
72+
doi = "10.5281/zenodo.8091756"
7473
rootfolder = testdata_path / (doi.replace(".", "_").replace("/", "_"))
7574
platenames = ["plate.zarr", "plate_mip.zarr"]
7675
folders = [rootfolder / plate for plate in platenames]
@@ -86,37 +85,13 @@ def zenodo_zarr(testdata_path, tmpdir_factory):
8685
]
8786
for zarrname, folder in zip(zarrnames, folders):
8887
zipname = f"{zarrname}.zip"
89-
url = f"https://zenodo.org/record/7674545/files/{zipname}"
88+
url = f"https://zenodo.org/record/8091756/files/{zipname}"
9089
wget.download(url, out=str(tmp_path / zipname), bar=None)
9190
shutil.unpack_archive(
9291
str(tmp_path / zipname), extract_dir=rootfolder, format="zip"
9392
)
9493
shutil.move(str(rootfolder / zarrname), str(folder))
9594

96-
# Fix a wrong piece of metadata
97-
zattrs_path = folder / "B/03/0/.zattrs"
98-
logging.warning(
99-
f"Update coordinateTransformations in {str(zattrs_path)}, "
100-
"see https://github.com/fractal-analytics-platform/"
101-
"fractal-tasks-core/issues/420."
102-
)
103-
with zattrs_path.open("r") as f:
104-
zattrs = json.load(f)
105-
for ind, ds in enumerate(zattrs["multiscales"][0]["datasets"]):
106-
new_ds = ds.copy()
107-
old_transf = ds["coordinateTransformations"][0]
108-
new_transf = old_transf.copy()
109-
assert old_transf["type"] == "scale"
110-
assert len(old_transf["scale"]) == 3
111-
new_transf["scale"] = [1.0, *old_transf["scale"]]
112-
new_ds["coordinateTransformations"][0] = new_transf
113-
assert len(new_transf["scale"]) == len(
114-
zattrs["multiscales"][0]["axes"]
115-
)
116-
zattrs["multiscales"][0]["datasets"][ind] = new_ds
117-
with zattrs_path.open("w") as f:
118-
json.dump(zattrs, f, indent=2)
119-
12095
folders = [str(f) for f in folders]
12196

12297
return folders

0 commit comments

Comments
 (0)