1
1
import json
2
- import logging
3
2
import os
4
3
import shutil
5
4
from pathlib import Path
@@ -70,7 +69,7 @@ def zenodo_images_multiplex(testdata_path, zenodo_images):
70
69
@pytest .fixture (scope = "session" )
71
70
def zenodo_zarr (testdata_path , tmpdir_factory ):
72
71
73
- doi = "10.5281/zenodo.7674545 "
72
+ doi = "10.5281/zenodo.8091756 "
74
73
rootfolder = testdata_path / (doi .replace ("." , "_" ).replace ("/" , "_" ))
75
74
platenames = ["plate.zarr" , "plate_mip.zarr" ]
76
75
folders = [rootfolder / plate for plate in platenames ]
@@ -86,37 +85,13 @@ def zenodo_zarr(testdata_path, tmpdir_factory):
86
85
]
87
86
for zarrname , folder in zip (zarrnames , folders ):
88
87
zipname = f"{ zarrname } .zip"
89
- url = f"https://zenodo.org/record/7674545 /files/{ zipname } "
88
+ url = f"https://zenodo.org/record/8091756 /files/{ zipname } "
90
89
wget .download (url , out = str (tmp_path / zipname ), bar = None )
91
90
shutil .unpack_archive (
92
91
str (tmp_path / zipname ), extract_dir = rootfolder , format = "zip"
93
92
)
94
93
shutil .move (str (rootfolder / zarrname ), str (folder ))
95
94
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
-
120
95
folders = [str (f ) for f in folders ]
121
96
122
97
return folders
0 commit comments